changeset 294:fe6b7a1a6dfc

Improve the documentation build process. The choice between troff implementations is now made at configure time, rather than using shell logic in the Makefile to choose while building.
author John "Elwin" Edwards
date Sat, 30 Dec 2017 14:15:52 -0500
parents 9dcf3344d3fd
children 1e1c81fbb533
files arogue7/Makefile.in arogue7/configure.ac rogue3/Makefile.in rogue3/configure.ac rogue4/Makefile.in rogue4/configure.ac rogue5/Makefile.in rogue5/configure.ac srogue/Makefile.in srogue/configure.ac urogue/Makefile.in urogue/configure.ac
diffstat 12 files changed, 180 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/arogue7/Makefile.in	Fri Dec 29 17:38:08 2017 -0500
+++ b/arogue7/Makefile.in	Sat Dec 30 14:15:52 2017 -0500
@@ -89,12 +89,14 @@
     
 docs: $(DOCS)
 
-$(PROGRAM).doc: aguide.mm
-	if test "x$(GROFF)" != "x" ; then \
-	$(GROFF) -P-c -P-b -P-u -t -mm -Tascii aguide.mm > $(PROGRAM).doc ;\
-	elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then \
-	$(TBL) aguide.mm | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc ;\
-	fi
+$(PROGRAM).doc@DOCS_GROFF@: aguide.mm
+	$(GROFF) -P-c -P-b -P-u -t -mm -Tascii aguide.mm > $(PROGRAM).doc
+
+$(PROGRAM).doc@DOCS_NROFF@: aguide.mm
+	$(TBL) aguide.mm | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc
+
+$(PROGRAM).doc@DOCS_NONE@: aguide.mm
+	@echo "Not building" $(PROGRAM).doc
 
 install: all
 	touch test
--- a/arogue7/configure.ac	Fri Dec 29 17:38:08 2017 -0500
+++ b/arogue7/configure.ac	Sat Dec 30 14:15:52 2017 -0500
@@ -30,6 +30,24 @@
 AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
 AC_CHECK_PROG([TBL], [tbl], [tbl],)
 
+if test "x$GROFF" != "x" ; then
+DOCS_GROFF=
+DOCS_NROFF=.no-nroff
+DOCS_NONE=.none
+elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then
+DOCS_GROFF=.no-groff
+DOCS_NROFF=
+DOCS_NONE=.none
+else
+DOCS_GROFF=.no-groff
+DOCS_NROFF=.no-nroff
+DOCS_NONE=
+fi
+
+AC_SUBST(DOCS_GROFF)
+AC_SUBST(DOCS_NROFF)
+AC_SUBST(DOCS_NONE)
+
 AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="arogue7"] )
 PROGRAM=$progname
 AC_SUBST(PROGRAM)
--- a/rogue3/Makefile.in	Fri Dec 29 17:38:08 2017 -0500
+++ b/rogue3/Makefile.in	Sat Dec 30 14:15:52 2017 -0500
@@ -89,19 +89,23 @@
 
 docs: $(DOCS)
 
-$(PROGRAM).doc: rogue.r
-	if test "x$(GROFF)" != "x" ; then \
-	$(GROFF) -P-c -P-b -P-u -t -ms -Tutf8 rogue.r > $(PROGRAM).doc ;\
-	elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then \
-	$(TBL) rogue.r | $(NROFF) -ms | $(COLCRT) - > $(PROGRAM).doc ;\
-	fi
+$(PROGRAM).doc@DOCS_GROFF@: rogue.r
+	$(GROFF) -P-c -P-b -P-u -t -ms -Tutf8 rogue.r > $(PROGRAM).doc
+
+$(PROGRAM).doc@DOCS_NROFF@: rogue.r
+	$(TBL) rogue.r | $(NROFF) -ms | $(COLCRT) - > $(PROGRAM).doc
+
+$(PROGRAM).doc@DOCS_NONE@: rogue.r
+	@echo "Not building" $(PROGRAM).doc
 
-$(PROGRAM).cat: rogue.6
-	if test "x$(GROFF)" != "x" ; then \
-	$(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\
-	elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then \
-	$(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\
-	fi
+$(PROGRAM).cat@DOCS_GROFF@: rogue.6
+	$(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat
+
+$(PROGRAM).cat@DOCS_NROFF@: rogue.6
+	$(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat
+
+$(PROGRAM).cat@DOCS_NONE@: rogue.6
+	@echo "Not building" $(PROGRAM).cat
 
 install: all
 	touch test
--- a/rogue3/configure.ac	Fri Dec 29 17:38:08 2017 -0500
+++ b/rogue3/configure.ac	Sat Dec 30 14:15:52 2017 -0500
@@ -37,6 +37,24 @@
 AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
 AC_CHECK_PROG([TBL], [tbl], [tbl],)
 
+if test "x$GROFF" != "x" ; then
+DOCS_GROFF=
+DOCS_NROFF=.no-nroff
+DOCS_NONE=.none
+elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then
+DOCS_GROFF=.no-groff
+DOCS_NROFF=
+DOCS_NONE=.none
+else
+DOCS_GROFF=.no-groff
+DOCS_NROFF=.no-nroff
+DOCS_NONE=
+fi
+
+AC_SUBST(DOCS_GROFF)
+AC_SUBST(DOCS_NROFF)
+AC_SUBST(DOCS_NONE)
+
 AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue3"] )
 PROGRAM=$progname
 AC_SUBST(PROGRAM)
--- a/rogue4/Makefile.in	Fri Dec 29 17:38:08 2017 -0500
+++ b/rogue4/Makefile.in	Sat Dec 30 14:15:52 2017 -0500
@@ -111,19 +111,23 @@
 
 docs: $(DOCS)
 
-$(PROGRAM).cat: rogue.6
-	if test "x$(GROFF)" != "x" ; then \
-	$(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\
-	elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then \
-	$(NROFF) -man rogue.6 | colcrt - > $(PROGRAM).cat ;\
-	fi
+$(PROGRAM).cat@DOCS_GROFF@: rogue.6
+	$(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat
+
+$(PROGRAM).cat@DOCS_NROFF@: rogue.6
+	$(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat
+
+$(PROGRAM).cat@DOCS_NONE@: rogue.6
+	@echo "Not building" $(PROGRAM).cat
 
-$(PROGRAM).doc: rogue.me
-	if test "x$(GROFF)" != "x" ; then \
-	$(GROFF) -P-c -P-b -P-u -t -me -Tutf8 rogue.me > $(PROGRAM).doc ;\
-	elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" && test "x$(TBL)" != "x" ; then \
-	$(TBL) rogue.me | $(NROFF) -me | $(COLCRT) - > $(PROGRAM).doc ;\
-	fi
+$(PROGRAM).doc@DOCS_GROFF@: rogue.me
+	$(GROFF) -P-c -P-b -P-u -t -me -Tutf8 rogue.me > $(PROGRAM).doc
+
+$(PROGRAM).doc@DOCS_NROFF@: rogue.me
+	$(TBL) rogue.me | $(NROFF) -me | $(COLCRT) - > $(PROGRAM).doc
+
+$(PROGRAM).doc@DOCS_NONE@: rogue.me
+	@echo "Not building" $(PROGRAM).doc
 
 clean:
 	rm -f $(POBJS) $(OBJS) core a.out p.out $(PROGRAM) strings make.out rogue.tar vgrind.* x.c x.o xs.c xs.o linterrs findpw distmod.o xs.po xstr rogue rogue.exe rogue.tar.gz $(DOCS) xstr.exe
--- a/rogue4/configure.ac	Fri Dec 29 17:38:08 2017 -0500
+++ b/rogue4/configure.ac	Sat Dec 30 14:15:52 2017 -0500
@@ -36,6 +36,24 @@
 AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
 AC_CHECK_PROG([TBL], [tbl], [tbl],)
 
+if test "x$GROFF" != "x" ; then
+DOCS_GROFF=
+DOCS_NROFF=.no-nroff
+DOCS_NONE=.none
+elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then
+DOCS_GROFF=.no-groff
+DOCS_NROFF=
+DOCS_NONE=.none
+else
+DOCS_GROFF=.no-groff
+DOCS_NROFF=.no-nroff
+DOCS_NONE=
+fi
+
+AC_SUBST(DOCS_GROFF)
+AC_SUBST(DOCS_NROFF)
+AC_SUBST(DOCS_NONE)
+
 AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue4"] )
 PROGRAM=$progname
 AC_SUBST(PROGRAM)
--- a/rogue5/Makefile.in	Fri Dec 29 17:38:08 2017 -0500
+++ b/rogue5/Makefile.in	Sat Dec 30 14:15:52 2017 -0500
@@ -178,24 +178,28 @@
 scmisc.o scedit.o:
 	$(CC) -O -c $(SF) $*.c
 
-$(PROGRAM).doc: rogue.me
-	if test "x$(GROFF)" != "x" ; then \
-	$(GROFF) -P-c -P-b -P-u -t -me -Tutf8 rogue.me > $(PROGRAM).doc ;\
-	elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then \
-        tbl rogue.me | $(NROFF) -me | colcrt - > $(PROGRAM).doc ;\
-	fi
+$(PROGRAM).doc@DOCS_GROFF@: rogue.me
+	$(GROFF) -P-c -P-b -P-u -t -me -Tutf8 rogue.me > $(PROGRAM).doc
+
+$(PROGRAM).doc@DOCS_NROFF@: rogue.me
+	$(TBL) rogue.me | $(NROFF) -me | $(COLCRT) - > $(PROGRAM).doc
+
+$(PROGRAM).doc@DOCS_NONE@: rogue.me
+	@echo "Not building" $(PROGRAM).doc
 
 #$(PROGRAM).html: rogue.me
 #	if test "x$(GROFF)" != "x" ; then \
 #	$(GROFF) -t -me -Thtml -P-l rogue.me > $(PROGRAM).html ;\
 #	fi
 
-$(PROGRAM).cat: rogue.6
-	if test "x$(GROFF)" != "x" ; then \
-	$(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\
-	elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then \
-	$(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\
-	fi
+$(PROGRAM).cat@DOCS_GROFF@: rogue.6
+	$(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat
+
+$(PROGRAM).cat@DOCS_NROFF@: rogue.6
+	$(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat
+
+$(PROGRAM).cat@DOCS_NONE@: rogue.6
+	@echo "Not building" $(PROGRAM).cat
 
 dist: clean $(PROGRAM)
 	tar cf $(DISTFILE).tar $(PROGRAM) LICENSE.TXT $(DOCS)
--- a/rogue5/configure.ac	Fri Dec 29 17:38:08 2017 -0500
+++ b/rogue5/configure.ac	Sat Dec 30 14:15:52 2017 -0500
@@ -39,6 +39,24 @@
 AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
 AC_CHECK_PROG([TBL], [tbl], [tbl],)
 
+if test "x$GROFF" != "x" ; then
+DOCS_GROFF=
+DOCS_NROFF=.no-nroff
+DOCS_NONE=.none
+elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then
+DOCS_GROFF=.no-groff
+DOCS_NROFF=
+DOCS_NONE=.none
+else
+DOCS_GROFF=.no-groff
+DOCS_NROFF=.no-nroff
+DOCS_NONE=
+fi
+
+AC_SUBST(DOCS_GROFF)
+AC_SUBST(DOCS_NROFF)
+AC_SUBST(DOCS_NONE)
+
 AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue5"] )
 PROGRAM=$progname
 AC_SUBST(PROGRAM)
--- a/srogue/Makefile.in	Fri Dec 29 17:38:08 2017 -0500
+++ b/srogue/Makefile.in	Sat Dec 30 14:15:52 2017 -0500
@@ -78,12 +78,14 @@
 
 docs: $(DOCS)
 
-$(PROGRAM).doc: rogue.nr
-	if test "x$(GROFF)" != "x" ; then \
-	$(GROFF) -P-c -P-b -P-u -t -mm -Tascii rogue.nr >$(PROGRAM).doc ;\
-	elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then \
-	$(TBL) rogue.nr | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc ;\
-	fi
+$(PROGRAM).doc@DOCS_GROFF@: rogue.nr
+	$(GROFF) -P-c -P-b -P-u -t -mm -Tascii rogue.nr >$(PROGRAM).doc
+
+$(PROGRAM).doc@DOCS_NROFF@: rogue.nr
+	$(TBL) rogue.nr | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc
+
+$(PROGRAM).doc@DOCS_NONE@: rogue.nr
+	@echo "Not building" $(PROGRAM).doc
 
 install: all
 	touch test
--- a/srogue/configure.ac	Fri Dec 29 17:38:08 2017 -0500
+++ b/srogue/configure.ac	Sat Dec 30 14:15:52 2017 -0500
@@ -32,6 +32,24 @@
 AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
 AC_CHECK_PROG([TBL], [tbl], [tbl],)
 
+if test "x$GROFF" != "x" ; then
+DOCS_GROFF=
+DOCS_NROFF=.no-nroff
+DOCS_NONE=.none
+elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then
+DOCS_GROFF=.no-groff
+DOCS_NROFF=
+DOCS_NONE=.none
+else
+DOCS_GROFF=.no-groff
+DOCS_NROFF=.no-nroff
+DOCS_NONE=
+fi
+
+AC_SUBST(DOCS_GROFF)
+AC_SUBST(DOCS_NROFF)
+AC_SUBST(DOCS_NONE)
+
 AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="srogue"] )
 PROGRAM=$progname
 AC_SUBST(PROGRAM)
--- a/urogue/Makefile.in	Fri Dec 29 17:38:08 2017 -0500
+++ b/urogue/Makefile.in	Sat Dec 30 14:15:52 2017 -0500
@@ -153,12 +153,14 @@
 
 docs: $(DOCS)
 
-$(PROGRAM).cat: urogue.6
-	if test "x$(GROFF)" != "x" ; then \
-	$(GROFF) -P-c -P-b -P-u -Tascii -man urogue.6 > $(PROGRAM).cat ;\
-	elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then \
-	$(NROFF) -man urogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\
-	fi
+$(PROGRAM).cat@DOCS_GROFF@: urogue.6
+	$(GROFF) -P-c -P-b -P-u -Tascii -man urogue.6 > $(PROGRAM).cat
+
+$(PROGRAM).cat@DOCS_NROFF@: urogue.6
+	$(NROFF) -man urogue.6 | $(COLCRT) - > $(PROGRAM).cat
+
+$(PROGRAM).cat@DOCS_NONE@: urogue.6
+	@echo "Not building" $(PROGRAM).cat
 
 install: all
 	touch test
--- a/urogue/configure.ac	Fri Dec 29 17:38:08 2017 -0500
+++ b/urogue/configure.ac	Sat Dec 30 14:15:52 2017 -0500
@@ -34,6 +34,24 @@
 AC_CHECK_PROG([GROFF], [groff], [groff],)
 AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
 
+if test "x$GROFF" != "x" ; then
+DOCS_GROFF=
+DOCS_NROFF=.no-nroff
+DOCS_NONE=.none
+elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then
+DOCS_GROFF=.no-groff
+DOCS_NROFF=
+DOCS_NONE=.none
+else
+DOCS_GROFF=.no-groff
+DOCS_NROFF=.no-nroff
+DOCS_NONE=
+fi
+
+AC_SUBST(DOCS_GROFF)
+AC_SUBST(DOCS_NROFF)
+AC_SUBST(DOCS_NONE)
+
 AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="urogue"] )
 PROGRAM=$progname
 AC_SUBST(PROGRAM)