sgl

view tests/tests-makefile @ 12:bf34fa677960

- fixed mac issues.
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 14 May 2011 12:02:22 +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)