goat3d
view Makefile @ 0:2918358f5e6d
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 17 Aug 2013 16:10:26 +0300 |
parents | |
children | e46529a5d057 |
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)
31 .PHONY: all
32 all: $(lib_so) $(lib_a)
34 $(lib_so): $(obj)
35 $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS)
37 $(lib_a): $(obj)
38 $(AR) rcs $@ $(obj)
40 -include $(dep)
42 %.d: %.cc
43 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
45 .PHONY: clean
46 clean:
47 rm -f $(obj) $(lib_a) $(lib_so)
49 .PHONY: cleandep
50 cleandep:
51 rm -f $(dep)