goat3d
annotate goatview/Makefile @ 78:53ea5b25426e
progress
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 08 May 2014 16:25:04 +0300 |
parents | 9862541fdcf5 |
children | c5e997e8fd62 |
rev | line source |
---|---|
nuclear@46 | 1 PREFIX = /usr/local |
nuclear@46 | 2 |
nuclear@73 | 3 src = $(wildcard src/*.cc) |
nuclear@73 | 4 mochdr = src/goatview.h |
nuclear@73 | 5 mocsrc = $(patsubst src/%.h,src/moc_%.cc,$(mochdr)) |
nuclear@73 | 6 obj = $(sort $(src:.cc=.o) $(mocsrc:.cc=.o)) |
nuclear@19 | 7 dep = $(obj:.o=.d) |
nuclear@19 | 8 bin = goatview |
nuclear@19 | 9 |
nuclear@19 | 10 goat_root = .. |
nuclear@19 | 11 |
nuclear@73 | 12 CXXFLAGS = -std=c++11 -pedantic -Wall -g $(pic) -I$(goat_root)/src $(qtinc) |
nuclear@78 | 13 LDFLAGS = $(libgoat) $(libgl) $(qtlib) -lvmath |
nuclear@73 | 14 MOC = moc |
nuclear@73 | 15 |
nuclear@73 | 16 qtinc = `pkg-config --cflags Qt5Gui Qt5Core Qt5OpenGL` |
nuclear@73 | 17 qtlib = `pkg-config --libs Qt5Gui Qt5Core Qt5OpenGL` |
nuclear@19 | 18 |
nuclear@19 | 19 ifeq ($(shell uname -s), Darwin) |
nuclear@19 | 20 libgl = -framework OpenGL -framework GLUT -lGLEW |
nuclear@23 | 21 libgoat = $(goat_root)/libgoat3d.dylib |
nuclear@19 | 22 else |
nuclear@73 | 23 pic = -fPIC |
nuclear@19 | 24 libgl = -lGL -lGLU -lglut -lGLEW |
nuclear@44 | 25 libgoat = $(goat_root)/libgoat3d.so.0.1 |
nuclear@19 | 26 endif |
nuclear@19 | 27 |
nuclear@19 | 28 $(bin): $(obj) $(libgoat) |
nuclear@73 | 29 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@73 | 30 |
nuclear@73 | 31 # rule for running moc on ui header files |
nuclear@73 | 32 moc_%.cc: %.h |
nuclear@73 | 33 $(MOC) -o $@ $< |
nuclear@19 | 34 |
nuclear@19 | 35 -include $(dep) |
nuclear@19 | 36 |
nuclear@73 | 37 %.d: %.cc |
nuclear@73 | 38 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@19 | 39 |
nuclear@19 | 40 .PHONY: clean |
nuclear@19 | 41 clean: |
nuclear@19 | 42 rm -f $(obj) $(bin) |
nuclear@19 | 43 |
nuclear@19 | 44 .PHONY: cleandep |
nuclear@19 | 45 cleandep: |
nuclear@19 | 46 rm -f $(dep) |
nuclear@46 | 47 |
nuclear@46 | 48 .PHONY: install |
nuclear@46 | 49 install: $(bin) |
nuclear@46 | 50 cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin) |
nuclear@46 | 51 |
nuclear@46 | 52 .PHONY: uninstall |
nuclear@46 | 53 uninstall: |
nuclear@46 | 54 rm -f $(DESTDIR)$(PREFIX)/bin/$(bin) |