dsys2

annotate Makefile @ 8:4ad7a01c4ff5

ha
author John Tsiombikas <nuclear@siggraph.org>
date Fri, 02 Sep 2011 10:48:24 +0300
parents 1705e550bd91
children 5ba9dd6742a0
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
nuclear@0 5 lib_a = libdsys2.a
nuclear@0 6
nuclear@0 7 CC = gcc
nuclear@0 8 AR = ar
nuclear@2 9 CFLAGS = -pedantic -Wall -g -Isrc
nuclear@2 10
nuclear@5 11 ifeq ($(shell uname -s), Darwin)
nuclear@5 12 libgl = -framework OpenGL -framework GLUT
nuclear@5 13 else
nuclear@5 14 libgl = -lGL -lGLU -lglut
nuclear@5 15 endif
nuclear@5 16
nuclear@2 17 test: test.o $(lib_a)
nuclear@5 18 $(CC) $(CFLAGS) -o $@ test.o $(lib_a) $(libgl) -lm
nuclear@0 19
nuclear@0 20 $(lib_a): $(obj)
nuclear@0 21 $(AR) rcs $@ $(obj)
nuclear@0 22
nuclear@0 23 -include $(dep)
nuclear@0 24
nuclear@0 25 %.d: %.c
nuclear@0 26 @$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@
nuclear@0 27
nuclear@0 28 .PHONY: clean
nuclear@0 29 clean:
nuclear@0 30 rm -f $(obj) $(bin)
nuclear@0 31
nuclear@0 32 .PHONY: cleandep
nuclear@0 33 cleandep:
nuclear@0 34 rm -f $(dep)