goat3d

annotate goatview/Makefile @ 44:f8bfc3177582

fixed the goatview makefile
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 08 Dec 2013 02:14:46 +0200
parents b59a3650ed51
children 9d911100935b
rev   line source
nuclear@19 1 src = $(wildcard src/*.c)
nuclear@19 2 obj = $(src:.c=.o)
nuclear@19 3 dep = $(obj:.o=.d)
nuclear@19 4 bin = goatview
nuclear@19 5
nuclear@19 6 goat_root = ..
nuclear@19 7
nuclear@19 8 CC = clang
nuclear@19 9 CPP = clang -E
nuclear@19 10 CFLAGS = -pedantic -Wall -g -I$(goat_root)/src
nuclear@23 11 LDFLAGS = $(libgoat) $(libgl)
nuclear@19 12
nuclear@19 13 ifeq ($(shell uname -s), Darwin)
nuclear@19 14 libgl = -framework OpenGL -framework GLUT -lGLEW
nuclear@23 15 libgoat = $(goat_root)/libgoat3d.dylib
nuclear@19 16 else
nuclear@19 17 libgl = -lGL -lGLU -lglut -lGLEW
nuclear@44 18 libgoat = $(goat_root)/libgoat3d.so.0.1
nuclear@19 19 endif
nuclear@19 20
nuclear@19 21 $(bin): $(obj) $(libgoat)
nuclear@19 22 $(CC) -o $@ $(obj) $(LDFLAGS)
nuclear@19 23
nuclear@19 24 -include $(dep)
nuclear@19 25
nuclear@19 26 %.d: %.c
nuclear@19 27 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@19 28
nuclear@19 29 .PHONY: clean
nuclear@19 30 clean:
nuclear@19 31 rm -f $(obj) $(bin)
nuclear@19 32
nuclear@19 33 .PHONY: cleandep
nuclear@19 34 cleandep:
nuclear@19 35 rm -f $(dep)