Skip to content

Commit

Permalink
More build cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdolan committed Dec 10, 2014
1 parent da322d1 commit a7150d8
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 24 deletions.
10 changes: 10 additions & 0 deletions Makefile
Expand Up @@ -5,6 +5,9 @@
# Check OS type.
PLATFORM=$(shell uname -s|tr A-Z a-z)

# Installation directory
DESTDIR=$(HOME)/.quake2

ifneq ($(PLATFORM),linux)
ifneq ($(PLATFORM),freebsd)
ifneq ($(PLATFORM),darwin)
Expand Down Expand Up @@ -210,6 +213,13 @@ bin/game.so : $(GAME_OBJS)
@echo "[LD] game.so"
@$(CC) $(CFLAGS) -shared -o $@ $(GAME_OBJS)

# The install target
install: targets
install -d "$(DESTDIR)/baseq2"
install bin/quake2 "$(DESTDIR)"
install bin/game.so "$(DESTDIR)/baseq2"
install data/install-data.py "$(DESTDIR)"

# The clean target.
clean:
@rm -rf $(QUAKE2_OBJS) $(GAME_OBJS) bin/*
21 changes: 9 additions & 12 deletions apple/Makefile
@@ -1,6 +1,5 @@
# Makefile for Quake II.app, requires http://macdylibbundler.sourceforge.net/

DATA = ../data
TARGET = target
QUAKE2 = $(TARGET)/Quake\ II.app
BINDIR = $(QUAKE2)/Contents/MacOS
Expand All @@ -11,25 +10,25 @@ REMOTE_USER = $(shell whoami)
HTTP_REPOSITORY = quake2world.net:/var/www/quake2world.net/files
HTTP_TARGET = $(REMOTE_USER)@$(HTTP_REPOSITORY)

all: install-lib
all: install

pre-install:
install -d $(TARGET)
cp -R Quake\ II.app $(QUAKE2)
find $(QUAKE2) -name .turd -delete

install: pre-install
install ../bin/quake2 $(BINDIR)/quake2
install ../bin/game.so $(BINDIR)/baseq2/game.so
install-bin: pre-install
make -C .. DESTDIR=apple/$(BINDIR) install

install-lib: install
install-lib: install-bin
dylibbundler -b \
-x "$(BINDIR)/quake2" \
-d "$(BINDIR)" -of -p @executable_path

install-data:
cp -R $(DATA)/ $(DATADIR)
find $(DATADIR) -name .turd -delete
post-install: install-lib
find $(QUAKE2) -name .turd -delete
mv $(BINDIR)/install-data.py $(DATADIR)

install: pre-install install-bin install-lib post-install

dist:
ln -f -s /Applications $(TARGET)/Applications
Expand All @@ -40,5 +39,3 @@ dist-release:

clean:
rm -rf $(TARGET)/*

.PHONY: all pre-install install install-lib install-data dist dist-release
Empty file.
Binary file removed data/baseq2/pak-quake2-extras.pak
Binary file not shown.
1 change: 1 addition & 0 deletions data/install.py → data/install-data.py
Expand Up @@ -14,6 +14,7 @@ def __getattr__(self, attr):
'root': 'quake2world.net::quake2',
'base': [
'baseq2/pak[1-3].pak',
'baseq2/pak-quake2-extras.pak',
'baseq2/players/*',
'3.20_changes.txt',
'license.txt',
Expand Down
17 changes: 6 additions & 11 deletions linux/Makefile
@@ -1,9 +1,7 @@
# Makefile for Quake2 (Quake2World.net) Linux distributable

DATA = ../data
TARGET = target
QUAKE2 = $(TARGET)/quake2
LIBDIR = $(QUAKE2)/lib
BINDIR = $(QUAKE2)/bin
DATADIR = $(QUAKE2)/share
DIST = $(TARGET)/quake2-quake2world.net-x86_64.tar.gz
Expand All @@ -16,15 +14,14 @@ all: install
pre-install:
install -d $(TARGET)
cp -R quake2 $(QUAKE2)
find $(QUAKE2) -name .turd -delete

install: pre-install
install ../bin/quake2 $(BINDIR)/quake2
install ../bin/game.so $(LIBDIR)/baseq2/game.so
install-bin: pre-install
make -C .. DESTDIR=$(realpath $(BINDIR)) install

post-install: install
find $(QUAKE2) -name .turd -delete

install-data:
cp -R $(DATA)/ $(DATADIR)
find $(DATADIR) -name .turd -delete
install: pre-install install post-install

dist:
tar -czvf $(DIST) -C $(QUAKE2)
Expand All @@ -34,5 +31,3 @@ dist-release:

clean:
rm -rf $(TARGET)/*

.PHONY: all pre-install install install-data dist dist-release
2 changes: 1 addition & 1 deletion src/qcommon/files.c
Expand Up @@ -1891,7 +1891,7 @@ void FS_InitFilesystem (void)
FS_DPrintf("FS_InitFilesystem: Resolved executable path %s\n", path);

if ((c = strstr(path, "quake2/bin"))) {
strcpy(c + strlen("quake2/"), "lib/"BASEDIRNAME);
strcpy(c + strlen("quake2/"), "bin/"BASEDIRNAME);
FS_AddGameDirectory(path);

strcpy(c + strlen("quake2/"), "share/"BASEDIRNAME);
Expand Down

0 comments on commit a7150d8

Please sign in to comment.