JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
split gfx make rules into separate file for finer-grained dependencies.
[vor.git] / Makefile
index 6a9e40d..31c4214 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,10 +19,18 @@ debug := $(if $(DEBUG),1,0)
 ldflags := $(shell sdl-config --libs) -lSDL_image -lSDL_mixer
 cflags := $(shell sdl-config --cflags) -Wall -DDEBUG=$(debug)
 
-my_objects := file.o score.o sound.o main.o $(if $(DEBUG),debug.o)
+my_objects := file.o score.o shape.o sound.o main.o $(if $(DEBUG),debug.o)
 libs := SFont.o
 objects := $(libs) $(my_objects)
 
+rocks := 00 01 02 03 04 05 06 07 08 09
+rocks += 10 11 12 13 14 15 16 17 18 19
+rocks += 20 21 22 23 24 25 26 27 28 29
+rocks += 30 31 32 33 34 35 36 37 38 39
+rocks += 40 41 42 43 44 45 46 47 48 49
+
+graphics := data/sprites/ship.png $(rocks:%=data/sprites/rock%.png)
+
 INSTALL = install
 INSTALL_PROGRAM = $(INSTALL) -o games -g games
 INSTALL_DATA = $(INSTALL) -m 644
@@ -30,7 +38,8 @@ INSTALL_DATA = $(INSTALL) -m 644
 DATA_PREFIX = /usr/share/vor
 PROGRAM_PREFIX = /usr/games/bin
 
-all: vor data/sprites/ship.png
+
+all: vor $(graphics)
 
 %.o: %.c
        $(CC) $(cflags) -c -o $@ $<
@@ -42,12 +51,13 @@ main.o file.o: file.h
 vor: $(objects)
        $(CC) $(ldflags) -o $@ $^ $(LIBRARIES)
 
-data/sprites/ship.png: ship.pov
-       povray -GA -D +A +UA +W32 +H24 ship.pov >/dev/null 2>/dev/null
-       mv ship.png data/sprites/
+pnmoutline: pnmoutline.c
+       $(CC) -lnetpbm -o $@ $<
+
+include gfx.mk
 
 clean:
-       rm -f *.o vor data/sprites/ship.png
+       rm -f *.o vor pnmoutline $(graphics)
 
 install:       all
        if [ ! -d $(DATA_PREFIX) ]; then mkdir $(DATA_PREFIX); fi