imtk
view Makefile @ 20:c7a7ddbe7714
half-arsed automatic layout
author | John Tsiombikas <nuclear@siggraph.org> |
---|---|
date | Sat, 30 Apr 2011 05:23:59 +0300 |
parents | 737e9047d9c9 |
children | bb358d8c4903 |
line source
1 src = $(wildcard src/*.c)
2 obj = $(src:.c=.o)
3 depfiles = $(obj:.o=.d)
4 lib_a = libimtk.a
5 bin = test
7 PREFIX = /usr/local
9 CC = gcc
10 AR = ar
11 CFLAGS = -pedantic -Wall -g -Isrc
12 LDFLAGS = $(libgl) -lm
14 ifeq ($(shell uname -s), Darwin)
15 libgl = -framework OpenGL -framework GLUT
16 else
17 libgl = -lGL -lGLU -lglut
18 endif
20 $(bin): $(lib_a) test.o
21 $(CC) -o $@ test.o $(lib_a) $(LDFLAGS)
23 $(lib_a): $(obj)
24 $(AR) rcs $@ $(obj)
26 -include $(depfiles)
28 %.d: %.c
29 @$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@
31 .PHONY: clean
32 clean:
33 rm -f $(obj) $(bin) $(lib_a) test.o
35 .PHONY: cleandep
36 cleandep:
37 rm -f $(depfiles)
39 .PHONY: install
40 install: $(lib_a)
41 mkdir -p $(PREFIX)/include $(PREFIX)/lib
42 cp $(lib_a) $(PREFIX)/lib/$(lib_a)
43 cp src/imtk.h $(PREFIX)/include/imtk.h
45 .PHONY: uninstall
46 uninstall:
47 rm -f $(PREFIX)/lib/$(lib_a)
48 rm -f $(PREFIX)/include/imtk.h