sgl

annotate 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
rev   line source
nuclear@5 1 name = $(shell pwd | sed 's/.*\///')
nuclear@5 2 bin = $(name)
nuclear@5 3 src = $(wildcard *.c)
nuclear@5 4 obj = $(src:.c=.o)
nuclear@5 5
nuclear@12 6 ifeq ($(shell uname -s), Darwin)
nuclear@12 7 libsgl = libsgl.dylib
nuclear@12 8 libgl = -framework OpenGL
nuclear@12 9 else
nuclear@12 10 libsgl = libsgl.so
nuclear@12 11 libgl = -lGL -lGLU
nuclear@12 12 rpath = -Wl,-rpath=.
nuclear@12 13 endif
nuclear@12 14
nuclear@5 15 sgldir = ../..
nuclear@5 16
nuclear@5 17 CC = gcc
nuclear@5 18 CFLAGS = -pedantic -Wall -g -I$(sgldir)/include
nuclear@12 19 LDFLAGS = -L. $(rpath) -lsgl $(libgl) -lm
nuclear@5 20
nuclear@12 21 $(bin): $(obj) $(libsgl)
nuclear@5 22 $(CC) -o $@ $(obj) $(LDFLAGS)
nuclear@5 23
nuclear@12 24 libsgl.dylib: $(sgldir)/libsgl.dylib
nuclear@12 25 ln -s $< $@
nuclear@12 26
nuclear@5 27 libsgl.so: $(sgldir)/libsgl.so.0.0
nuclear@5 28 ln -s $< $@.0
nuclear@5 29 ln -s $< $@
nuclear@5 30
nuclear@5 31 .PHONY: clean
nuclear@5 32 clean:
nuclear@5 33 rm -f $(obj) $(bin)