dsys2

view Makefile @ 9:61cc1a525023

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