sgl
annotate tests/tests-makefile @ 39:e1a27aa24956
fixed broken build
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Wed, 27 Jun 2012 05:54:57 +0300 |
parents | b5c852d7661e |
children |
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@23 | 35 .PHONY: app |
nuclear@23 | 36 app: $(bin) |
nuclear@22 | 37 mkdir -p Test.app/Contents/MacOS Test.app/Contents/Frameworks |
nuclear@23 | 38 cd Test.app/Contents; rm -f Info.plist; ln -s ../../../tests-macinfo.plist Info.plist |
nuclear@22 | 39 cp $(bin) Test.app/Contents/MacOS/test |
nuclear@23 | 40 cd Test.app/Contents/Frameworks; rm -f libsgl.dylib; ln -s ../../../../../libsgl.dylib . |
nuclear@22 | 41 install_name_tool -change libsgl.dylib @executable_path/../Frameworks/libsgl.dylib Test.app/Contents/MacOS/test |