From 277370f9e43da137b24e36083701cd13e29e93d1 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 14 Feb 2011 16:24:45 +0100 Subject: [PATCH] Conditional building and installing of pak files. --- makefile | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/makefile b/makefile index 50e77e3..8985478 100755 --- a/makefile +++ b/makefile @@ -2,6 +2,7 @@ PROG = blobwars PAKNAME = blobwars.pak DOCS = doc/* ICONS = icons/ +DATA = data gfx sound music VERSION = 1.18 RELEASE = 1 @@ -67,8 +68,13 @@ PAKOBJS = CFileData.o pak.o LOCALE_MO = $(patsubst %.po,%.mo,$(wildcard locale/*.po)) +ALL = $(PROG) $(LOCALE_MO) +ifeq ($(USEPAK), 1) + ALL += $(PAKNAME) +endif + # top-level rule to create the program. -all: $(PROG) pak $(LOCALE_MO) +all: $(ALL) # compiling other source files. %.o: src/%.cpp src/%.h src/defs.h src/defines.h src/headers.h @@ -91,14 +97,13 @@ mapeditor: $(MAPOBJS) clean: $(RM) $(GAMEOBJS) mapEditor.o pak.o $(PROG) $(PAKNAME) pak mapeditor $(LOCALE_MO) -buildpak: pak - ./pak data gfx music sound $(PAKNAME) - -# install -install: +$(PAKNAME): pak + ./pak $(DATA) $(PAKNAME) - ./pak data gfx music sound $(PAKNAME) +buildpak: $(PAKNAME) +# install +install: $(ALL) mkdir -p $(BINDIR) mkdir -p $(DATADIR) mkdir -p $(DOCDIR) @@ -108,7 +113,11 @@ install: mkdir -p $(DESKTOPDIR) install -m 755 $(PROG) $(BINDIR)$(PROG) +ifeq ($(USEPAK), 1) install -m 644 $(PAKNAME) $(DATADIR)$(PAKNAME) +else + cp -r $(DATA) $(DATADIR) +endif cp $(ICONS)$(PROG).png $(ICONDIR)32x32/apps/ cp $(ICONS)$(PROG)-mini.png $(ICONDIR)16x16/apps/$(PROG).png cp $(ICONS)$(PROG)-large.png $(ICONDIR)64x64/apps/$(PROG).png -- 2.39.5