erebus
view liberebus/Makefile @ 37:db8a90307386
implemented console and rudimentary commandline parser
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 09 Jun 2014 16:01:00 +0300 |
parents | 93894c232d65 |
children | bab25c0ce337 |
line source
1 src = $(wildcard src/*.cc)
2 obj = $(src:.cc=.o)
3 dep = $(obj:.o=.d)
5 name = erebus
6 lib_a = lib$(name).a
8 api_major = 0
9 api_minor = 1
11 CXXFLAGS = -std=c++11 -pthread -pedantic $(warn) $(dbg) $(opt) $(pic)
12 LDFLAGS = -pthread -lvmath -limago -lm
14 ifeq ($(shell uname -s), Darwin)
15 shared = -dynamiclib
16 lib_so = lib$(name).dylib
17 else
18 shared = -shared -Wl,-soname=$(soname)
19 devlink = lib$(name).so
20 soname = lib$(name).so.$(api_major)
21 lib_so = lib$(name).so.$(api_major).$(api_minor)
22 pic = -fPIC
23 endif
25 .PHONY: all
26 all: $(lib_so) $(lib_a)
28 $(lib_so): $(obj)
29 $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS)
30 [ -n "$(devlink)" ] && \
31 rm -f $(soname) $(devlink) && \
32 ln -s $@ $(soname) && ln -s $(soname) $(devlink) || true
34 $(lib_a): $(obj)
35 $(AR) rcs $@ $(obj)
37 -include $(dep)
39 %.d: %.cc
40 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
42 .PHONY: clean
43 clean:
44 rm -f $(obj) $(lib_so) $(lib_a) $(soname) $(devlink)