libpsys

view examples/simple/Makefile @ 11:23d4c50616ff

C++ header file compatibility
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 29 Aug 2012 05:10:46 +0300
parents 874a942853ad
children
line source
1 src = $(wildcard *.c)
2 obj = $(src:.c=.o)
3 dep = $(obj:.o=.d)
4 bin = simple
6 incdir = ../../src
7 libdir = ../..
8 liba = $(libdir)/libpsys.a
10 CC = gcc
11 CFLAGS = -pedantic -Wall -g -I$(incdir) `pkg-config --cflags vmath`
12 LDFLAGS = -L$(libdir) $(liba) $(libgl) -lanim -limago `pkg-config --libs vmath` -lm
14 ifeq ($(shell uname -s), Darwin)
15 libgl = -framework OpenGL -framework GLUT
16 else
17 libgl = -lGL -lGLU -lglut
18 endif
20 $(bin): $(obj) $(liba)
21 $(CC) -o $@ $(obj) $(LDFLAGS)
23 -include $(dep)
25 %.d: %.c
26 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.o=.d) >$@
28 .PHONY: clean
29 clean:
30 rm -f $(obj) $(bin)