nuclear@11: ifdef use_vr nuclear@11: vr_ccsrc = $(wildcard src/vr/*.cc) nuclear@11: endif nuclear@0: nuclear@0: csrc = $(wildcard src/*.c) nuclear@11: ccsrc = $(wildcard src/*.cc) $(vr_ccsrc) nuclear@0: obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) nuclear@0: dep = $(obj:.o=.d) nuclear@0: name = goat3dgfx nuclear@0: lib_a = lib$(name).a nuclear@0: nuclear@23: pcfile = $(name).pc nuclear@23: nuclear@0: so_major = 0 nuclear@0: so_minor = 1 nuclear@0: nuclear@0: ifeq ($(shell uname -r), Darwin) nuclear@0: lib_so = lib$(name).dylib nuclear@0: shared = -dynamiclib nuclear@0: else nuclear@0: lib_so = lib$(name).so.$(so_major).$(so_minor) nuclear@0: soname = lib$(name).so.$(so_major) nuclear@0: devlink = lib$(name).so nuclear@0: shared = -shared -Wl,-soname=$(soname) nuclear@0: pic = -fPIC nuclear@0: endif nuclear@0: nuclear@12: inc = -Isrc -Isrc/vr nuclear@8: warn = -Wall nuclear@0: nuclear@23: libs_ldflags = -limago -lanim -lpsys -lvmath -lresman nuclear@9: nuclear@10: CFLAGS = -pedantic $(warn) $(dbg) $(pic) $(opt) $(inc) $(cfg_cflags) $(libs_cflags) nuclear@0: CXXFLAGS = $(CFLAGS) nuclear@15: LDFLAGS = $(cfg_ldflags) $(libs_ldflags) -lgoat3d nuclear@0: nuclear@0: .PHONY: all nuclear@0: all: $(lib_so) $(lib_a) nuclear@0: nuclear@0: $(lib_a): $(obj) nuclear@0: $(AR) rcs $@ $(obj) nuclear@0: nuclear@0: $(lib_so): $(obj) nuclear@0: $(CXX) $(shared) -o $@ $(obj) $(LDFLAGS) nuclear@0: nuclear@0: -include $(dep) nuclear@0: nuclear@0: %.d: %.c nuclear@0: @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ 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) nuclear@0: nuclear@0: .PHONY: install nuclear@0: install: $(lib_so) $(lib_a) nuclear@0: mkdir -p $(DESTDIR)$(PREFIX)/lib $(DESTDIR)$(PREFIX)/include/goat3dgfx nuclear@0: cp src/*.h src/*.inl $(DESTDIR)$(PREFIX)/include/goat3dgfx/ nuclear@0: cp $(lib_a) $(DESTDIR)$(PREFIX)/lib/$(lib_a) nuclear@0: cp $(lib_so) $(DESTDIR)$(PREFIX)/lib/$(lib_so) nuclear@0: [ -n "$(devlink)" ] && \ nuclear@0: cd $(DESTDIR)$(PREFIX)/lib && \ nuclear@0: rm -f $(soname) $(devlink) && \ nuclear@0: ln -s $(lib_so) $(soname) && \ nuclear@0: ln -s $(soname) $(devlink) || \ nuclear@0: true nuclear@23: mkdir -p $(DESTDIR)$(PREFIX)/share/pkgconfig nuclear@23: cp $(pcfile) $(DESTDIR)$(PREFIX)/share/pkgconfig/$(pcfile) nuclear@0: nuclear@0: .PHONY: uninstall nuclear@0: uninstall: nuclear@0: rm -f $(DESTDIR)$(PREFIX)/include/goat3dgfx/* nuclear@0: rmdir $(DESTDIR)$(PREFIX)/include/goat3dgfx nuclear@0: rm -f $(DESTDIR)$(PREFIX)/lib/$(lib_so) nuclear@0: rm -f $(DESTDIR)$(PREFIX)/lib/$(lib_a) nuclear@0: [ -n "$(devlink)" ] && \ nuclear@0: rm -f $(DESTDIR)$(PREFIX)/lib/$(soname) && \ nuclear@0: rm -f $(DESTDIR)$(PREFIX)/lib/$(devlink) || \ nuclear@0: true nuclear@23: rm -f $(DESTDIR)$(PREFIX)/share/pkgconfig/$(pcfile)