glviewvol
annotate Makefile @ 15:2a67ea257ac0
makefile fixes for macosx
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 06 Feb 2015 23:47:28 +0200 |
parents | 73edd1b7c2da |
children |
rev | line source |
---|---|
nuclear@0 | 1 csrc = $(wildcard src/*.c) |
nuclear@0 | 2 ccsrc = $(wildcard src/*.cc) |
nuclear@0 | 3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) |
nuclear@0 | 4 dep = $(obj:.o=.d) |
nuclear@0 | 5 |
nuclear@11 | 6 bin = glviewvol |
nuclear@0 | 7 |
nuclear@8 | 8 opt = -O3 -ffast-math |
nuclear@0 | 9 dbg = -g |
nuclear@0 | 10 def = -DUSE_GLUT |
nuclear@0 | 11 #inc = |
nuclear@0 | 12 |
nuclear@9 | 13 CFLAGS = -pedantic -Wall -fopenmp $(opt) $(dbg) $(def) $(inc) |
nuclear@0 | 14 CXXFLAGS = $(CFLAGS) |
nuclear@15 | 15 LDFLAGS = $(libgl) -lm -limago $(libomp) |
nuclear@0 | 16 |
nuclear@0 | 17 ifeq ($(shell uname -s), Darwin) |
nuclear@0 | 18 libgl = -framework OpenGL -framework GLUT -lGLEW |
nuclear@0 | 19 else |
nuclear@0 | 20 libgl = -lGL -lGLU -lglut -lGLEW |
nuclear@15 | 21 libomp = -lgomp |
nuclear@0 | 22 endif |
nuclear@0 | 23 |
nuclear@0 | 24 $(bin): $(obj) |
nuclear@0 | 25 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@0 | 26 |
nuclear@0 | 27 -include $(dep) |
nuclear@0 | 28 |
nuclear@0 | 29 %.d: %.c |
nuclear@0 | 30 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 31 |
nuclear@0 | 32 %.d: %.cc |
nuclear@0 | 33 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 34 |
nuclear@0 | 35 .PHONY: clean |
nuclear@0 | 36 clean: |
nuclear@0 | 37 rm -f $(obj) $(bin) |
nuclear@0 | 38 |
nuclear@0 | 39 .PHONY: cleandep |
nuclear@0 | 40 cleandep: |
nuclear@0 | 41 rm -f $(dep) |
nuclear@0 | 42 |
nuclear@0 | 43 .PHONY: install |
nuclear@0 | 44 install: |
nuclear@0 | 45 mkdir -p $(DESTDIR)$(PREFIX)/bin |
nuclear@0 | 46 cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin) |
nuclear@0 | 47 |
nuclear@0 | 48 .PHONY: uninstall |
nuclear@0 | 49 rm -f $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin) |