sgl

annotate tests/tests-makefile @ 17:ee7b3a898b6b

fooing with cocoa
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 25 Jun 2011 05:17:16 +0300
parents bf34fa677960
children b5c852d7661e
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@17 37 mkdir -p Simple.app/Contents/MacOS
nuclear@17 38 cp simple Simple.app/Contents/MacOS/simple
nuclear@17 39 install_name_tool -change libsgl.dylib @executable_path/../Frameworks/libsgl.dylib Simple.app/Contents/MacOS/simple