sgl

view tests/tests-makefile @ 20:0697fbd075b6

added fallback SDL module
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 26 Jun 2011 07:56:13 +0300
parents bf34fa677960
children b5c852d7661e
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)
35 .PHONY: install
36 install:
37 mkdir -p Simple.app/Contents/MacOS
38 cp simple Simple.app/Contents/MacOS/simple
39 install_name_tool -change libsgl.dylib @executable_path/../Frameworks/libsgl.dylib Simple.app/Contents/MacOS/simple