nuclear@46: PREFIX = /usr/local nuclear@46: nuclear@73: src = $(wildcard src/*.cc) nuclear@80: csrc = $(wildcard src/*.c) nuclear@85: mochdr = src/goatview.h src/scenemodel.h nuclear@73: mocsrc = $(patsubst src/%.h,src/moc_%.cc,$(mochdr)) nuclear@80: obj = $(sort $(csrc:.c=.o) $(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@91: warn = -Wall nuclear@91: nuclear@91: CFLAGS = $(warn) -g $(pic) -I$(goat_root)/src $(qtinc) nuclear@80: CXXFLAGS = -std=c++11 $(CFLAGS) nuclear@78: LDFLAGS = $(libgoat) $(libgl) $(qtlib) -lvmath 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@91: warn += -Wno-deprecated-declarations 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@91: ifeq ($(CC), gcc) nuclear@91: warn += -Wno-cpp nuclear@91: endif nuclear@91: ifneq ($(shell $(CC) --version | grep LLVM),) nuclear@91: CXXFLAGS += -stdlib=libc++ nuclear@91: endif nuclear@91: 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@80: %.d: %.c nuclear@80: @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@80: 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)