Generate text documentation from the troff source files.

This is done by make, in the 'docs' target, which is now part of the
normal build process.

Unfortunately, not all the games include troff sources.  Getting decent
HTML output from groff is still a difficult process which will not be
attempted at this time.  There are a few bugs in the 'install' and
'uninstall' rules.

Not to mention that the documentation is sometimes inaccurate.
This commit is contained in:
John "Elwin" Edwards 2016-02-21 20:47:12 -05:00
parent eab5aa2ec4
commit c6f7d67623
16 changed files with 133 additions and 2801 deletions

View file

@ -48,9 +48,9 @@ CFILES= vers.c armor.c chase.c command.c daemon.c daemons.c fight.c \
MISC_C=
DOCSRC= rogue.6 rogue.r
DOCS = $(PROGRAM).doc $(PROGRAM).cat $(PROGRAM).html readme36.html
DOCS = $(PROGRAM).doc $(PROGRAM).cat
MISC = Makefile $(MISC_C) LICENSE.TXT $(PROGRAM).sln $(PROGRAM).vcproj $(DOCS)\
$(DOCSRC)
$(DOCSRC) rogue36.html readme36.html
CC = gcc
CPPFLAGS =@DEFS@
@ -62,21 +62,43 @@ RM = rm -f
LD = $(CC)
LDOUT = -o
INSTALL=@INSTALL@
GROFF=@GROFF@
NROFF=@NROFF@
COLCRT=@COLCRT@
TBL=@TBL@
.SUFFIXES: .obj
.c.obj:
$(CC) $(CFLAGS) /c $*.c
all: $(PROGRAM)$(EXE) docs
$(PROGRAM)$(EXE): $(HDRS) $(OBJS)
$(LD) $(LDFLAGS) $(OBJS) $(LIBS) $(LDOUT)$@
clean:
$(RM) $(OBJS1)
$(RM) $(OBJS2)
$(RM) core $(PROGRAM) $(PROGRAM).exe $(DISTNAME).tar $(DISTNAME).tar.gz
$(RM) core $(PROGRAM) $(PROGRAM).exe $(DOCS) $(DISTNAME).tar $(DISTNAME).tar.gz
$(RM) $(DISTNAME).zip
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" -a "x$(TBL)" != "x" -a "x$(COLCRT)" != "x" ; then \
$(TBL) rogue.r | $(NROFF) -ms | $(COLCRT) - > $(PROGRAM).doc ;\
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" -a "x$(COLCRT)" != "x" ; then \
$(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\
fi
install: $(PROGRAM)
-touch test
-if test ! -f $(DESTDIR)$(SCOREFILE) ; \
@ -104,12 +126,16 @@ install: $(PROGRAM)
then mkdir -p $(DESTDIR)$(docdir) ; fi
-$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT
-$(INSTALL) -m 0644 rogue.r $(DESTDIR)$(docdir)/$(PROGRAM).r
-$(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc
-$(INSTALL) -m 0644 $(PROGRAM).cat $(DESTDIR)$(docdir)/$(PROGRAM).cat
-$(RM) test
uninstall:
-$(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
-$(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6
-$(RM) $(DESTDIR)$(docdir)$(PROGRAM)/$(PROGRAM).doc
-$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).r
-$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).doc
-$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).cat
-$(RMDIR) $(DESTDIR)$(docdir)$(PROGRAM)
reinstall: uninstall install