2011-08-24 14:14:44 +02:00
|
|
|
CFLAGS = `sdl-config --cflags` -Wall -DLINUX
|
|
|
|
LIBS = `sdl-config --libs` -lSDL_mixer -lSDL_image
|
|
|
|
OBJS = ai.o aliens.o audio.o bullets.o cargo.o collectable.o comms.o debris.o events.o explosions.o game.o globals.o graphics.o init.o intermission.o loadSave.o messages.o misc.o missions.o player.o resources.o script.o shop.o Starfighter.o title.o unpack.o weapons.o
|
|
|
|
|
|
|
|
VERSION = 1.1
|
|
|
|
PROG = starfighter
|
|
|
|
PACK = starfighter.pak
|
|
|
|
DOCS = docs/*
|
2011-08-26 14:46:44 +02:00
|
|
|
DATA = data/* gfx/* music/* sound/*
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-27 21:29:08 +02:00
|
|
|
USEPACK ?= 1
|
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
BINDIR = /usr/games/
|
|
|
|
DATADIR = /usr/share/games/parallelrealities/
|
|
|
|
DOCDIR = /usr/share/doc/starfighter/
|
|
|
|
# top-level rule to create the program.
|
2011-08-27 21:29:08 +02:00
|
|
|
ALL = $(PROG)
|
|
|
|
ifeq ($(USEPACK), 1)
|
|
|
|
ALL += $(PACK)
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: $(ALL)
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
# compiling other source files.
|
2011-08-26 23:53:46 +02:00
|
|
|
%.o: code/%.cpp code/*.h
|
2011-08-27 21:29:08 +02:00
|
|
|
$(CXX) $(CFLAGS) -c -DVERSION=\"$(VERSION)\" -DPACKLOCATION=\"$(DATADIR)$(PACK)\" -DUSEPACK=$(USEPACK) $<
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
# linking the program.
|
|
|
|
$(PROG): $(OBJS)
|
|
|
|
$(CXX) $(LIBS) $(OBJS) -o $(PROG)
|
|
|
|
|
|
|
|
# cleaning everything that can be automatically recreated with "make".
|
|
|
|
clean:
|
2011-08-27 21:29:08 +02:00
|
|
|
$(RM) $(OBJS) $(ALL)
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
distclean:
|
|
|
|
$(RM) $(PROG)
|
|
|
|
|
|
|
|
# install
|
2011-08-27 21:29:08 +02:00
|
|
|
install: $(ALL)
|
2011-08-24 14:14:44 +02:00
|
|
|
mkdir -p $(DATADIR)
|
|
|
|
strip $(PROG)
|
|
|
|
install -o root -g games -m 755 $(PROG) $(BINDIR)$(PROG)
|
2011-08-27 21:29:08 +02:00
|
|
|
ifeq ($(USEPACK), 1)
|
|
|
|
install -o root -g games -m 644 $(DATA) $(DATADIR)
|
|
|
|
else
|
2011-08-24 14:14:44 +02:00
|
|
|
install -o root -g games -m 644 $(PACK) $(DATADIR)$(PACK)
|
2011-08-27 21:29:08 +02:00
|
|
|
endif
|
2011-08-24 14:14:44 +02:00
|
|
|
cp $(DOCS) $(DOCDIR)
|
2011-08-26 14:46:44 +02:00
|
|
|
|
|
|
|
$(PACK): pack.py $(DATA)
|
|
|
|
./pack.py $(PACK) $(DATA)
|
|
|
|
|
|
|
|
unpack: unpack.py
|
|
|
|
./unpack.py $(PACK)
|
|
|
|
|
|
|
|
.PHONY: all clean distclean unpack
|