diff arogue7/Makefile.in @ 223:0e99eade579c

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.
author John "Elwin" Edwards
date Sun, 21 Feb 2016 20:47:12 -0500
parents 2d221d574280
children 4d0f53998e8a
line wrap: on
line diff
--- a/arogue7/Makefile.in	Fri Feb 12 15:12:37 2016 -0500
+++ b/arogue7/Makefile.in	Sun Feb 21 20:47:12 2016 -0500
@@ -57,7 +57,7 @@
 MISC_C=	
 DOCSRC= aguide.mm
 #DOCS  = $(PROGRAM).doc $(PROGRAM).html
-DOCS  = arogue77.doc arogue77.html
+DOCS  = $(PROGRAM).doc arogue77.html
 MISC  =	Makefile $(MISC_C) LICENSE.TXT $(PROGRAM).sln $(PROGRAM).vcproj $(DOCS)\
         $(DOCSRC)
 
@@ -69,15 +69,30 @@
 LIBS =	@LIBS@
 RM    = rm -f
 INSTALL=@INSTALL@
+GROFF=@GROFF@
+NROFF=@NROFF@
+COLCRT=@COLCRT@
+TBL=@TBL@
 
 .SUFFIXES: .obj
 
 .c.obj:
 	$(CC) $(CFLAGS) /c $*.c
     
+all: $(PROGRAM) docs
+
 $(PROGRAM): $(HDRS) $(OBJS)
 	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
     
+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" -a "x$(TBL)" != "x" -a "x$(COLCRT)" != "x" ; then \
+	$(TBL) aguide.mm | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc ;\
+	fi
+
 install: $(PROGRAM)
 	-touch test
 	-if test ! -f $(DESTDIR)$(SCOREFILE) ; \
@@ -112,7 +127,7 @@
 clean:
 	$(RM) $(OBJS1)
 	$(RM) $(OBJS2)
-	$(RM) core a.exe a.out a.exe.stackdump $(PROGRAM) $(PROGRAM).exe $(PROGRAM).lck
+	$(RM) core a.exe a.out a.exe.stackdump $(PROGRAM) $(PROGRAM).exe $(PROGRAM).lck $(PROGRAM).doc
 	$(RM) $(PROGRAM).tar $(PROGRAM).tar.gz $(PROGRAM).zip 
     
 dist.src: