glviewvol

view 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
line source
1 csrc = $(wildcard src/*.c)
2 ccsrc = $(wildcard src/*.cc)
3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
4 dep = $(obj:.o=.d)
6 bin = glviewvol
8 opt = -O3 -ffast-math
9 dbg = -g
10 def = -DUSE_GLUT
11 #inc =
13 CFLAGS = -pedantic -Wall -fopenmp $(opt) $(dbg) $(def) $(inc)
14 CXXFLAGS = $(CFLAGS)
15 LDFLAGS = $(libgl) -lm -limago $(libomp)
17 ifeq ($(shell uname -s), Darwin)
18 libgl = -framework OpenGL -framework GLUT -lGLEW
19 else
20 libgl = -lGL -lGLU -lglut -lGLEW
21 libomp = -lgomp
22 endif
24 $(bin): $(obj)
25 $(CXX) -o $@ $(obj) $(LDFLAGS)
27 -include $(dep)
29 %.d: %.c
30 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
32 %.d: %.cc
33 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
35 .PHONY: clean
36 clean:
37 rm -f $(obj) $(bin)
39 .PHONY: cleandep
40 cleandep:
41 rm -f $(dep)
43 .PHONY: install
44 install:
45 mkdir -p $(DESTDIR)$(PREFIX)/bin
46 cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
48 .PHONY: uninstall
49 rm -f $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)