sgl

diff 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 diff
     1.1 --- a/tests/tests-makefile	Sat May 14 09:06:46 2011 +0300
     1.2 +++ b/tests/tests-makefile	Sat May 14 12:02:22 2011 +0300
     1.3 @@ -3,15 +3,27 @@
     1.4  src = $(wildcard *.c)
     1.5  obj = $(src:.c=.o)
     1.6  
     1.7 +ifeq ($(shell uname -s), Darwin)
     1.8 +	libsgl = libsgl.dylib
     1.9 +	libgl = -framework OpenGL
    1.10 +else
    1.11 +	libsgl = libsgl.so
    1.12 +	libgl = -lGL -lGLU
    1.13 +	rpath = -Wl,-rpath=.
    1.14 +endif
    1.15 +
    1.16  sgldir = ../..
    1.17  
    1.18  CC = gcc
    1.19  CFLAGS = -pedantic -Wall -g -I$(sgldir)/include
    1.20 -LDFLAGS = -L. -Wl,-rpath=. -lsgl -lGL -lGLU -lm
    1.21 +LDFLAGS = -L. $(rpath) -lsgl $(libgl) -lm
    1.22  
    1.23 -$(bin): $(obj) libsgl.so
    1.24 +$(bin): $(obj) $(libsgl)
    1.25  	$(CC) -o $@ $(obj) $(LDFLAGS)
    1.26  
    1.27 +libsgl.dylib: $(sgldir)/libsgl.dylib
    1.28 +	ln -s $< $@
    1.29 +
    1.30  libsgl.so: $(sgldir)/libsgl.so.0.0
    1.31  	ln -s $< $@.0
    1.32  	ln -s $< $@