DATA_PREFIX := /usr/share/vor
PROGRAM_PREFIX := /usr/games/bin
-debug := $(if $(DEBUG),-DDEBUG=1)
+CFLAGS := -Wall -ggdb
+LDFLAGS :=
+
paths := -DDATA_PREFIX=\"$(DATA_PREFIX)\"
sdl-cflags := $(shell sdl-config --cflags)
sdl-ldflags := $(shell sdl-config --libs)
-ldflags := $(sdl-ldflags) -lSDL_image -lSDL_mixer
-cflags := $(sdl-cflags) $(debug) $(paths) $(CFLAGS)
+ldflags := $(sdl-ldflags) -lSDL_image -lSDL_mixer $(LDFLAGS)
+cflags := $(sdl-cflags) $(paths) $(CFLAGS)
-my_objects := args.o file.o rocks.o score.o shape.o sound.o
-my_objects += $(if $(DEBUG),debug.o) main.o
+my_objects := args.o dust.o file.o mt.o rocks.o score.o sprite.o sound.o
+my_objects += main.o
libs := SFont.o
objects := $(libs) $(my_objects)
$(my_objects): config.h
-main.o file.o: file.h
+SFont.o: SFont.h
+
+args.o: args.h
+
+dust.o: globals.h dust.h mt.h
+
+file.o: file.h common.h
+
+main.o: args.h common.h dust.h file.h globals.h mt.h rocks.h score.h sprite.h sound.h
+
+mt.o: mt.h
+
+rocks.o: rocks.h common.h file.h globals.h mt.h
+
+score.o: score.h common.h file.h
+
+sound.o: sound.h args.h common.h
+
+sprite.o: sprite.h common.h
vor: $(objects)
@echo linking $@ from $^
include gfx.mk
+tags: *.c *.h
+ exuberant-ctags *.c *.h /usr/include/SDL/*
+
clean: program-clean
+ rm -f tags
maintainer-clean: program-clean data-clean
$(INSTALL_DATA) ./data/music/* $(DATA_PREFIX)/music/
$(INSTALL_DATA) ./data/sounds/* $(DATA_PREFIX)/sounds/
$(INSTALL_DATA) ./data/sprites/* $(DATA_PREFIX)/sprites/
- touch $(DATA_PREFIX)/scores
- chmod a+rw $(DATA_PREFIX)/scores
uninstall: uninstall-program uninstall-data rminstalldirs
rm -f $(DATA_PREFIX)/music/*
rm -f $(DATA_PREFIX)/sounds/*
rm -f $(DATA_PREFIX)/sprites/*
- rm -f $(DATA_PREFIX)/scores $(DATA_PREFIX)/.highscore
+ rm -f $(DATA_PREFIX)/scores