goat3d

view Makefile @ 14:188c697b3b49

- added a document describing the goat3d file format chunk hierarchy - started an alternative XML-based file format - added the openctm library
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 26 Sep 2013 04:47:05 +0300
parents e46529a5d057
children f1b4c27382ce
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
13 extinc = -Ilibs/openctm
14 extlibs = $(openctm)
16 name = goat3d
17 so_major = 0
18 so_minor = 1
20 lib_a = lib$(name).a
22 ifeq ($(shell uname -s), Darwin)
23 lib_so = lib$(name).dylib
24 shared = -dynamiclib
25 else
26 devlink = lib$(name).so
27 soname = lib$(name).so.$(so_major)
28 lib_so = lib$(name).so.$(so_major).$(so_minor)
30 shared = -shared -Wl,-soname=$(soname)
31 pic = -fPIC
32 endif
34 CXXFLAGS = -pedantic -Wall $(dbg) $(opt) $(pic) $(extinc)
35 LDFLAGS = $(extlibs) -lvmath -lanim
37 .PHONY: all
38 all: $(lib_so) $(lib_a)
40 $(lib_so): $(obj) $(extlibs)
41 $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS)
43 $(lib_a): $(obj) $(extlibs)
44 $(AR) rcs $@ $(obj)
46 $(openctm):
47 $(MAKE) -C libs/openctm
49 -include $(dep)
51 %.d: %.cc
52 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
54 .PHONY: clean
55 clean:
56 rm -f $(obj) $(lib_a) $(lib_so)
58 .PHONY: cleandep
59 cleandep:
60 rm -f $(dep)