From 7768b4cc6d938048f277df5591d81853fee2aaf6 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 27 Aug 2011 21:29:08 +0200 Subject: [PATCH] Add Makefile option to select whether or not to use a .pak file. --- code/defs.h | 1 - makefile | 19 +++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/code/defs.h b/code/defs.h index c43a661..ab36885 100644 --- a/code/defs.h +++ b/code/defs.h @@ -286,7 +286,6 @@ enum { #define SHIP_HIT_INDEX 60 -#define USEPACK 1 #ifndef PACKLOCATION #define PACKLOCATION "starfighter.pak" #endif diff --git a/makefile b/makefile index 9579bec..a0adac5 100755 --- a/makefile +++ b/makefile @@ -8,15 +8,22 @@ PACK = starfighter.pak DOCS = docs/* DATA = data/* gfx/* music/* sound/* +USEPACK ?= 1 + BINDIR = /usr/games/ DATADIR = /usr/share/games/parallelrealities/ DOCDIR = /usr/share/doc/starfighter/ # top-level rule to create the program. -all: $(PROG) +ALL = $(PROG) +ifeq ($(USEPACK), 1) + ALL += $(PACK) +endif + +all: $(ALL) # compiling other source files. %.o: code/%.cpp code/*.h - $(CXX) $(CFLAGS) -c -O3 -DVERSION=\"$(VERSION)\" -DPACKLOCATION=\"$(DATADIR)$(PACK)\" $< + $(CXX) $(CFLAGS) -c -DVERSION=\"$(VERSION)\" -DPACKLOCATION=\"$(DATADIR)$(PACK)\" -DUSEPACK=$(USEPACK) $< # linking the program. $(PROG): $(OBJS) @@ -24,17 +31,21 @@ $(PROG): $(OBJS) # cleaning everything that can be automatically recreated with "make". clean: - $(RM) $(OBJS) + $(RM) $(OBJS) $(ALL) distclean: $(RM) $(PROG) # install -install: +install: $(ALL) mkdir -p $(DATADIR) strip $(PROG) install -o root -g games -m 755 $(PROG) $(BINDIR)$(PROG) +ifeq ($(USEPACK), 1) + install -o root -g games -m 644 $(DATA) $(DATADIR) +else install -o root -g games -m 644 $(PACK) $(DATADIR)$(PACK) +endif cp $(DOCS) $(DOCDIR) $(PACK): pack.py $(DATA)