goat3d

view Makefile @ 17:1d85d7dd0038

goatprim done
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 27 Sep 2013 02:29:52 +0300
parents 188c697b3b49
children b35427826b60
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 CC = clang
35 CXX = clang++
36 CXXFLAGS = -pedantic -Wall $(dbg) $(opt) $(pic) $(extinc)
37 LDFLAGS = $(extlibs) -lvmath -lanim
39 .PHONY: all
40 all: $(lib_so) $(lib_a)
42 $(lib_so): $(obj) $(extlibs)
43 $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS)
45 $(lib_a): $(obj) $(extlibs)
46 $(AR) rcs $@ $(obj) $(openctm)
48 $(openctm):
49 $(MAKE) -C libs/openctm
51 -include $(dep)
53 %.d: %.cc
54 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
56 .PHONY: clean
57 clean:
58 rm -f $(obj) $(lib_a) $(lib_so)
60 .PHONY: cleandep
61 cleandep:
62 rm -f $(dep)