sgl
view tests/tests-makefile @ 13:e989ab58ec5b
trying to figure out how cocoa works
author | John Tsiombikas <nuclear@siggraph.org> |
---|---|
date | Mon, 16 May 2011 23:05:57 +0300 |
parents | 0570e27e5ebc |
children | ee7b3a898b6b |
line source
1 name = $(shell pwd | sed 's/.*\///')
2 bin = $(name)
3 src = $(wildcard *.c)
4 obj = $(src:.c=.o)
6 ifeq ($(shell uname -s), Darwin)
7 libsgl = libsgl.dylib
8 libgl = -framework OpenGL
9 else
10 libsgl = libsgl.so
11 libgl = -lGL -lGLU
12 rpath = -Wl,-rpath=.
13 endif
15 sgldir = ../..
17 CC = gcc
18 CFLAGS = -pedantic -Wall -g -I$(sgldir)/include
19 LDFLAGS = -L. $(rpath) -lsgl $(libgl) -lm
21 $(bin): $(obj) $(libsgl)
22 $(CC) -o $@ $(obj) $(LDFLAGS)
24 libsgl.dylib: $(sgldir)/libsgl.dylib
25 ln -s $< $@
27 libsgl.so: $(sgldir)/libsgl.so.0.0
28 ln -s $< $@.0
29 ln -s $< $@
31 .PHONY: clean
32 clean:
33 rm -f $(obj) $(bin)