foxygit / doom Log in
commit f515c88a963d7b00bc6ed81fdd2b7fe87dde09b0
Author:     Jonathan Dowland <jon@dow.land>
AuthorDate: Thu Nov 30 17:15:56 2017 +0000
Commit:     Jonathan Dowland <jon@dow.land>
CommitDate: Tue Jan 9 17:19:49 2018 +0000

    install.template: move definitions to Makefile

    Define and pass LONG_EXE_NAME and LONG_GAME_NAME within the
    controlling Makefile when generating INSTALL.*, instead of
    deriving their values within the template depending on whether
    DOOM/HERETIC/HEXEN/STRIFE are defined.

    This means we can incorporate the values from @PROGRAM_PREFIX@
    and @PACKAGE_SHORTNAME@, instead of hardcoding chocolate- and
    Chocolate, respectively.
---
 man/INSTALL.template |  8 --------
 man/Makefile.am      | 22 ++++++++++++++++------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/man/INSTALL.template b/man/INSTALL.template
index 799ed69f..48ccd20d 100644
--- a/man/INSTALL.template
+++ b/man/INSTALL.template
@@ -1,18 +1,10 @@
 #ifdef DOOM
-#define LONG_GAME_NAME Chocolate Doom
-#define LONG_EXE_NAME  chocolate-doom
 #define DEFAULT_IWAD   doom2.wad
 #elif HERETIC
-#define LONG_GAME_NAME Chocolate Heretic
-#define LONG_EXE_NAME  chocolate-heretic
 #define DEFAULT_IWAD   heretic.wad
 #elif HEXEN
-#define LONG_GAME_NAME Chocolate Hexen
-#define LONG_EXE_NAME  chocolate-hexen
 #define DEFAULT_IWAD   hexen.wad
 #elif STRIFE
-#define LONG_GAME_NAME Chocolate Strife
-#define LONG_EXE_NAME  chocolate-strife
 #define DEFAULT_IWAD   strife1.wad
 #endif

diff --git a/man/Makefile.am b/man/Makefile.am
index f0099c79..71561a6a 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -77,8 +77,10 @@ CMDLINE.doom : CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/doom
                   $(top_srcdir)/src/ $(top_srcdir)/src/doom/ > $@

 INSTALL.doom: INSTALL.template
-	$(srcdir)/simplecpp -DDOOM -DPRECOMPILED < $(srcdir)/INSTALL.template > $@
-
+	$(srcdir)/simplecpp -DDOOM \
+            -D LONG_GAME_NAME="@PACKAGE_SHORTNAME@ Doom" \
+            -D LONG_EXE_NAME="@PROGRAM_PREFIX@doom" \
+            -DPRECOMPILED < $(srcdir)/INSTALL.template > $@

 @PROGRAM_PREFIX@heretic.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES) heretic.template
 	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
@@ -101,7 +103,10 @@ CMDLINE.heretic : CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/heretic
                   $(top_srcdir)/src/ $(top_srcdir)/src/heretic/ > $@

 INSTALL.heretic: INSTALL.template
-	$(srcdir)/simplecpp -DHERETIC -DPRECOMPILED < $(srcdir)/INSTALL.template > $@
+	$(srcdir)/simplecpp -DHERETIC \
+            -D LONG_GAME_NAME="@PACKAGE_SHORTNAME@ Heretic" \
+            -D LONG_EXE_NAME="@PROGRAM_PREFIX@heretic" \
+            -DPRECOMPILED < $(srcdir)/INSTALL.template > $@


 @PROGRAM_PREFIX@hexen.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
@@ -125,8 +130,10 @@ CMDLINE.hexen : CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/hexen
                   $(top_srcdir)/src/ $(top_srcdir)/src/hexen/ > $@

 INSTALL.hexen: INSTALL.template
-	$(srcdir)/simplecpp -DHEXEN -DPRECOMPILED < $(srcdir)/INSTALL.template > $@
-
+	$(srcdir)/simplecpp -DHEXEN \
+            -D LONG_GAME_NAME="@PACKAGE_SHORTNAME@ Hexen" \
+            -D LONG_EXE_NAME="@PROGRAM_PREFIX@hexen" \
+            -DPRECOMPILED < $(srcdir)/INSTALL.template > $@

 @PROGRAM_PREFIX@strife.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
 	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
@@ -159,7 +166,10 @@ CMDLINE.strife : CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/strife
                   $(top_srcdir)/src/ $(top_srcdir)/src/strife/ > $@

 INSTALL.strife: INSTALL.template
-	$(srcdir)/simplecpp -DSTRIFE -DPRECOMPILED < $(srcdir)/INSTALL.template > $@
+	$(srcdir)/simplecpp -DSTRIFE  \
+            -DLONG_EXE_NAME="@PROGRAM_PREFIX@strife" \
+            -DLONG_GAME_NAME="@PACKAGE_SHORTNAME@ Strife" \
+            -DPRECOMPILED < $(srcdir)/INSTALL.template > $@


 INSTALL: INSTALL.template