goat3d

annotate goatview/Makefile @ 80:c5e997e8fd62

lalala
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 08 May 2014 23:00:30 +0300
parents 53ea5b25426e
children 70b7c41a4f17
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@73 5 mochdr = src/goatview.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@80 13 CFLAGS = -pedantic -Wall -g $(pic) -I$(goat_root)/src $(qtinc)
nuclear@80 14 CXXFLAGS = -std=c++11 $(CFLAGS)
nuclear@78 15 LDFLAGS = $(libgoat) $(libgl) $(qtlib) -lvmath
nuclear@73 16 MOC = moc
nuclear@73 17
nuclear@73 18 qtinc = `pkg-config --cflags Qt5Gui Qt5Core Qt5OpenGL`
nuclear@73 19 qtlib = `pkg-config --libs Qt5Gui Qt5Core Qt5OpenGL`
nuclear@19 20
nuclear@19 21 ifeq ($(shell uname -s), Darwin)
nuclear@19 22 libgl = -framework OpenGL -framework GLUT -lGLEW
nuclear@23 23 libgoat = $(goat_root)/libgoat3d.dylib
nuclear@19 24 else
nuclear@73 25 pic = -fPIC
nuclear@19 26 libgl = -lGL -lGLU -lglut -lGLEW
nuclear@44 27 libgoat = $(goat_root)/libgoat3d.so.0.1
nuclear@19 28 endif
nuclear@19 29
nuclear@19 30 $(bin): $(obj) $(libgoat)
nuclear@73 31 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@73 32
nuclear@73 33 # rule for running moc on ui header files
nuclear@73 34 moc_%.cc: %.h
nuclear@73 35 $(MOC) -o $@ $<
nuclear@19 36
nuclear@19 37 -include $(dep)
nuclear@19 38
nuclear@80 39 %.d: %.c
nuclear@80 40 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@80 41
nuclear@73 42 %.d: %.cc
nuclear@73 43 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@19 44
nuclear@19 45 .PHONY: clean
nuclear@19 46 clean:
nuclear@19 47 rm -f $(obj) $(bin)
nuclear@19 48
nuclear@19 49 .PHONY: cleandep
nuclear@19 50 cleandep:
nuclear@19 51 rm -f $(dep)
nuclear@46 52
nuclear@46 53 .PHONY: install
nuclear@46 54 install: $(bin)
nuclear@46 55 cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
nuclear@46 56
nuclear@46 57 .PHONY: uninstall
nuclear@46 58 uninstall:
nuclear@46 59 rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)