view3d

annotate Makefile.in @ 8:5562a637e5aa

load multiple files and concatenate them
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 23 Jan 2012 08:51:59 +0200
parents
children
rev   line source
nuclear@0 1 src = $(wildcard src/*.c)
nuclear@0 2 obj = $(src:.c=.o)
nuclear@0 3 dep = $(obj:.o=.d)
nuclear@0 4 bin = view3d
nuclear@0 5
nuclear@0 6 CFLAGS = -pedantic -Wall -g $(incdir)
nuclear@0 7 LDFLAGS = $(libdir) $(libgl) -lassimp -lm -limago
nuclear@0 8
nuclear@0 9 ifeq ($(shell uname -s), Darwin)
nuclear@0 10 libgl = -framework OpenGL -framework GLUT -lGLEW
nuclear@0 11 incdir = -I/opt/local/include
nuclear@0 12 libdir = -L/opt/local/lib
nuclear@0 13 else
nuclear@0 14 libgl = -lGL -lGLU -lglut -lGLEW
nuclear@0 15 endif
nuclear@0 16
nuclear@0 17 $(bin): $(obj)
nuclear@0 18 $(CC) -o $@ $(obj) $(LDFLAGS)
nuclear@0 19
nuclear@0 20 -include $(dep)
nuclear@0 21
nuclear@0 22 %.d: %.c
nuclear@0 23 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 24
nuclear@0 25 .PHONY: clean
nuclear@0 26 clean:
nuclear@0 27 rm -f $(obj) $(bin)
nuclear@0 28
nuclear@0 29 .PHONY: install
nuclear@0 30 install: $(bin)
nuclear@0 31 mkdir -p $(INSTDIR)$(PREFIX)/bin
nuclear@0 32 cp $(bin) $(INSTDIR)$(PREFIX)/bin/$(bin)
nuclear@0 33
nuclear@0 34 .PHONY: uninstall
nuclear@0 35 uninstall:
nuclear@0 36 rm -f $(INSTDIR)$(PREFIX)/bin/$(bin)