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