goat3dgfx
annotate Makefile.in @ 26:940e5b1e2f92
once again, re-commit due to not saved changes to project files
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 27 Feb 2014 02:05:42 +0200 |
parents | 7d6b667821cf |
children | 7f0aed0fe289 |
rev | line source |
---|---|
nuclear@11 | 1 ifdef use_vr |
nuclear@11 | 2 vr_ccsrc = $(wildcard src/vr/*.cc) |
nuclear@11 | 3 endif |
nuclear@0 | 4 |
nuclear@0 | 5 csrc = $(wildcard src/*.c) |
nuclear@11 | 6 ccsrc = $(wildcard src/*.cc) $(vr_ccsrc) |
nuclear@0 | 7 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) |
nuclear@0 | 8 dep = $(obj:.o=.d) |
nuclear@0 | 9 name = goat3dgfx |
nuclear@0 | 10 lib_a = lib$(name).a |
nuclear@0 | 11 |
nuclear@23 | 12 pcfile = $(name).pc |
nuclear@23 | 13 |
nuclear@0 | 14 so_major = 0 |
nuclear@0 | 15 so_minor = 1 |
nuclear@0 | 16 |
nuclear@0 | 17 ifeq ($(shell uname -r), Darwin) |
nuclear@0 | 18 lib_so = lib$(name).dylib |
nuclear@0 | 19 shared = -dynamiclib |
nuclear@0 | 20 else |
nuclear@0 | 21 lib_so = lib$(name).so.$(so_major).$(so_minor) |
nuclear@0 | 22 soname = lib$(name).so.$(so_major) |
nuclear@0 | 23 devlink = lib$(name).so |
nuclear@0 | 24 shared = -shared -Wl,-soname=$(soname) |
nuclear@0 | 25 pic = -fPIC |
nuclear@0 | 26 endif |
nuclear@0 | 27 |
nuclear@12 | 28 inc = -Isrc -Isrc/vr |
nuclear@8 | 29 warn = -Wall |
nuclear@0 | 30 |
nuclear@23 | 31 libs_ldflags = -limago -lanim -lpsys -lvmath -lresman |
nuclear@9 | 32 |
nuclear@10 | 33 CFLAGS = -pedantic $(warn) $(dbg) $(pic) $(opt) $(inc) $(cfg_cflags) $(libs_cflags) |
nuclear@0 | 34 CXXFLAGS = $(CFLAGS) |
nuclear@15 | 35 LDFLAGS = $(cfg_ldflags) $(libs_ldflags) -lgoat3d |
nuclear@0 | 36 |
nuclear@0 | 37 .PHONY: all |
nuclear@0 | 38 all: $(lib_so) $(lib_a) |
nuclear@0 | 39 |
nuclear@0 | 40 $(lib_a): $(obj) |
nuclear@0 | 41 $(AR) rcs $@ $(obj) |
nuclear@0 | 42 |
nuclear@0 | 43 $(lib_so): $(obj) |
nuclear@0 | 44 $(CXX) $(shared) -o $@ $(obj) $(LDFLAGS) |
nuclear@0 | 45 |
nuclear@0 | 46 -include $(dep) |
nuclear@0 | 47 |
nuclear@0 | 48 %.d: %.c |
nuclear@0 | 49 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 50 |
nuclear@0 | 51 %.d: %.cc |
nuclear@0 | 52 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 53 |
nuclear@0 | 54 .PHONY: clean |
nuclear@0 | 55 clean: |
nuclear@0 | 56 rm -f $(obj) $(lib_a) $(lib_so) |
nuclear@0 | 57 |
nuclear@0 | 58 .PHONY: cleandep |
nuclear@0 | 59 cleandep: |
nuclear@0 | 60 rm -f $(dep) |
nuclear@0 | 61 |
nuclear@0 | 62 .PHONY: install |
nuclear@0 | 63 install: $(lib_so) $(lib_a) |
nuclear@0 | 64 mkdir -p $(DESTDIR)$(PREFIX)/lib $(DESTDIR)$(PREFIX)/include/goat3dgfx |
nuclear@0 | 65 cp src/*.h src/*.inl $(DESTDIR)$(PREFIX)/include/goat3dgfx/ |
nuclear@0 | 66 cp $(lib_a) $(DESTDIR)$(PREFIX)/lib/$(lib_a) |
nuclear@0 | 67 cp $(lib_so) $(DESTDIR)$(PREFIX)/lib/$(lib_so) |
nuclear@0 | 68 [ -n "$(devlink)" ] && \ |
nuclear@0 | 69 cd $(DESTDIR)$(PREFIX)/lib && \ |
nuclear@0 | 70 rm -f $(soname) $(devlink) && \ |
nuclear@0 | 71 ln -s $(lib_so) $(soname) && \ |
nuclear@0 | 72 ln -s $(soname) $(devlink) || \ |
nuclear@0 | 73 true |
nuclear@23 | 74 mkdir -p $(DESTDIR)$(PREFIX)/share/pkgconfig |
nuclear@23 | 75 cp $(pcfile) $(DESTDIR)$(PREFIX)/share/pkgconfig/$(pcfile) |
nuclear@0 | 76 |
nuclear@0 | 77 .PHONY: uninstall |
nuclear@0 | 78 uninstall: |
nuclear@0 | 79 rm -f $(DESTDIR)$(PREFIX)/include/goat3dgfx/* |
nuclear@0 | 80 rmdir $(DESTDIR)$(PREFIX)/include/goat3dgfx |
nuclear@0 | 81 rm -f $(DESTDIR)$(PREFIX)/lib/$(lib_so) |
nuclear@0 | 82 rm -f $(DESTDIR)$(PREFIX)/lib/$(lib_a) |
nuclear@0 | 83 [ -n "$(devlink)" ] && \ |
nuclear@0 | 84 rm -f $(DESTDIR)$(PREFIX)/lib/$(soname) && \ |
nuclear@0 | 85 rm -f $(DESTDIR)$(PREFIX)/lib/$(devlink) || \ |
nuclear@0 | 86 true |
nuclear@23 | 87 rm -f $(DESTDIR)$(PREFIX)/share/pkgconfig/$(pcfile) |