--- a/ccdemos/Makefile Fri Dec 14 10:34:31 2007 +0100
+++ b/ccdemos/Makefile Fri Dec 14 16:51:22 2007 +0100
@@ -5,20 +5,25 @@
include $(ROOT)/config.mk
+### Rules ###
+%.o: %.cc
+ $(CXX) -c -o $@ $(CCFLAGS) $(SDL_CCFLAGS) $< $(DEFS) -DPYRIT_DOUBLE
+
+%: %.o
+ $(CXX) -o $@ $(ROOT)/bin/libs-double/*.o $< image.o $(LDFLAGS) $(SDL_LDFLAGS) -lpng
+
### Targets ###
all: realtime realtime_dragon realtime_bunny spheres_shadow
-realtime: realtime.o libs-double
- $(CXX) -o $@ $(ROOT)/bin/libs-double/*.o $< $(LDFLAGS) $(SDL_LDFLAGS)
-
-realtime_dragon: realtime_dragon.o libs-double
- $(CXX) -o $@ $(ROOT)/bin/libs-double/*.o $< $(LDFLAGS) $(SDL_LDFLAGS)
+realtime: realtime.o libs-double image.o
+realtime_dragon: realtime_dragon.o libs-double image.o
+realtime_bunny: realtime_bunny.o libs-double image.o
+spheres_shadow: spheres_shadow.o libs-double image.o
-realtime_bunny: realtime_bunny.o libs-double
- $(CXX) -o $@ $(ROOT)/bin/libs-double/*.o $< $(LDFLAGS) $(SDL_LDFLAGS)
-
-spheres_shadow: spheres_shadow.o image.o libs-float
- $(CXX) -o $@ $(ROOT)/bin/libs-float/*.o $< image.o $(LDFLAGS) -lpng
+realtime.o: realtime.cc
+realtime_dragon.o: realtime_dragon.cc common_sdl.h common_ply.h
+realtime_bunny.o: realtime_bunny.cc common_sdl.h common_ply.h
+spheres_shadow.o: spheres_shadow.cc
libs-float:
$(MAKE) -C ../src libs-float
@@ -26,20 +31,8 @@
libs-double:
$(MAKE) -C ../src libs-double
-realtime.o: realtime.cc
- $(CXX) -c -o $@ $(CCFLAGS) $(SDL_CCFLAGS) $< $(DEFS) -DPYRIT_DOUBLE
-
-realtime_dragon.o: realtime_dragon.cc
- $(CXX) -c -o $@ $(CCFLAGS) $(SDL_CCFLAGS) $< $(DEFS) -DPYRIT_DOUBLE
-
-realtime_bunny.o: realtime_bunny.cc
- $(CXX) -c -o $@ $(CCFLAGS) $(SDL_CCFLAGS) $< $(DEFS) -DPYRIT_DOUBLE
-
image.o: image.c
$(CXX) -c -o $@ $*.c
-spheres_shadow.o: spheres_shadow.cc
- $(CXX) -c -o $@ $*.cc $(CCFLAGS) $(DEFS)
-
clean:
rm -f spheres_shadow realtime realtime_dragon realtime_bunny *.o