comparison 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
comparison
equal deleted inserted replaced
222:a666e4a034ed 223:0e99eade579c
55 rooms.c save.c scrolls.c state.c sticks.c things.c \ 55 rooms.c save.c scrolls.c state.c sticks.c things.c \
56 trader.c util.c weapons.c wear.c wizard.c xcrypt.c 56 trader.c util.c weapons.c wear.c wizard.c xcrypt.c
57 MISC_C= 57 MISC_C=
58 DOCSRC= aguide.mm 58 DOCSRC= aguide.mm
59 #DOCS = $(PROGRAM).doc $(PROGRAM).html 59 #DOCS = $(PROGRAM).doc $(PROGRAM).html
60 DOCS = arogue77.doc arogue77.html 60 DOCS = $(PROGRAM).doc arogue77.html
61 MISC = Makefile $(MISC_C) LICENSE.TXT $(PROGRAM).sln $(PROGRAM).vcproj $(DOCS)\ 61 MISC = Makefile $(MISC_C) LICENSE.TXT $(PROGRAM).sln $(PROGRAM).vcproj $(DOCS)\
62 $(DOCSRC) 62 $(DOCSRC)
63 63
64 CC = gcc 64 CC = gcc
65 CPPFLAGS =@DEFS@ 65 CPPFLAGS =@DEFS@
67 COPTS = 67 COPTS =
68 CFLAGS= $(COPTS) $(ROPTS) 68 CFLAGS= $(COPTS) $(ROPTS)
69 LIBS = @LIBS@ 69 LIBS = @LIBS@
70 RM = rm -f 70 RM = rm -f
71 INSTALL=@INSTALL@ 71 INSTALL=@INSTALL@
72 GROFF=@GROFF@
73 NROFF=@NROFF@
74 COLCRT=@COLCRT@
75 TBL=@TBL@
72 76
73 .SUFFIXES: .obj 77 .SUFFIXES: .obj
74 78
75 .c.obj: 79 .c.obj:
76 $(CC) $(CFLAGS) /c $*.c 80 $(CC) $(CFLAGS) /c $*.c
77 81
82 all: $(PROGRAM) docs
83
78 $(PROGRAM): $(HDRS) $(OBJS) 84 $(PROGRAM): $(HDRS) $(OBJS)
79 $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ 85 $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
80 86
87 docs: $(DOCS)
88
89 $(PROGRAM).doc: aguide.mm
90 if test "x$(GROFF)" != "x" ; then \
91 $(GROFF) -P-c -P-b -P-u -t -mm -Tascii aguide.mm > $(PROGRAM).doc ;\
92 elif test "x$(NROFF)" != "x" -a "x$(TBL)" != "x" -a "x$(COLCRT)" != "x" ; then \
93 $(TBL) aguide.mm | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc ;\
94 fi
95
81 install: $(PROGRAM) 96 install: $(PROGRAM)
82 -touch test 97 -touch test
83 -if test ! -f $(DESTDIR)$(SCOREFILE) ; \ 98 -if test ! -f $(DESTDIR)$(SCOREFILE) ; \
84 then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi 99 then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi
85 -if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \ 100 -if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \
110 reinstall: uninstall install 125 reinstall: uninstall install
111 126
112 clean: 127 clean:
113 $(RM) $(OBJS1) 128 $(RM) $(OBJS1)
114 $(RM) $(OBJS2) 129 $(RM) $(OBJS2)
115 $(RM) core a.exe a.out a.exe.stackdump $(PROGRAM) $(PROGRAM).exe $(PROGRAM).lck 130 $(RM) core a.exe a.out a.exe.stackdump $(PROGRAM) $(PROGRAM).exe $(PROGRAM).lck $(PROGRAM).doc
116 $(RM) $(PROGRAM).tar $(PROGRAM).tar.gz $(PROGRAM).zip 131 $(RM) $(PROGRAM).tar $(PROGRAM).tar.gz $(PROGRAM).zip
117 132
118 dist.src: 133 dist.src:
119 make clean 134 make clean
120 tar cf $(DISTNAME)-src.tar $(CFILES) $(HDRS) $(MISC) 135 tar cf $(DISTNAME)-src.tar $(CFILES) $(HDRS) $(MISC)