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.
This commit is contained in:
Jonathan Dowland 2017-11-30 17:15:56 +00:00
parent c1f553b92a
commit f515c88a96
2 changed files with 16 additions and 14 deletions

View file

@ -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

View file

@ -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