dsys2

view Makefile @ 6:80f86f0f67ec

I think I've done most of it...
author John Tsiombikas <nuclear@siggraph.org>
date Fri, 02 Sep 2011 04:49:18 +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)