summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2014-12-26 18:02:34 +0100
committerSimon Howard2014-12-26 18:02:34 +0100
commitb6ba5eb89afe488f66407562ff57da596e7c841e (patch)
tree478171822131f358da14d61cc062aa994a87dc00
parentba8400b38d8264fe28ec03f772348b288a6ed075 (diff)
parentd66659c6067ec18022718457bcf7c73145cf7b38 (diff)
downloadchocolate-doom-b6ba5eb89afe488f66407562ff57da596e7c841e.tar.gz
chocolate-doom-b6ba5eb89afe488f66407562ff57da596e7c841e.tar.bz2
chocolate-doom-b6ba5eb89afe488f66407562ff57da596e7c841e.zip
Merge pull request #495 from WinterMute/build-outside-source-dir
Allow building in subdirectory or outside source directory This one allows you to configure && make from a subdirectory or a directory outside the source tree. Useful for building several versions in the same tree for comparison.
-rw-r--r--data/Makefile.am4
-rw-r--r--man/Makefile.am98
-rw-r--r--opl/examples/Makefile.am2
-rw-r--r--src/Makefile.am6
-rw-r--r--src/doom/Makefile.am2
-rw-r--r--src/heretic/Makefile.am8
-rw-r--r--src/hexen/Makefile.am6
-rw-r--r--src/resource.rc.in4
-rw-r--r--src/setup-res.rc.in4
-rw-r--r--src/setup/Makefile.am2
-rw-r--r--src/strife/Makefile.am2
-rw-r--r--textscreen/Makefile.am2
-rw-r--r--textscreen/examples/Makefile.am2
13 files changed, 72 insertions, 70 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index 894beb75..293e619e 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -14,9 +14,9 @@ icons_DATA = @PROGRAM_PREFIX@doom.png \
@PROGRAM_PREFIX@setup.png
@PROGRAM_PREFIX@doom.png : doom.png
- cp doom.png $@
+ cp $(top_srcdir)/data/doom.png $@
@PROGRAM_PREFIX@setup.png : setup.png
- cp setup.png $@
+ cp $(top_srcdir)/data/setup.png $@
CLEANFILES = $(icons_DATA)
diff --git a/man/Makefile.am b/man/Makefile.am
index 68daf199..96f4693d 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -47,85 +47,87 @@ strifedocs_DATA = INSTALL.strife CMDLINE.strife
CLEANFILES = $(GENERATED_MAN_PAGES) $(SETUP_MAN_PAGES) \
$(doomdocs_DATA) $(hereticdocs_DATA) \
$(hexendocs_DATA) $(strifedocs_DATA)
+MANDIR = $(top_srcdir)/man
+DOCGEN = $(MANDIR)/docgen
$(SETUP_MAN_PAGES): chocolate-setup.6
cp $< $@
@PROGRAM_PREFIX@doom.6: ../src $(MANPAGE_GEN_FILES)
- ./docgen -g doom -m doom.template ../src ../src/doom > $@
+ $(DOCGEN) -g doom -m doom.template $(top_srcdir)/src $(top_srcdir)/src/doom > $@
-default.cfg.5: ../src default.cfg.template
- ./docgen -g doom -m default.cfg.template \
- -c default ../src/m_config.c > $@
+default.cfg.5: $(top_srcdir)/src $(MANDIR)/default.cfg.template
+ $(DOCGEN) -g doom -m $(MANDIR)/default.cfg.template \
+ -c default $(top_srcdir)/src/m_config.c > $@
@PROGRAM_PREFIX@doom.cfg.5: ../src extra.cfg.template
- ./docgen -g doom -m extra.cfg.template \
- -c extended ../src/m_config.c > $@
+ $(DOCGEN) -g doom -m extra.cfg.template \
+ -c extended $(top_srcdir)/src/m_config.c > $@
-CMDLINE.doom : CMDLINE.template ../src ../src/doom
- ./docgen -p CMDLINE.template ../src/ ../src/doom/ > $@
+CMDLINE.doom : $(MANDIR)/CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/doom
+ $(DOCGEN) -p $(MANDIR)/CMDLINE.template $(top_srcdir)/src/ $(top_srcdir)/src/doom/ > $@
-INSTALL.doom: INSTALL.template
- ./simplecpp -DDOOM -DPRECOMPILED < INSTALL.template > $@
+INSTALL.doom: $(MANDIR)/INSTALL.template
+ $(MANDIR)/simplecpp -DDOOM -DPRECOMPILED < $(MANDIR)/INSTALL.template > $@
-@PROGRAM_PREFIX@heretic.6: ../src $(MANPAGE_GEN_FILES)
- ./docgen -g heretic -m heretic.template ../src ../src/heretic > $@
+@PROGRAM_PREFIX@heretic.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
+ $(DOCGEN) -g heretic -m $(top_srcdir)/man/heretic.template $(top_srcdir)/src $(top_srcdir)/src/heretic > $@
-heretic.cfg.5: ../src default.cfg.template
- ./docgen -g heretic -m default.cfg.template \
- -c default ../src/m_config.c > $@
+heretic.cfg.5: $(top_srcdir)/src $(MANDIR)/default.cfg.template
+ $(DOCGEN) -g heretic -m $(MANDIR)/default.cfg.template \
+ -c default $(top_srcdir)/src/m_config.c > $@
-@PROGRAM_PREFIX@heretic.cfg.5: ../src extra.cfg.template
- ./docgen -g heretic -m extra.cfg.template \
- -c extended ../src/m_config.c > $@
+@PROGRAM_PREFIX@heretic.cfg.5: $(top_srcdir)/src $(MANDIR)/extra.cfg.template
+ $(DOCGEN) -g heretic -m $(MANDIR)/extra.cfg.template \
+ -c extended $(top_srcdir)/src/m_config.c > $@
-CMDLINE.heretic : CMDLINE.template ../src ../src/heretic
- ./docgen -p CMDLINE.template ../src/ ../src/heretic/ > $@
+CMDLINE.heretic : $(MANDIR)/CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/heretic
+ $(DOCGEN) -p $(MANDIR)/CMDLINE.template $(top_srcdir)/src/ $(top_srcdir)/src/heretic/ > $@
-INSTALL.heretic: INSTALL.template
- ./simplecpp -DHERETIC -DPRECOMPILED < INSTALL.template > $@
+INSTALL.heretic: $(MANDIR)/INSTALL.template
+ $(MANDIR)/simplecpp -DHERETIC -DPRECOMPILED < $(MANDIR)/INSTALL.template > $@
-@PROGRAM_PREFIX@hexen.6: ../src $(MANPAGE_GEN_FILES)
- ./docgen -g hexen -m hexen.template ../src ../src/hexen > $@
+@PROGRAM_PREFIX@hexen.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
+ $(DOCGEN) -g hexen -m $(MANDIR)/hexen.template $(top_srcdir)/src $(top_srcdir)/src/hexen > $@
-hexen.cfg.5: ../src default.cfg.template
- ./docgen -g hexen -m default.cfg.template \
- -c default ../src/m_config.c > $@
+hexen.cfg.5: $(top_srcdir)/src $(MANDIR)/default.cfg.template
+ $(DOCGEN) -g hexen -m $(MANDIR)default.cfg.template \
+ -c default $(top_srcdir)/src/m_config.c > $@
-@PROGRAM_PREFIX@hexen.cfg.5: ../src extra.cfg.template
- ./docgen -g hexen -m extra.cfg.template \
- -c extended ../src/m_config.c > $@
+@PROGRAM_PREFIX@hexen.cfg.5: $(top_srcdir)/src $(MANDIR)/extra.cfg.template
+ $(DOCGEN) -g hexen -m $(MANDIR)/extra.cfg.template \
+ -c extended $(top_srcdir)/src/m_config.c > $@
-CMDLINE.hexen : CMDLINE.template ../src ../src/hexen
- ./docgen -p CMDLINE.template ../src/ ../src/hexen/ > $@
+CMDLINE.hexen : $(MANDIR)/CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/hexen
+ $(DOCGEN) -p $(MANDIR)/CMDLINE.template $(top_srcdir)/src/ $(top_srcdir)/src/hexen/ > $@
-INSTALL.hexen: INSTALL.template
- ./simplecpp -DHEXEN -DPRECOMPILED < INSTALL.template > $@
+INSTALL.hexen: $(MANDIR)/INSTALL.template
+ $(MANDIR)/simplecpp -DHEXEN -DPRECOMPILED < $(MANDIR)/INSTALL.template > $@
-@PROGRAM_PREFIX@strife.6: ../src $(MANPAGE_GEN_FILES)
- ./docgen -g strife -m strife.template ../src ../src/strife > $@
+@PROGRAM_PREFIX@strife.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
+ $(DOCGEN) -g strife -m $(MANDIR)/strife.template $(top_srcdir)/src $(top_srcdir)/src/strife > $@
-strife.cfg.5: ../src default.cfg.template
- ./docgen -g strife -m default.cfg.template \
- -c default ../src/m_config.c > $@
+strife.cfg.5: $(top_srcdir)/src $(MANDIR)/default.cfg.template
+ $(DOCGEN) -g strife -m $(MANDIR)/default.cfg.template \
+ -c default $(top_srcdir)/src/m_config.c > $@
-@PROGRAM_PREFIX@strife.cfg.5: ../src extra.cfg.template
- ./docgen -g strife -m extra.cfg.template \
- -c extended ../src/m_config.c > $@
+@PROGRAM_PREFIX@strife.cfg.5: $(top_srcdir)/src $(MANDIR)/extra.cfg.template
+ $(DOCGEN) -g strife -m $(MANDIR)/extra.cfg.template \
+ -c extended $(top_srcdir)/src/m_config.c > $@
-CMDLINE.strife : CMDLINE.template ../src ../src/strife
- ./docgen -p CMDLINE.template ../src/ ../src/strife/ > $@
+CMDLINE.strife : $(MANDIR)/CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/strife
+ $(DOCGEN) -p $(MANDIR)/CMDLINE.template $(top_srcdir)/src/ $(top_srcdir)/src/strife/ > $@
INSTALL.strife: INSTALL.template
- ./simplecpp -DSTRIFE -DPRECOMPILED < INSTALL.template > $@
+ $(MANDIR)/simplecpp -DSTRIFE -DPRECOMPILED < $(MANDIR)/INSTALL.template > $@
-INSTALL: INSTALL.template
- ./simplecpp -DDOOM -DHERETIC -DHEXEN -DSTRIFE \
- -DPRECOMPILED < INSTALL.template > $@
+INSTALL: $(MANDIR)/INSTALL.template
+ $(MANDIR)//simplecpp -DDOOM -DHERETIC -DHEXEN -DSTRIFE \
+ -DPRECOMPILED < $(MANDIR)/INSTALL.template > $@
endif
diff --git a/opl/examples/Makefile.am b/opl/examples/Makefile.am
index 7c2c7c8a..9afcd513 100644
--- a/opl/examples/Makefile.am
+++ b/opl/examples/Makefile.am
@@ -1,5 +1,5 @@
-AM_CFLAGS = -I..
+AM_CFLAGS = -I$(top_srcdir)/opl
noinst_PROGRAMS=droplay
diff --git a/src/Makefile.am b/src/Makefile.am
index 16496d88..1e54824c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,9 +18,9 @@ SETUP_BINARIES = @PROGRAM_PREFIX@doom-setup$(EXEEXT) \
execgames_SCRIPTS = $(SETUP_BINARIES)
-AM_CFLAGS = -I$(top_builddir)/textscreen \
- -I$(top_builddir)/opl \
- -I$(top_builddir)/pcsound \
+AM_CFLAGS = -I$(top_srcdir)/textscreen \
+ -I$(top_srcdir)/opl \
+ -I$(top_srcdir)/pcsound \
@SDLMIXER_CFLAGS@ @SDLNET_CFLAGS@
# Common source files used by absolutely everything:
diff --git a/src/doom/Makefile.am b/src/doom/Makefile.am
index 74ba7014..e2ce86b4 100644
--- a/src/doom/Makefile.am
+++ b/src/doom/Makefile.am
@@ -1,4 +1,4 @@
-AM_CFLAGS = -I.. @SDL_CFLAGS@ @SDLMIXER_CFLAGS@ @SDLNET_CFLAGS@
+AM_CFLAGS = -I$(top_srcdir)/src @SDL_CFLAGS@ @SDLMIXER_CFLAGS@ @SDLNET_CFLAGS@
noinst_LIBRARIES=libdoom.a
diff --git a/src/heretic/Makefile.am b/src/heretic/Makefile.am
index bf834733..88ccc7b8 100644
--- a/src/heretic/Makefile.am
+++ b/src/heretic/Makefile.am
@@ -1,6 +1,6 @@
-AM_CFLAGS=-I.. \
- -I$(top_builddir)/textscreen \
+AM_CFLAGS=-I$(top_srcdir)/src \
+ -I$(top_srcdir)/textscreen \
@SDL_CFLAGS@ @SDLMIXER_CFLAGS@ @SDLNET_CFLAGS@
noinst_LIBRARIES=libheretic.a
@@ -51,11 +51,11 @@ r_segs.c \
r_things.c \
sb_bar.c \
sounds.c sounds.h \
-s_sound.c s_sound.h
+s_sound.c s_sound.h
EXTRA_DIST= \
i_sound.c \
-i_ibm.c
+i_ibm.c
FEATURE_DEHACKED_SOURCE_FILES = \
deh_ammo.c \
diff --git a/src/hexen/Makefile.am b/src/hexen/Makefile.am
index e8ca8b98..b3953ce6 100644
--- a/src/hexen/Makefile.am
+++ b/src/hexen/Makefile.am
@@ -1,4 +1,4 @@
-AM_CFLAGS=-I.. @SDL_CFLAGS@ @SDLMIXER_CFLAGS@ @SDLNET_CFLAGS@
+AM_CFLAGS=-I$(top_srcdir)/src @SDL_CFLAGS@ @SDLMIXER_CFLAGS@ @SDLNET_CFLAGS@
noinst_LIBRARIES=libhexen.a
@@ -58,10 +58,10 @@ sounds.c sounds.h \
st_start.c st_start.h \
sv_save.c \
textdefs.h \
- xddefs.h
+ xddefs.h
EXTRA_DIST= \
i_ibm.c \
-i_sound.c
+i_sound.c
libhexen_a_SOURCES=$(SOURCE_FILES)
diff --git a/src/resource.rc.in b/src/resource.rc.in
index ad81e1a5..51f16f43 100644
--- a/src/resource.rc.in
+++ b/src/resource.rc.in
@@ -1,6 +1,6 @@
-1 ICON "../data/doom.ico"
+1 ICON "@top_srcdir@/data/doom.ico"
-CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "manifest.xml"
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "@top_srcdir@/src/manifest.xml"
1 VERSIONINFO
PRODUCTVERSION @WINDOWS_RC_VERSION@
diff --git a/src/setup-res.rc.in b/src/setup-res.rc.in
index d82e136f..2be914f9 100644
--- a/src/setup-res.rc.in
+++ b/src/setup-res.rc.in
@@ -1,6 +1,6 @@
-1 ICON "../data/setup.ico"
+1 ICON "@top_srcdir@/data/setup.ico"
-1 24 MOVEABLE PURE "setup/setup-manifest.xml"
+1 24 MOVEABLE PURE "@top_builddir@/src/setup/setup-manifest.xml"
1 VERSIONINFO
PRODUCTVERSION @WINDOWS_RC_VERSION@
diff --git a/src/setup/Makefile.am b/src/setup/Makefile.am
index 1a1e1ccb..0adc90d7 100644
--- a/src/setup/Makefile.am
+++ b/src/setup/Makefile.am
@@ -3,7 +3,7 @@ gamesdir = $(prefix)/games
AM_CFLAGS = @SDL_CFLAGS@ \
@SDLMIXER_CFLAGS@ \
- -I$(top_builddir)/textscreen -I..
+ -I$(top_srcdir)/textscreen -I$(top_srcdir)/src
noinst_LIBRARIES = libsetup.a
diff --git a/src/strife/Makefile.am b/src/strife/Makefile.am
index df1f7bb0..271fcc20 100644
--- a/src/strife/Makefile.am
+++ b/src/strife/Makefile.am
@@ -1,4 +1,4 @@
-AM_CFLAGS = -I.. @SDL_CFLAGS@ @SDLMIXER_CFLAGS@ @SDLNET_CFLAGS@
+AM_CFLAGS = -I$(top_srcdir)/src @SDL_CFLAGS@ @SDLMIXER_CFLAGS@ @SDLNET_CFLAGS@
noinst_LIBRARIES=libstrife.a
diff --git a/textscreen/Makefile.am b/textscreen/Makefile.am
index 2c04ff0f..628d4ff6 100644
--- a/textscreen/Makefile.am
+++ b/textscreen/Makefile.am
@@ -1,5 +1,5 @@
-AM_CFLAGS = -I$(top_builddir)/src
+AM_CFLAGS = -I$(top_srcdir)/src
CTAGS_ARGS=-I TXT_UNCAST_ARG+
diff --git a/textscreen/examples/Makefile.am b/textscreen/examples/Makefile.am
index efd17072..4632d921 100644
--- a/textscreen/examples/Makefile.am
+++ b/textscreen/examples/Makefile.am
@@ -1,5 +1,5 @@
-AM_CFLAGS = -I.. -I$(top_builddir)/src
+AM_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/textscreen
noinst_PROGRAMS=guitest calculator