dsys2

view Makefile @ 10:5ba9dd6742a0

fixed a crash
author John Tsiombikas <nuclear@siggraph.org>
date Sun, 04 Sep 2011 06:44:49 +0300
parents 94ce16dd20c0
children 65da828bc218
line source
1 PREFIX = /usr/local
3 src = $(wildcard src/*.c)
4 obj = $(src:.c=.o)
5 dep = $(obj:.o=.d)
7 lib_a = libdsys2.a
9 CC = gcc
10 AR = ar
11 CFLAGS = -pedantic -Wall -g -Isrc
13 ifeq ($(shell uname -s), Darwin)
14 libgl = -framework OpenGL -framework GLUT
15 else
16 libgl = -lGL -lGLU -lglut
17 endif
19 test: test.o $(lib_a)
20 $(CC) $(CFLAGS) -o $@ test.o $(lib_a) $(libgl) -lm
22 $(lib_a): $(obj)
23 $(AR) rcs $@ $(obj)
25 -include $(dep)
27 %.d: %.c
28 @$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@
30 .PHONY: clean
31 clean:
32 rm -f $(obj) $(bin)
34 .PHONY: cleandep
35 cleandep:
36 rm -f $(dep)
38 .PHONY: install
39 install:
40 mkdir -p $(PREFIX)/include $(PREFIX)/lib
41 cp $(lib_a) $(PREFIX)/lib/$(lib_a)
42 cp src/dsys2.h $(PREFIX)/include/dsys2.h
44 .PHONY: uninstall
45 uninstall:
46 rm -f $(PREFIX)/include/dsys2.h $(PREFIX)/lib/$(lib_a)