nuclear@0: # ----- options ----- nuclear@0: PREFIX = /usr/local nuclear@0: dbg = -g nuclear@0: opt = -O0 nuclear@0: # ------------------- nuclear@0: nuclear@0: src = $(wildcard src/*.cc) nuclear@0: obj = $(src:.cc=.o) nuclear@0: dep = $(obj:.o=.d) nuclear@0: nuclear@14: openctm = libs/openctm/libopenctm.a nuclear@14: nuclear@14: extinc = -Ilibs/openctm nuclear@14: extlibs = $(openctm) nuclear@14: nuclear@0: name = goat3d nuclear@0: so_major = 0 nuclear@0: so_minor = 1 nuclear@0: nuclear@0: lib_a = lib$(name).a nuclear@0: nuclear@0: ifeq ($(shell uname -s), Darwin) nuclear@0: lib_so = lib$(name).dylib nuclear@0: shared = -dynamiclib nuclear@0: else nuclear@0: devlink = lib$(name).so nuclear@0: soname = lib$(name).so.$(so_major) nuclear@0: lib_so = lib$(name).so.$(so_major).$(so_minor) nuclear@0: nuclear@0: shared = -shared -Wl,-soname=$(soname) nuclear@0: pic = -fPIC nuclear@0: endif nuclear@0: nuclear@15: CC = clang nuclear@15: CXX = clang++ nuclear@14: CXXFLAGS = -pedantic -Wall $(dbg) $(opt) $(pic) $(extinc) nuclear@14: LDFLAGS = $(extlibs) -lvmath -lanim nuclear@0: nuclear@0: .PHONY: all nuclear@0: all: $(lib_so) $(lib_a) nuclear@0: nuclear@14: $(lib_so): $(obj) $(extlibs) nuclear@0: $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS) nuclear@0: nuclear@14: $(lib_a): $(obj) $(extlibs) nuclear@15: $(AR) rcs $@ $(obj) $(openctm) nuclear@0: nuclear@14: $(openctm): nuclear@14: $(MAKE) -C libs/openctm nuclear@14: nuclear@0: -include $(dep) nuclear@0: nuclear@0: %.d: %.cc nuclear@0: @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@0: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(lib_a) $(lib_so) nuclear@0: nuclear@0: .PHONY: cleandep nuclear@0: cleandep: nuclear@0: rm -f $(dep)