erebus

view liberebus/Makefile @ 2:474a0244f57d

fixed specialization mistake fixed line endings added makefiles
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 28 Apr 2014 06:31:10 +0300
parents
children 93894c232d65
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 -pedantic -Wall -g $(pic)
12 LDFLAGS = -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)
31 $(lib_a): $(obj)
32 $(AR) rcs $@ $(obj)
34 -include $(dep)
36 %.d: %.cc
37 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
39 .PHONY: clean
40 clean:
41 rm -f $(obj) $(lib_so) $(lib_a)