goat3d

annotate 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
rev   line source
nuclear@0 1 # ----- options -----
nuclear@0 2 PREFIX = /usr/local
nuclear@0 3 dbg = -g
nuclear@0 4 opt = -O0
nuclear@0 5 # -------------------
nuclear@0 6
nuclear@0 7 src = $(wildcard src/*.cc)
nuclear@0 8 obj = $(src:.cc=.o)
nuclear@0 9 dep = $(obj:.o=.d)
nuclear@0 10
nuclear@14 11 openctm = libs/openctm/libopenctm.a
nuclear@14 12
nuclear@14 13 extinc = -Ilibs/openctm
nuclear@14 14 extlibs = $(openctm)
nuclear@14 15
nuclear@0 16 name = goat3d
nuclear@0 17 so_major = 0
nuclear@0 18 so_minor = 1
nuclear@0 19
nuclear@0 20 lib_a = lib$(name).a
nuclear@0 21
nuclear@0 22 ifeq ($(shell uname -s), Darwin)
nuclear@0 23 lib_so = lib$(name).dylib
nuclear@0 24 shared = -dynamiclib
nuclear@0 25 else
nuclear@0 26 devlink = lib$(name).so
nuclear@0 27 soname = lib$(name).so.$(so_major)
nuclear@0 28 lib_so = lib$(name).so.$(so_major).$(so_minor)
nuclear@0 29
nuclear@0 30 shared = -shared -Wl,-soname=$(soname)
nuclear@0 31 pic = -fPIC
nuclear@0 32 endif
nuclear@0 33
nuclear@14 34 CXXFLAGS = -pedantic -Wall $(dbg) $(opt) $(pic) $(extinc)
nuclear@14 35 LDFLAGS = $(extlibs) -lvmath -lanim
nuclear@0 36
nuclear@0 37 .PHONY: all
nuclear@0 38 all: $(lib_so) $(lib_a)
nuclear@0 39
nuclear@14 40 $(lib_so): $(obj) $(extlibs)
nuclear@0 41 $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS)
nuclear@0 42
nuclear@14 43 $(lib_a): $(obj) $(extlibs)
nuclear@0 44 $(AR) rcs $@ $(obj)
nuclear@0 45
nuclear@14 46 $(openctm):
nuclear@14 47 $(MAKE) -C libs/openctm
nuclear@14 48
nuclear@0 49 -include $(dep)
nuclear@0 50
nuclear@0 51 %.d: %.cc
nuclear@0 52 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 53
nuclear@0 54 .PHONY: clean
nuclear@0 55 clean:
nuclear@0 56 rm -f $(obj) $(lib_a) $(lib_so)
nuclear@0 57
nuclear@0 58 .PHONY: cleandep
nuclear@0 59 cleandep:
nuclear@0 60 rm -f $(dep)