sgl

annotate tests/tests-makefile @ 22:b5c852d7661e

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 26 Jun 2011 23:57:53 +0300
parents ee7b3a898b6b
children 505915b0f3da
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)
nuclear@17 34
nuclear@17 35 .PHONY: install
nuclear@17 36 install:
nuclear@22 37 mkdir -p Test.app/Contents/MacOS Test.app/Contents/Frameworks
nuclear@22 38 cd Test.app/Contents; ln -s ../../../tests-macinfo.plist Info.plist
nuclear@22 39 cp $(bin) Test.app/Contents/MacOS/test
nuclear@22 40 cd Test.app/Contents/Frameworks; ln -s ../../../../../libsgl.dylib .
nuclear@22 41 install_name_tool -change libsgl.dylib @executable_path/../Frameworks/libsgl.dylib Test.app/Contents/MacOS/test