goat3d

view Makefile @ 11:d1cebaf1d5c9

ok wtf
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 26 Aug 2013 05:42:30 +0300
parents 2918358f5e6d
children 188c697b3b49
line source
1 # ----- options -----
2 PREFIX = /usr/local
3 dbg = -g
4 opt = -O0
5 # -------------------
7 src = $(wildcard src/*.cc)
8 obj = $(src:.cc=.o)
9 dep = $(obj:.o=.d)
11 name = goat3d
12 so_major = 0
13 so_minor = 1
15 lib_a = lib$(name).a
17 ifeq ($(shell uname -s), Darwin)
18 lib_so = lib$(name).dylib
19 shared = -dynamiclib
20 else
21 devlink = lib$(name).so
22 soname = lib$(name).so.$(so_major)
23 lib_so = lib$(name).so.$(so_major).$(so_minor)
25 shared = -shared -Wl,-soname=$(soname)
26 pic = -fPIC
27 endif
29 CXXFLAGS = -pedantic -Wall $(dbg) $(opt) $(pic)
30 LDFLAGS = -lvmath -lanim
32 .PHONY: all
33 all: $(lib_so) $(lib_a)
35 $(lib_so): $(obj)
36 $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS)
38 $(lib_a): $(obj)
39 $(AR) rcs $@ $(obj)
41 -include $(dep)
43 %.d: %.cc
44 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
46 .PHONY: clean
47 clean:
48 rm -f $(obj) $(lib_a) $(lib_so)
50 .PHONY: cleandep
51 cleandep:
52 rm -f $(dep)