goat3d
view Makefile @ 24:6b651613bd9f
fixed the windows stuff
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 28 Sep 2013 06:32:00 +0300 |
parents | f1b4c27382ce |
children | 3d669155709d |
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 openctm = libs/openctm/libopenctm.a
12 tinyxml2 = libs/tinyxml2/libtinyxml2.a
14 extinc = -Ilibs/openctm -Ilibs/tinyxml2
15 extlibs = $(openctm) $(tinyxml2)
17 name = goat3d
18 so_major = 0
19 so_minor = 1
21 lib_a = lib$(name).a
23 ifeq ($(shell uname -s), Darwin)
24 lib_so = lib$(name).dylib
25 shared = -dynamiclib
26 else
27 devlink = lib$(name).so
28 soname = lib$(name).so.$(so_major)
29 lib_so = lib$(name).so.$(so_major).$(so_minor)
31 shared = -shared -Wl,-soname=$(soname)
32 pic = -fPIC
33 endif
35 CC = clang
36 CXX = clang++
37 CXXFLAGS = -pedantic -Wall $(dbg) $(opt) $(pic) $(extinc)
38 LDFLAGS = $(extlibs) -lvmath -lanim
40 .PHONY: all
41 all: $(lib_so) $(lib_a)
43 $(lib_so): $(obj) $(extlibs)
44 $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS)
46 $(lib_a): $(obj) $(extlibs)
47 $(AR) rcs $@ $(obj) $(openctm)
49 $(openctm):
50 $(MAKE) -C libs/openctm
52 $(tinyxml2):
53 $(MAKE) -C libs/tinyxml2
55 -include $(dep)
57 %.d: %.cc
58 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
60 .PHONY: clean
61 clean:
62 rm -f $(obj) $(lib_a) $(lib_so)
64 .PHONY: cleandep
65 cleandep:
66 rm -f $(dep)