goat3d
annotate goatview/Makefile @ 94:21319e71117f
[libs] fixed a few warnings in openctm
[goatview] starting animation loading
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 18 May 2014 19:58:47 +0300 |
parents | f92da4fa9a6d |
children | b43d33f3ba69 |
rev | line source |
---|---|
nuclear@46 | 1 PREFIX = /usr/local |
nuclear@46 | 2 |
nuclear@73 | 3 src = $(wildcard src/*.cc) |
nuclear@80 | 4 csrc = $(wildcard src/*.c) |
nuclear@85 | 5 mochdr = src/goatview.h src/scenemodel.h |
nuclear@73 | 6 mocsrc = $(patsubst src/%.h,src/moc_%.cc,$(mochdr)) |
nuclear@80 | 7 obj = $(sort $(csrc:.c=.o) $(src:.cc=.o) $(mocsrc:.cc=.o)) |
nuclear@19 | 8 dep = $(obj:.o=.d) |
nuclear@19 | 9 bin = goatview |
nuclear@19 | 10 |
nuclear@19 | 11 goat_root = .. |
nuclear@19 | 12 |
nuclear@91 | 13 warn = -Wall |
nuclear@91 | 14 |
nuclear@91 | 15 CFLAGS = $(warn) -g $(pic) -I$(goat_root)/src $(qtinc) |
nuclear@80 | 16 CXXFLAGS = -std=c++11 $(CFLAGS) |
nuclear@92 | 17 LDFLAGS = $(libgoat) $(libgl) $(qtlib) -lvmath -lanim |
nuclear@73 | 18 MOC = moc |
nuclear@73 | 19 |
nuclear@73 | 20 qtinc = `pkg-config --cflags Qt5Gui Qt5Core Qt5OpenGL` |
nuclear@73 | 21 qtlib = `pkg-config --libs Qt5Gui Qt5Core Qt5OpenGL` |
nuclear@19 | 22 |
nuclear@19 | 23 ifeq ($(shell uname -s), Darwin) |
nuclear@19 | 24 libgl = -framework OpenGL -framework GLUT -lGLEW |
nuclear@23 | 25 libgoat = $(goat_root)/libgoat3d.dylib |
nuclear@91 | 26 warn += -Wno-deprecated-declarations |
nuclear@92 | 27 bundle = $(bin).app |
nuclear@92 | 28 dmg = $(bin).dmg |
nuclear@19 | 29 else |
nuclear@73 | 30 pic = -fPIC |
nuclear@19 | 31 libgl = -lGL -lGLU -lglut -lGLEW |
nuclear@44 | 32 libgoat = $(goat_root)/libgoat3d.so.0.1 |
nuclear@19 | 33 endif |
nuclear@19 | 34 |
nuclear@91 | 35 ifeq ($(CC), gcc) |
nuclear@91 | 36 warn += -Wno-cpp |
nuclear@91 | 37 endif |
nuclear@91 | 38 ifneq ($(shell $(CC) --version | grep LLVM),) |
nuclear@91 | 39 CXXFLAGS += -stdlib=libc++ |
nuclear@92 | 40 warn += '-Wno-\#warnings' |
nuclear@91 | 41 endif |
nuclear@91 | 42 |
nuclear@19 | 43 $(bin): $(obj) $(libgoat) |
nuclear@73 | 44 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@73 | 45 |
nuclear@73 | 46 # rule for running moc on ui header files |
nuclear@73 | 47 moc_%.cc: %.h |
nuclear@73 | 48 $(MOC) -o $@ $< |
nuclear@19 | 49 |
nuclear@19 | 50 -include $(dep) |
nuclear@19 | 51 |
nuclear@80 | 52 %.d: %.c |
nuclear@80 | 53 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@80 | 54 |
nuclear@73 | 55 %.d: %.cc |
nuclear@73 | 56 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@19 | 57 |
nuclear@19 | 58 .PHONY: clean |
nuclear@19 | 59 clean: |
nuclear@19 | 60 rm -f $(obj) $(bin) |
nuclear@92 | 61 [ -n "$(bundle)" ] && rm -rf $(bundle) || true |
nuclear@92 | 62 [ -n "$(dmg)" ] && rm -rf $(dmg) || true |
nuclear@19 | 63 |
nuclear@19 | 64 .PHONY: cleandep |
nuclear@19 | 65 cleandep: |
nuclear@19 | 66 rm -f $(dep) |
nuclear@46 | 67 |
nuclear@46 | 68 .PHONY: install |
nuclear@46 | 69 install: $(bin) |
nuclear@46 | 70 cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin) |
nuclear@46 | 71 |
nuclear@46 | 72 .PHONY: uninstall |
nuclear@46 | 73 uninstall: |
nuclear@46 | 74 rm -f $(DESTDIR)$(PREFIX)/bin/$(bin) |
nuclear@92 | 75 |
nuclear@92 | 76 .PHONY: echo |
nuclear@92 | 77 echo: |
nuclear@92 | 78 @echo $(var)=\"$($(var))\" |
nuclear@92 | 79 |
nuclear@92 | 80 .PHONY: bundle |
nuclear@92 | 81 bundle: $(bundle) |
nuclear@92 | 82 |
nuclear@92 | 83 .PHONY: dmg |
nuclear@92 | 84 dmg: $(dmg) |
nuclear@92 | 85 |
nuclear@92 | 86 $(bundle): $(bin) $(libgoat) |
nuclear@92 | 87 rm -rf $(bundle) |
nuclear@92 | 88 mkdir -p $(bundle)/Contents/MacOS |
nuclear@92 | 89 mkdir -p $(bundle)/Contents/Frameworks |
nuclear@92 | 90 cp $(bin) $(bundle)/Contents/MacOS/$(bin) |
nuclear@92 | 91 macdeployqt $(bundle) |
nuclear@92 | 92 cp $(libgoat) $(bundle)/Contents/Frameworks |
nuclear@92 | 93 cp /usr/local/lib/libvmath.dylib $(bundle)/Contents/Frameworks |
nuclear@92 | 94 cp /usr/local/lib/libanim.dylib $(bundle)/Contents/Frameworks |
nuclear@92 | 95 |
nuclear@92 | 96 $(dmg): $(bundle) |
nuclear@92 | 97 rm -f $@ |
nuclear@92 | 98 hdiutil create -format UDBZ -quiet -srcfolder $< $@ |
nuclear@92 | 99 |
nuclear@92 | 100 .PHONY: run |
nuclear@92 | 101 ifeq ($(shell uname -s), Darwin) |
nuclear@92 | 102 run: $(bundle) |
nuclear@92 | 103 ./$(bundle)/Contents/MacOS/$(bin) |
nuclear@92 | 104 else |
nuclear@92 | 105 run: $(bin) |
nuclear@92 | 106 ./$(bin) |
nuclear@92 | 107 endif |