glviewvol

annotate Makefile @ 8:fb6d93471352

main thing done
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 30 Dec 2014 20:03:32 +0200
parents 71b479ffb9f7
children 931a6b35f1cd
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@0 6 bin = dicomview
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@0 13 CFLAGS = -pedantic -Wall $(opt) $(dbg) $(def) $(inc)
nuclear@0 14 CXXFLAGS = $(CFLAGS)
nuclear@0 15 LDFLAGS = $(libgl) -lm -limago
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@0 21 endif
nuclear@0 22
nuclear@0 23 $(bin): $(obj)
nuclear@0 24 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@0 25
nuclear@0 26 -include $(dep)
nuclear@0 27
nuclear@0 28 %.d: %.c
nuclear@0 29 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 30
nuclear@0 31 %.d: %.cc
nuclear@0 32 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 33
nuclear@0 34 .PHONY: clean
nuclear@0 35 clean:
nuclear@0 36 rm -f $(obj) $(bin)
nuclear@0 37
nuclear@0 38 .PHONY: cleandep
nuclear@0 39 cleandep:
nuclear@0 40 rm -f $(dep)
nuclear@0 41
nuclear@0 42 .PHONY: install
nuclear@0 43 install:
nuclear@0 44 mkdir -p $(DESTDIR)$(PREFIX)/bin
nuclear@0 45 cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
nuclear@0 46
nuclear@0 47 .PHONY: uninstall
nuclear@0 48 rm -f $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)