erebus

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/liberebus/Makefile	Mon Apr 28 06:31:10 2014 +0300
     1.3 @@ -0,0 +1,41 @@
     1.4 +src = $(wildcard src/*.cc)
     1.5 +obj = $(src:.cc=.o)
     1.6 +dep = $(obj:.o=.d)
     1.7 +
     1.8 +name = erebus
     1.9 +lib_a = lib$(name).a
    1.10 +
    1.11 +api_major = 0
    1.12 +api_minor = 1
    1.13 +
    1.14 +CXXFLAGS = -std=c++11 -pedantic -Wall -g $(pic)
    1.15 +LDFLAGS = -lvmath -limago -lm
    1.16 +
    1.17 +ifeq ($(shell uname -s), Darwin)
    1.18 +	shared = -dynamiclib
    1.19 +	lib_so = lib$(name).dylib
    1.20 +else
    1.21 +	shared = -shared -Wl,-soname=$(soname)
    1.22 +	devlink = lib$(name).so
    1.23 +	soname = lib$(name).so.$(api_major)
    1.24 +	lib_so = lib$(name).so.$(api_major).$(api_minor)
    1.25 +	pic = -fPIC
    1.26 +endif
    1.27 +
    1.28 +.PHONY: all
    1.29 +all: $(lib_so) $(lib_a)
    1.30 +
    1.31 +$(lib_so): $(obj)
    1.32 +	$(CXX) -o $@ $(shared) $(obj) $(LDFLAGS)
    1.33 +
    1.34 +$(lib_a): $(obj)
    1.35 +	$(AR) rcs $@ $(obj)
    1.36 +
    1.37 +-include $(dep)
    1.38 +
    1.39 +%.d: %.cc
    1.40 +	@$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.41 +
    1.42 +.PHONY: clean
    1.43 +clean:
    1.44 +	rm -f $(obj) $(lib_so) $(lib_a)