comparison rogue3/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 a666e4a034ed
children 4d0f53998e8a
comparison
equal deleted inserted replaced
222:a666e4a034ed 223:0e99eade579c
46 save.c scrolls.c state.c sticks.c things.c weapons.c wizard.c xcrypt.c 46 save.c scrolls.c state.c sticks.c things.c weapons.c wizard.c xcrypt.c
47 47
48 48
49 MISC_C= 49 MISC_C=
50 DOCSRC= rogue.6 rogue.r 50 DOCSRC= rogue.6 rogue.r
51 DOCS = $(PROGRAM).doc $(PROGRAM).cat $(PROGRAM).html readme36.html 51 DOCS = $(PROGRAM).doc $(PROGRAM).cat
52 MISC = Makefile $(MISC_C) LICENSE.TXT $(PROGRAM).sln $(PROGRAM).vcproj $(DOCS)\ 52 MISC = Makefile $(MISC_C) LICENSE.TXT $(PROGRAM).sln $(PROGRAM).vcproj $(DOCS)\
53 $(DOCSRC) 53 $(DOCSRC) rogue36.html readme36.html
54 54
55 CC = gcc 55 CC = gcc
56 CPPFLAGS =@DEFS@ 56 CPPFLAGS =@DEFS@
57 ROPTS = 57 ROPTS =
58 COPTS = 58 COPTS =
60 LIBS = @LIBS@ 60 LIBS = @LIBS@
61 RM = rm -f 61 RM = rm -f
62 LD = $(CC) 62 LD = $(CC)
63 LDOUT = -o 63 LDOUT = -o
64 INSTALL=@INSTALL@ 64 INSTALL=@INSTALL@
65 GROFF=@GROFF@
66 NROFF=@NROFF@
67 COLCRT=@COLCRT@
68 TBL=@TBL@
65 69
66 .SUFFIXES: .obj 70 .SUFFIXES: .obj
67 71
68 .c.obj: 72 .c.obj:
69 $(CC) $(CFLAGS) /c $*.c 73 $(CC) $(CFLAGS) /c $*.c
74
75 all: $(PROGRAM)$(EXE) docs
70 76
71 $(PROGRAM)$(EXE): $(HDRS) $(OBJS) 77 $(PROGRAM)$(EXE): $(HDRS) $(OBJS)
72 $(LD) $(LDFLAGS) $(OBJS) $(LIBS) $(LDOUT)$@ 78 $(LD) $(LDFLAGS) $(OBJS) $(LIBS) $(LDOUT)$@
73 79
74 clean: 80 clean:
75 $(RM) $(OBJS1) 81 $(RM) $(OBJS1)
76 $(RM) $(OBJS2) 82 $(RM) $(OBJS2)
77 $(RM) core $(PROGRAM) $(PROGRAM).exe $(DISTNAME).tar $(DISTNAME).tar.gz 83 $(RM) core $(PROGRAM) $(PROGRAM).exe $(DOCS) $(DISTNAME).tar $(DISTNAME).tar.gz
78 $(RM) $(DISTNAME).zip 84 $(RM) $(DISTNAME).zip
85
86 docs: $(DOCS)
87
88 $(PROGRAM).doc: rogue.r
89 if test "x$(GROFF)" != "x" ; then \
90 $(GROFF) -P-c -P-b -P-u -t -ms -Tutf8 rogue.r > $(PROGRAM).doc ;\
91 elif test "x$(NROFF)" != "x" -a "x$(TBL)" != "x" -a "x$(COLCRT)" != "x" ; then \
92 $(TBL) rogue.r | $(NROFF) -ms | $(COLCRT) - > $(PROGRAM).doc ;\
93 fi
94
95 $(PROGRAM).cat: rogue.6
96 if test "x$(GROFF)" != "x" ; then \
97 $(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\
98 elif test "x$(NROFF)" != "x" -a "x$(COLCRT)" != "x" ; then \
99 $(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\
100 fi
79 101
80 install: $(PROGRAM) 102 install: $(PROGRAM)
81 -touch test 103 -touch test
82 -if test ! -f $(DESTDIR)$(SCOREFILE) ; \ 104 -if test ! -f $(DESTDIR)$(SCOREFILE) ; \
83 then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi 105 then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi
102 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; fi 124 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; fi
103 -if test ! -d $(DESTDIR)$(docdir) ; \ 125 -if test ! -d $(DESTDIR)$(docdir) ; \
104 then mkdir -p $(DESTDIR)$(docdir) ; fi 126 then mkdir -p $(DESTDIR)$(docdir) ; fi
105 -$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT 127 -$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT
106 -$(INSTALL) -m 0644 rogue.r $(DESTDIR)$(docdir)/$(PROGRAM).r 128 -$(INSTALL) -m 0644 rogue.r $(DESTDIR)$(docdir)/$(PROGRAM).r
129 -$(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc
130 -$(INSTALL) -m 0644 $(PROGRAM).cat $(DESTDIR)$(docdir)/$(PROGRAM).cat
107 -$(RM) test 131 -$(RM) test
108 132
109 uninstall: 133 uninstall:
110 -$(RM) $(DESTDIR)$(bindir)/$(PROGRAM) 134 -$(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
111 -$(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6 135 -$(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6
112 -$(RM) $(DESTDIR)$(docdir)$(PROGRAM)/$(PROGRAM).doc 136 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).r
137 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).doc
138 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).cat
113 -$(RMDIR) $(DESTDIR)$(docdir)$(PROGRAM) 139 -$(RMDIR) $(DESTDIR)$(docdir)$(PROGRAM)
114 140
115 reinstall: uninstall install 141 reinstall: uninstall install
116 142
117 dist.src: 143 dist.src: