nuclear@46: PREFIX = /usr/local nuclear@46: nuclear@73: src = $(wildcard src/*.cc) nuclear@73: mochdr = src/goatview.h nuclear@73: mocsrc = $(patsubst src/%.h,src/moc_%.cc,$(mochdr)) nuclear@73: obj = $(sort $(src:.cc=.o) $(mocsrc:.cc=.o)) nuclear@19: dep = $(obj:.o=.d) nuclear@19: bin = goatview nuclear@19: nuclear@19: goat_root = .. nuclear@19: nuclear@73: CXXFLAGS = -std=c++11 -pedantic -Wall -g $(pic) -I$(goat_root)/src $(qtinc) nuclear@73: LDFLAGS = $(libgoat) $(libgl) $(qtlib) nuclear@73: MOC = moc nuclear@73: nuclear@73: qtinc = `pkg-config --cflags Qt5Gui Qt5Core Qt5OpenGL` nuclear@73: qtlib = `pkg-config --libs Qt5Gui Qt5Core Qt5OpenGL` nuclear@19: nuclear@19: ifeq ($(shell uname -s), Darwin) nuclear@19: libgl = -framework OpenGL -framework GLUT -lGLEW nuclear@23: libgoat = $(goat_root)/libgoat3d.dylib nuclear@19: else nuclear@73: pic = -fPIC nuclear@19: libgl = -lGL -lGLU -lglut -lGLEW nuclear@44: libgoat = $(goat_root)/libgoat3d.so.0.1 nuclear@19: endif nuclear@19: nuclear@19: $(bin): $(obj) $(libgoat) nuclear@73: $(CXX) -o $@ $(obj) $(LDFLAGS) nuclear@73: nuclear@73: # rule for running moc on ui header files nuclear@73: moc_%.cc: %.h nuclear@73: $(MOC) -o $@ $< nuclear@19: nuclear@19: -include $(dep) nuclear@19: nuclear@73: %.d: %.cc nuclear@73: @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@19: nuclear@19: .PHONY: clean nuclear@19: clean: nuclear@19: rm -f $(obj) $(bin) nuclear@19: nuclear@19: .PHONY: cleandep nuclear@19: cleandep: nuclear@19: rm -f $(dep) nuclear@46: nuclear@46: .PHONY: install nuclear@46: install: $(bin) nuclear@46: cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin) nuclear@46: nuclear@46: .PHONY: uninstall nuclear@46: uninstall: nuclear@46: rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)