nuclear@2: src = $(wildcard src/*.cc) nuclear@2: obj = $(src:.cc=.o) nuclear@2: dep = $(obj:.o=.d) nuclear@2: nuclear@2: name = erebus nuclear@2: lib_a = lib$(name).a nuclear@2: nuclear@2: api_major = 0 nuclear@2: api_minor = 1 nuclear@2: nuclear@2: CXXFLAGS = -std=c++11 -pedantic -Wall -g $(pic) nuclear@2: LDFLAGS = -lvmath -limago -lm nuclear@2: nuclear@2: ifeq ($(shell uname -s), Darwin) nuclear@2: shared = -dynamiclib nuclear@2: lib_so = lib$(name).dylib nuclear@2: else nuclear@2: shared = -shared -Wl,-soname=$(soname) nuclear@2: devlink = lib$(name).so nuclear@2: soname = lib$(name).so.$(api_major) nuclear@2: lib_so = lib$(name).so.$(api_major).$(api_minor) nuclear@2: pic = -fPIC nuclear@2: endif nuclear@2: nuclear@2: .PHONY: all nuclear@2: all: $(lib_so) $(lib_a) nuclear@2: nuclear@2: $(lib_so): $(obj) nuclear@2: $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS) nuclear@2: nuclear@2: $(lib_a): $(obj) nuclear@2: $(AR) rcs $@ $(obj) nuclear@2: nuclear@2: -include $(dep) nuclear@2: nuclear@2: %.d: %.cc nuclear@2: @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@2: nuclear@2: .PHONY: clean nuclear@2: clean: nuclear@2: rm -f $(obj) $(lib_so) $(lib_a)