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

    don't build chocolate-setup.6 anymore; more subs

    Build chocolate-game-setup.6 directly instead of building
    chocolate-setup.6 and copying it to for each game. Apply
    substitutions to the template text to replace Chocolate,
    chocolate etc., as well as substituting the proper default
    cfg equivalent (e.g. heretic.cfg) for each game.
---
 man/Makefile.am    |  9 +++------
 man/setup.template | 24 ++++++++++++------------
 2 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/man/Makefile.am b/man/Makefile.am
index 71561a6a..a0654b18 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -30,7 +30,6 @@ GENERATED_MAN_PAGES =               \
            @PROGRAM_PREFIX@strife.6       \
            strife.cfg.5             \
            @PROGRAM_PREFIX@strife.cfg.5   \
-           @PROGRAM_PREFIX@setup.6  \
            @PROGRAM_PREFIX@server.6

 SETUP_MAN_PAGES =                          \
@@ -53,9 +52,6 @@ CLEANFILES = $(GENERATED_MAN_PAGES) $(SETUP_MAN_PAGES) \
 DOCGEN = $(srcdir)/docgen
 DOCGEN_COMMON_ARGS = -n "@PROGRAM_SPREFIX@" -s "@PACKAGE_NAME@" -z "@PACKAGE_SHORTNAME@"

-$(SETUP_MAN_PAGES): @PROGRAM_PREFIX@setup.6
-	cp $(srcdir)/@PROGRAM_PREFIX@setup.6 $@
-
 @PROGRAM_PREFIX@doom.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
 	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
                   -g doom -m $(srcdir)/doom.template \
@@ -145,9 +141,10 @@ INSTALL.hexen: INSTALL.template
                   -g server -m $(srcdir)/server.template \
                   $(top_srcdir)/src > $@

-@PROGRAM_PREFIX@setup.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
+$(SETUP_MAN_PAGES): $(top_srcdir)/src $(MANPAGE_GEN_FILES)
 	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
-                  -g setup -m $(srcdir)/setup.template \
+                  -g $(patsubst @PROGRAM_PREFIX@%-setup.6,%,$@) \
+                  -m $(srcdir)/setup.template \
                   $(top_srcdir)/src > $@

 strife.cfg.5: $(top_srcdir)/src default.cfg.template
diff --git a/man/setup.template b/man/setup.template
index 2b5a45ea..6c61e4e3 100644
--- a/man/setup.template
+++ b/man/setup.template
@@ -1,33 +1,33 @@
-.TH @PROGRAM_SPREFIX@\-setup 6
+.TH @PROGRAM_SPREFIX@\-@GAME@-setup 6
 .SH NAME
-@PROGRAM_SPREFIX@\-setup \- configuration tool for @PROGRAM_SPREFIX@\-doom
+@PROGRAM_SPREFIX@\-@GAME@-setup \- configuration tool for @PROGRAM_SPREFIX@\-@GAME@
 .SH SYNOPSIS
-.B @PROGRAM_SPREFIX@\-setup
+.B @PROGRAM_SPREFIX@\-@GAME@-setup
 [OPTIONS]
 .SH DESCRIPTION
 .PP
-@PACKAGE_NAME@ is a modern Doom engine designed to behave
-as similar to the original Doom game as is possible.
+@PACKAGE_SHORTNAME@ @GAME_UPPER@ is a modern @GAME_UPPER@ engine designed to behave
+as similar to the original @GAME_UPPER@ game as is possible.
 .PP
-.B @PROGRAM_SPREFIX@\-setup
-is a tool for configuring @PACKAGE_NAME@. It provides a menu\-based
+.B @PROGRAM_SPREFIX@\-@GAME@-setup
+is a tool for configuring @PACKAGE_SHORTNAME@ @GAME_UPPER@. It provides a menu\-based
 interface for the display, joystick, keyboard, mouse, sound and
 compatibility settings.
 .PP
-.B @PROGRAM_SPREFIX@\-setup
+.B @PROGRAM_SPREFIX@\-@GAME@-setup
 can also be used to start and join network games.
 .PP
 .SH OPTIONS
 .TP
 \fB-config <file>\fR
-Load configuration from the specified file, instead of default.cfg.
+Load configuration from the specified file, instead of @CFGFILE@.
 .TP
 \fB-extraconfig <file>\fR
-Load extra configuration from the specified file, instead of @PROGRAM_SPREFIX@\-doom.cfg.
+Load extra configuration from the specified file, instead of @PROGRAM_SPREFIX@\-@GAME@.cfg.
 .SH SEE ALSO
-\fB@PROGRAM_SPREFIX@\-doom\fR(6),
+\fB@PROGRAM_SPREFIX@\-@GAME@\fR(6),
 \fBdefault.cfg\fR(5),
-\fB@PROGRAM_SPREFIX@\-doom.cfg\fR(5)
+\fB@PROGRAM_SPREFIX@\-@GAME@.cfg\fR(5)
 .SH AUTHOR
 Chocolate Doom is written and maintained by Simon Howard.
 .PP