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.
This commit is contained in:
John "Elwin" Edwards 2017-12-30 14:15:52 -05:00
parent 7fac45d848
commit bb37c1c3f7
12 changed files with 180 additions and 54 deletions

View file

@ -89,12 +89,14 @@ $(PROGRAM): $(HDRS) $(OBJS)
docs: $(DOCS) docs: $(DOCS)
$(PROGRAM).doc: aguide.mm $(PROGRAM).doc@DOCS_GROFF@: aguide.mm
if test "x$(GROFF)" != "x" ; then \ $(GROFF) -P-c -P-b -P-u -t -mm -Tascii aguide.mm > $(PROGRAM).doc
$(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 \ $(PROGRAM).doc@DOCS_NROFF@: aguide.mm
$(TBL) aguide.mm | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc ;\ $(TBL) aguide.mm | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc
fi
$(PROGRAM).doc@DOCS_NONE@: aguide.mm
@echo "Not building" $(PROGRAM).doc
install: all install: all
touch test touch test

View file

@ -30,6 +30,24 @@ AC_CHECK_PROG([GROFF], [groff], [groff],)
AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],) AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
AC_CHECK_PROG([TBL], [tbl], [tbl],) 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"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="arogue7"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)

View file

@ -89,19 +89,23 @@ clean:
docs: $(DOCS) docs: $(DOCS)
$(PROGRAM).doc: rogue.r $(PROGRAM).doc@DOCS_GROFF@: rogue.r
if test "x$(GROFF)" != "x" ; then \ $(GROFF) -P-c -P-b -P-u -t -ms -Tutf8 rogue.r > $(PROGRAM).doc
$(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).cat: rogue.6 $(PROGRAM).doc@DOCS_NROFF@: rogue.r
if test "x$(GROFF)" != "x" ; then \ $(TBL) rogue.r | $(NROFF) -ms | $(COLCRT) - > $(PROGRAM).doc
$(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\
elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then \ $(PROGRAM).doc@DOCS_NONE@: rogue.r
$(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\ @echo "Not building" $(PROGRAM).doc
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 install: all
touch test touch test

View file

@ -37,6 +37,24 @@ AC_CHECK_PROG([GROFF], [groff], [groff],)
AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],) AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
AC_CHECK_PROG([TBL], [tbl], [tbl],) 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"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue3"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)

View file

@ -111,19 +111,23 @@ prob.o: prob.c rogue.h
docs: $(DOCS) docs: $(DOCS)
$(PROGRAM).cat: rogue.6 $(PROGRAM).cat@DOCS_GROFF@: rogue.6
if test "x$(GROFF)" != "x" ; then \ $(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat
$(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).doc: rogue.me $(PROGRAM).cat@DOCS_NROFF@: rogue.6
if test "x$(GROFF)" != "x" ; then \ $(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat
$(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 \ $(PROGRAM).cat@DOCS_NONE@: rogue.6
$(TBL) rogue.me | $(NROFF) -me | $(COLCRT) - > $(PROGRAM).doc ;\ @echo "Not building" $(PROGRAM).cat
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: 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 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

View file

@ -36,6 +36,24 @@ AC_CHECK_PROG([GROFF], [groff], [groff],)
AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],) AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
AC_CHECK_PROG([TBL], [tbl], [tbl],) 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"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue4"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)

View file

@ -178,24 +178,28 @@ scedit: scedit.o scmisc.o vers.o mdport.o xcrypt.o
scmisc.o scedit.o: scmisc.o scedit.o:
$(CC) -O -c $(SF) $*.c $(CC) -O -c $(SF) $*.c
$(PROGRAM).doc: rogue.me $(PROGRAM).doc@DOCS_GROFF@: rogue.me
if test "x$(GROFF)" != "x" ; then \ $(GROFF) -P-c -P-b -P-u -t -me -Tutf8 rogue.me > $(PROGRAM).doc
$(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 \ $(PROGRAM).doc@DOCS_NROFF@: rogue.me
tbl rogue.me | $(NROFF) -me | colcrt - > $(PROGRAM).doc ;\ $(TBL) rogue.me | $(NROFF) -me | $(COLCRT) - > $(PROGRAM).doc
fi
$(PROGRAM).doc@DOCS_NONE@: rogue.me
@echo "Not building" $(PROGRAM).doc
#$(PROGRAM).html: rogue.me #$(PROGRAM).html: rogue.me
# if test "x$(GROFF)" != "x" ; then \ # if test "x$(GROFF)" != "x" ; then \
# $(GROFF) -t -me -Thtml -P-l rogue.me > $(PROGRAM).html ;\ # $(GROFF) -t -me -Thtml -P-l rogue.me > $(PROGRAM).html ;\
# fi # fi
$(PROGRAM).cat: rogue.6 $(PROGRAM).cat@DOCS_GROFF@: rogue.6
if test "x$(GROFF)" != "x" ; then \ $(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat
$(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\
elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then \ $(PROGRAM).cat@DOCS_NROFF@: rogue.6
$(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\ $(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat
fi
$(PROGRAM).cat@DOCS_NONE@: rogue.6
@echo "Not building" $(PROGRAM).cat
dist: clean $(PROGRAM) dist: clean $(PROGRAM)
tar cf $(DISTFILE).tar $(PROGRAM) LICENSE.TXT $(DOCS) tar cf $(DISTFILE).tar $(PROGRAM) LICENSE.TXT $(DOCS)

View file

@ -39,6 +39,24 @@ AC_CHECK_PROG([GROFF], [groff], [groff],)
AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],) AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
AC_CHECK_PROG([TBL], [tbl], [tbl],) 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"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue5"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)

View file

@ -78,12 +78,14 @@ clean:
docs: $(DOCS) docs: $(DOCS)
$(PROGRAM).doc: rogue.nr $(PROGRAM).doc@DOCS_GROFF@: rogue.nr
if test "x$(GROFF)" != "x" ; then \ $(GROFF) -P-c -P-b -P-u -t -mm -Tascii rogue.nr >$(PROGRAM).doc
$(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 \ $(PROGRAM).doc@DOCS_NROFF@: rogue.nr
$(TBL) rogue.nr | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc ;\ $(TBL) rogue.nr | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc
fi
$(PROGRAM).doc@DOCS_NONE@: rogue.nr
@echo "Not building" $(PROGRAM).doc
install: all install: all
touch test touch test

View file

@ -32,6 +32,24 @@ AC_CHECK_PROG([GROFF], [groff], [groff],)
AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],) AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
AC_CHECK_PROG([TBL], [tbl], [tbl],) 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"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="srogue"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)

View file

@ -153,12 +153,14 @@ clean:
docs: $(DOCS) docs: $(DOCS)
$(PROGRAM).cat: urogue.6 $(PROGRAM).cat@DOCS_GROFF@: urogue.6
if test "x$(GROFF)" != "x" ; then \ $(GROFF) -P-c -P-b -P-u -Tascii -man urogue.6 > $(PROGRAM).cat
$(GROFF) -P-c -P-b -P-u -Tascii -man urogue.6 > $(PROGRAM).cat ;\
elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then \ $(PROGRAM).cat@DOCS_NROFF@: urogue.6
$(NROFF) -man urogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\ $(NROFF) -man urogue.6 | $(COLCRT) - > $(PROGRAM).cat
fi
$(PROGRAM).cat@DOCS_NONE@: urogue.6
@echo "Not building" $(PROGRAM).cat
install: all install: all
touch test touch test

View file

@ -34,6 +34,24 @@ AC_CHECK_PROG([NROFF], [nroff], [nroff],)
AC_CHECK_PROG([GROFF], [groff], [groff],) AC_CHECK_PROG([GROFF], [groff], [groff],)
AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],) 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"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="urogue"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)