erebus
annotate 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 |
rev | line source |
---|---|
nuclear@2 | 1 src = $(wildcard src/*.cc) |
nuclear@2 | 2 obj = $(src:.cc=.o) |
nuclear@2 | 3 dep = $(obj:.o=.d) |
nuclear@2 | 4 |
nuclear@2 | 5 name = erebus |
nuclear@2 | 6 lib_a = lib$(name).a |
nuclear@2 | 7 |
nuclear@2 | 8 api_major = 0 |
nuclear@2 | 9 api_minor = 1 |
nuclear@2 | 10 |
nuclear@2 | 11 CXXFLAGS = -std=c++11 -pedantic -Wall -g $(pic) |
nuclear@2 | 12 LDFLAGS = -lvmath -limago -lm |
nuclear@2 | 13 |
nuclear@2 | 14 ifeq ($(shell uname -s), Darwin) |
nuclear@2 | 15 shared = -dynamiclib |
nuclear@2 | 16 lib_so = lib$(name).dylib |
nuclear@2 | 17 else |
nuclear@2 | 18 shared = -shared -Wl,-soname=$(soname) |
nuclear@2 | 19 devlink = lib$(name).so |
nuclear@2 | 20 soname = lib$(name).so.$(api_major) |
nuclear@2 | 21 lib_so = lib$(name).so.$(api_major).$(api_minor) |
nuclear@2 | 22 pic = -fPIC |
nuclear@2 | 23 endif |
nuclear@2 | 24 |
nuclear@2 | 25 .PHONY: all |
nuclear@2 | 26 all: $(lib_so) $(lib_a) |
nuclear@2 | 27 |
nuclear@2 | 28 $(lib_so): $(obj) |
nuclear@2 | 29 $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS) |
nuclear@2 | 30 |
nuclear@2 | 31 $(lib_a): $(obj) |
nuclear@2 | 32 $(AR) rcs $@ $(obj) |
nuclear@2 | 33 |
nuclear@2 | 34 -include $(dep) |
nuclear@2 | 35 |
nuclear@2 | 36 %.d: %.cc |
nuclear@2 | 37 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@2 | 38 |
nuclear@2 | 39 .PHONY: clean |
nuclear@2 | 40 clean: |
nuclear@2 | 41 rm -f $(obj) $(lib_so) $(lib_a) |