ccdemos/Makefile
branchpyrit
changeset 20 f22952603f29
parent 16 20bceb605f48
child 22 76b7bd51d64a
--- a/ccdemos/Makefile	Mon Nov 26 23:12:40 2007 +0100
+++ b/ccdemos/Makefile	Thu Nov 29 18:30:16 2007 +0100
@@ -1,8 +1,11 @@
-CCFLAGS=-g -O0 -I../src
-LDFLAGS=-L.. -lpng `python-config --libs`
-objs=image.o ../*.o
+CCFLAGS=-g -O3 -I../src
+LDFLAGS=-L.. -pthread
+RGBLIB_LDFLAGS=$(LDFLAGS) -lpng
+SDL_CCFLAGS=$(CCFLAGS) $(shell sdl-config --cflags)
+SDL_LDFLAGS=$(LDFLAGS) $(shell sdl-config --libs)
+PYRIT_OBJS=$(shell ls ../*.o | grep -v raytracermodule)
 
-all: image.o spheres_shadow
+all: spheres_shadow realtime
 
 %.o: %.c
 	$(CXX) -c -o $@ $*.c
@@ -12,11 +15,14 @@
 
 %: %.o
 	(cd .. && make)
-	$(CXX) -o $@ $(objs) $*.o $(LDFLAGS)
+	$(CXX) -o $@ $(PYRIT_OBJS) $^ $(RGBLIB_LDFLAGS)
 
 image.o: image.c
 spheres_shadow.o: spheres_shadow.cc
-spheres_shadow: spheres_shadow.o
+spheres_shadow: spheres_shadow.o image.o
+
+realtime: realtime.cc
+	$(CXX) -o $@ $@.cc $(SDL_CCFLAGS) -L.. $(PYRIT_OBJS) $(SDL_LDFLAGS)
 
 clean:
-	rm -f spheres_shadow *.o
+	rm -f spheres_shadow realtime *.o