libpsys
annotate examples/simple/Makefile @ 1:874a942853ad
foobar
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Sat, 24 Sep 2011 20:44:42 +0300 |
parents | |
children | 6e5342a2529a |
rev | line source |
---|---|
nuclear@1 | 1 src = $(wildcard *.c) |
nuclear@1 | 2 obj = $(src:.c=.o) |
nuclear@1 | 3 dep = $(obj:.o=.d) |
nuclear@1 | 4 bin = simple |
nuclear@1 | 5 |
nuclear@1 | 6 incdir = ../../src |
nuclear@1 | 7 libdir = ../.. |
nuclear@1 | 8 liba = $(libdir)/libpsys.a |
nuclear@1 | 9 |
nuclear@1 | 10 CC = gcc |
nuclear@1 | 11 CFLAGS = -pedantic -Wall -g -I$(incdir) `pkg-config --cflags vmath` |
nuclear@1 | 12 LDFLAGS = -L$(libdir) $(liba) $(libgl) -lanim `pkg-config --libs vmath` -lm |
nuclear@1 | 13 |
nuclear@1 | 14 ifeq ($(shell uname -s), Darwin) |
nuclear@1 | 15 libgl = -framework OpenGL -framework GLUT |
nuclear@1 | 16 else |
nuclear@1 | 17 libgl = -lGL -lGLU -lglut |
nuclear@1 | 18 endif |
nuclear@1 | 19 |
nuclear@1 | 20 $(bin): $(obj) $(liba) |
nuclear@1 | 21 $(CC) -o $@ $(obj) $(LDFLAGS) |
nuclear@1 | 22 |
nuclear@1 | 23 -include $(dep) |
nuclear@1 | 24 |
nuclear@1 | 25 %.d: %.c |
nuclear@1 | 26 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.o=.d) >$@ |
nuclear@1 | 27 |
nuclear@1 | 28 .PHONY: clean |
nuclear@1 | 29 clean: |
nuclear@1 | 30 rm -f $(obj) $(bin) |