From 08ad5553fdec448b9c7955583a9728354e5ea4eb Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 20 Jan 2014 11:00:53 +0100 Subject: Some improvements to the build system 1) Instead of copying chocolate-setup into chocolate-{doom,heretic,hexen,strife}-setup, respectively, check in configure for symbolic linking and use that if available (falls back to "cp -pR" if not). 2) Add $(icons_DATA) to CLEANFILES so they get removed in clean phase; they are generated from doom-png and setup.png, respectively. 3) Consistently use @PROGRAM_PREFIX@ instead of the hard-coded "chocolate-" in the rules for the man pages. 4) Generate one man page for each setup program by symbolic linking of chocolate-setup.6 (see 1), add them to the list of installed man pages and to CLEANFILES. 5) Remove the redundant $(EXEEXT) suffix from the setup binaries (they were missing for execgames_PROGRAMS, anyway) --- configure.ac | 1 + data/Makefile.am | 1 + man/Makefile.am | 51 +++++++++++++++++++++++++++++++-------------------- src/Makefile.am | 17 ++++++++--------- 4 files changed, 41 insertions(+), 29 deletions(-) diff --git a/configure.ac b/configure.ac index 90c2752a..0b8892a3 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,7 @@ orig_CFLAGS="$CFLAGS" AC_PROG_CC AC_PROG_RANLIB +AC_PROG_LN_S AC_CHECK_PROG(HAVE_PYTHON, python, true, false) OPT_LEVEL=2 diff --git a/data/Makefile.am b/data/Makefile.am index 1fd4588c..894beb75 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -19,3 +19,4 @@ icons_DATA = @PROGRAM_PREFIX@doom.png \ @PROGRAM_PREFIX@setup.png : setup.png cp setup.png $@ +CLEANFILES = $(icons_DATA) diff --git a/man/Makefile.am b/man/Makefile.am index 8716d6d4..0eb585e0 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -16,39 +16,50 @@ strifedocsdir = ${docdir}/../${PROGRAM_PREFIX}strife if HAVE_PYTHON GENERATED_MAN_PAGES = \ - chocolate-doom.6 \ + @PROGRAM_PREFIX@doom.6 \ default.cfg.5 \ - chocolate-doom.cfg.5 \ - chocolate-heretic.6 \ + @PROGRAM_PREFIX@doom.cfg.5 \ + @PROGRAM_PREFIX@heretic.6 \ heretic.cfg.5 \ - chocolate-heretic.cfg.5 \ - chocolate-hexen.6 \ + @PROGRAM_PREFIX@heretic.cfg.5 \ + @PROGRAM_PREFIX@hexen.6 \ hexen.cfg.5 \ - chocolate-hexen.cfg.5 \ - chocolate-strife.6 \ + @PROGRAM_PREFIX@hexen.cfg.5 \ + @PROGRAM_PREFIX@strife.6 \ strife.cfg.5 \ - chocolate-strife.cfg.5 + @PROGRAM_PREFIX@strife.cfg.5 -man_MANS = chocolate-server.6 \ - chocolate-setup.6 \ - $(GENERATED_MAN_PAGES) +SETUP_MAN_PAGES = \ + @PROGRAM_PREFIX@doom-setup.6 \ + @PROGRAM_PREFIX@heretic-setup.6 \ + @PROGRAM_PREFIX@hexen-setup.6 \ + @PROGRAM_PREFIX@strife-setup.6 + +man_MANS = @PROGRAM_PREFIX@server.6 \ + @PROGRAM_PREFIX@setup.6 \ + $(GENERATED_MAN_PAGES) \ + $(SETUP_MAN_PAGES) doomdocs_DATA = INSTALL.doom CMDLINE.doom hereticdocs_DATA = INSTALL.heretic CMDLINE.heretic hexendocs_DATA = INSTALL.hexen CMDLINE.hexen strifedocs_DATA = INSTALL.strife CMDLINE.strife -CLEANFILES = $(GENERATED_MAN_PAGES) $(doomdocs_DATA) $(hereticdocs_DATA) \ +CLEANFILES = $(GENERATED_MAN_PAGES) $(SETUP_MAN_PAGES) \ + $(doomdocs_DATA) $(hereticdocs_DATA) \ $(hexendocs_DATA) $(strifedocs_DATA) -chocolate-doom.6: ../src $(MANPAGE_GEN_FILES) +$(SETUP_MAN_PAGES): @PROGRAM_PREFIX@setup.6 + $(LN_S) $< $@ + +@PROGRAM_PREFIX@doom.6: ../src $(MANPAGE_GEN_FILES) ./docgen -g doom -m doom.template ../src ../src/doom > $@ default.cfg.5: ../src default.cfg.template ./docgen -g doom -m default.cfg.template \ -c default ../src/m_config.c > $@ -chocolate-doom.cfg.5: ../src extra.cfg.template +@PROGRAM_PREFIX@doom.cfg.5: ../src extra.cfg.template ./docgen -g doom -m extra.cfg.template \ -c extended ../src/m_config.c > $@ @@ -59,14 +70,14 @@ INSTALL.doom: INSTALL.template ./simplecpp -DDOOM -DPRECOMPILED < INSTALL.template > $@ -chocolate-heretic.6: ../src $(MANPAGE_GEN_FILES) +@PROGRAM_PREFIX@heretic.6: ../src $(MANPAGE_GEN_FILES) ./docgen -g heretic -m heretic.template ../src ../src/heretic > $@ heretic.cfg.5: ../src default.cfg.template ./docgen -g heretic -m default.cfg.template \ -c default ../src/m_config.c > $@ -chocolate-heretic.cfg.5: ../src extra.cfg.template +@PROGRAM_PREFIX@heretic.cfg.5: ../src extra.cfg.template ./docgen -g heretic -m extra.cfg.template \ -c extended ../src/m_config.c > $@ @@ -77,14 +88,14 @@ INSTALL.heretic: INSTALL.template ./simplecpp -DHERETIC -DPRECOMPILED < INSTALL.template > $@ -chocolate-hexen.6: ../src $(MANPAGE_GEN_FILES) +@PROGRAM_PREFIX@hexen.6: ../src $(MANPAGE_GEN_FILES) ./docgen -g hexen -m hexen.template ../src ../src/hexen > $@ hexen.cfg.5: ../src default.cfg.template ./docgen -g hexen -m default.cfg.template \ -c default ../src/m_config.c > $@ -chocolate-hexen.cfg.5: ../src extra.cfg.template +@PROGRAM_PREFIX@hexen.cfg.5: ../src extra.cfg.template ./docgen -g hexen -m extra.cfg.template \ -c extended ../src/m_config.c > $@ @@ -95,14 +106,14 @@ INSTALL.hexen: INSTALL.template ./simplecpp -DHEXEN -DPRECOMPILED < INSTALL.template > $@ -chocolate-strife.6: ../src $(MANPAGE_GEN_FILES) +@PROGRAM_PREFIX@strife.6: ../src $(MANPAGE_GEN_FILES) ./docgen -g strife -m strife.template ../src ../src/strife > $@ strife.cfg.5: ../src default.cfg.template ./docgen -g strife -m default.cfg.template \ -c default ../src/m_config.c > $@ -chocolate-strife.cfg.5: ../src extra.cfg.template +@PROGRAM_PREFIX@strife.cfg.5: ../src extra.cfg.template ./docgen -g strife -m extra.cfg.template \ -c extended ../src/m_config.c > $@ diff --git a/src/Makefile.am b/src/Makefile.am index 5c9d15f4..0b831922 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,14 +7,13 @@ execgames_PROGRAMS = @PROGRAM_PREFIX@doom \ @PROGRAM_PREFIX@heretic \ @PROGRAM_PREFIX@hexen \ @PROGRAM_PREFIX@strife \ - @PROGRAM_PREFIX@server + @PROGRAM_PREFIX@server \ + @PROGRAM_PREFIX@setup -noinst_PROGRAMS = @PROGRAM_PREFIX@setup - -SETUP_BINARIES = @PROGRAM_PREFIX@doom-setup$(EXEEXT) \ - @PROGRAM_PREFIX@heretic-setup$(EXEEXT) \ - @PROGRAM_PREFIX@hexen-setup$(EXEEXT) \ - @PROGRAM_PREFIX@strife-setup$(EXEEXT) +SETUP_BINARIES = @PROGRAM_PREFIX@doom-setup \ + @PROGRAM_PREFIX@heretic-setup \ + @PROGRAM_PREFIX@hexen-setup \ + @PROGRAM_PREFIX@strife-setup execgames_SCRIPTS = $(SETUP_BINARIES) @@ -184,8 +183,8 @@ endif @PROGRAM_PREFIX@strife_LDADD = strife/libstrife.a $(EXTRA_LIBS) -$(SETUP_BINARIES): @PROGRAM_PREFIX@setup$(EXEEXT) - cp $< $@ +$(SETUP_BINARIES): @PROGRAM_PREFIX@setup + $(LN_S) $< $@ # Source files needed for chocolate-setup: -- cgit v1.2.3 From b8dfaffcb5bda84289b534b8252f0cc58e21a219 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 3 Feb 2014 06:34:14 +0100 Subject: Revert the more controversial changes in my previous pull request. Add back to binaries that are built and installed as _SCRIPTS targets. Copy instead of symbolic linking, the files are needed as binary copies anyway to allow for separate packaging of the game engines. --- configure.ac | 1 - man/Makefile.am | 2 +- src/Makefile.am | 17 +++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 0b8892a3..90c2752a 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,6 @@ orig_CFLAGS="$CFLAGS" AC_PROG_CC AC_PROG_RANLIB -AC_PROG_LN_S AC_CHECK_PROG(HAVE_PYTHON, python, true, false) OPT_LEVEL=2 diff --git a/man/Makefile.am b/man/Makefile.am index 0eb585e0..15bba637 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -50,7 +50,7 @@ CLEANFILES = $(GENERATED_MAN_PAGES) $(SETUP_MAN_PAGES) \ $(hexendocs_DATA) $(strifedocs_DATA) $(SETUP_MAN_PAGES): @PROGRAM_PREFIX@setup.6 - $(LN_S) $< $@ + cp $< $@ @PROGRAM_PREFIX@doom.6: ../src $(MANPAGE_GEN_FILES) ./docgen -g doom -m doom.template ../src ../src/doom > $@ diff --git a/src/Makefile.am b/src/Makefile.am index 0b831922..5c9d15f4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,13 +7,14 @@ execgames_PROGRAMS = @PROGRAM_PREFIX@doom \ @PROGRAM_PREFIX@heretic \ @PROGRAM_PREFIX@hexen \ @PROGRAM_PREFIX@strife \ - @PROGRAM_PREFIX@server \ - @PROGRAM_PREFIX@setup + @PROGRAM_PREFIX@server -SETUP_BINARIES = @PROGRAM_PREFIX@doom-setup \ - @PROGRAM_PREFIX@heretic-setup \ - @PROGRAM_PREFIX@hexen-setup \ - @PROGRAM_PREFIX@strife-setup +noinst_PROGRAMS = @PROGRAM_PREFIX@setup + +SETUP_BINARIES = @PROGRAM_PREFIX@doom-setup$(EXEEXT) \ + @PROGRAM_PREFIX@heretic-setup$(EXEEXT) \ + @PROGRAM_PREFIX@hexen-setup$(EXEEXT) \ + @PROGRAM_PREFIX@strife-setup$(EXEEXT) execgames_SCRIPTS = $(SETUP_BINARIES) @@ -183,8 +184,8 @@ endif @PROGRAM_PREFIX@strife_LDADD = strife/libstrife.a $(EXTRA_LIBS) -$(SETUP_BINARIES): @PROGRAM_PREFIX@setup - $(LN_S) $< $@ +$(SETUP_BINARIES): @PROGRAM_PREFIX@setup$(EXEEXT) + cp $< $@ # Source files needed for chocolate-setup: -- cgit v1.2.3