goat3d

annotate goatview/Makefile @ 91:f92da4fa9a6d

fixed for macosx
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 17 May 2014 15:42:10 +0300
parents 91e3aa1a60c3
children ae6c5941faac
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@78 17 LDFLAGS = $(libgoat) $(libgl) $(qtlib) -lvmath
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@19 27 else
nuclear@73 28 pic = -fPIC
nuclear@19 29 libgl = -lGL -lGLU -lglut -lGLEW
nuclear@44 30 libgoat = $(goat_root)/libgoat3d.so.0.1
nuclear@19 31 endif
nuclear@19 32
nuclear@91 33 ifeq ($(CC), gcc)
nuclear@91 34 warn += -Wno-cpp
nuclear@91 35 endif
nuclear@91 36 ifneq ($(shell $(CC) --version | grep LLVM),)
nuclear@91 37 CXXFLAGS += -stdlib=libc++
nuclear@91 38 endif
nuclear@91 39
nuclear@19 40 $(bin): $(obj) $(libgoat)
nuclear@73 41 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@73 42
nuclear@73 43 # rule for running moc on ui header files
nuclear@73 44 moc_%.cc: %.h
nuclear@73 45 $(MOC) -o $@ $<
nuclear@19 46
nuclear@19 47 -include $(dep)
nuclear@19 48
nuclear@80 49 %.d: %.c
nuclear@80 50 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@80 51
nuclear@73 52 %.d: %.cc
nuclear@73 53 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@19 54
nuclear@19 55 .PHONY: clean
nuclear@19 56 clean:
nuclear@19 57 rm -f $(obj) $(bin)
nuclear@19 58
nuclear@19 59 .PHONY: cleandep
nuclear@19 60 cleandep:
nuclear@19 61 rm -f $(dep)
nuclear@46 62
nuclear@46 63 .PHONY: install
nuclear@46 64 install: $(bin)
nuclear@46 65 cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
nuclear@46 66
nuclear@46 67 .PHONY: uninstall
nuclear@46 68 uninstall:
nuclear@46 69 rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)