Mercurial > hg > early-roguelike
annotate rogue4/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 | 97f8fdf9595c |
children | 4d0f53998e8a |
rev | line source |
---|---|
51 | 1 # |
2 # Makefile for rogue | |
3 # @(#)Makefile 4.13 (Berkeley) 1/23/82 | |
4 # | |
5 # Rogue: Exploring the Dungeons of Doom | |
6 # Copyright (C) 1980, 1981, 1982 Michael Toy, Ken Arnold and Glenn Wichman | |
7 # All rights reserved. | |
8 # | |
9 # See the file LICENSE.TXT for full copyright and licensing information. | |
10 # | |
11 | |
12 DISTNAME=@PACKAGE_TARNAME@@PACKAGE_VERSION@ | |
13 PACKAGE_TARNAME = @PACKAGE_TARNAME@-@PACKAGE_VERSION@ | |
14 PROGRAM=@PROGRAM@ | |
15 | |
16 CC = @CC@ | |
17 LIBS = @LIBS@ | |
18 | |
19 SCOREFILE=@SCOREFILE@ | |
20 LOGFILE=@LOGFILE@ | |
21 SAVEDIR=@SAVEDIR@ | |
22 LOCKFILE=@LOCKFILE@ | |
116
97f8fdf9595c
Makefiles: don't set defaults for CFLAGS.
John "Elwin" Edwards
parents:
109
diff
changeset
|
23 |
51 | 24 GROUPOWNER=@GROUPOWNER@ |
25 | |
93 | 26 DESTDIR= |
51 | 27 prefix=@prefix@ |
28 exec_prefix=@exec_prefix@ | |
29 datarootdir=@datarootdir@ | |
30 bindir=@bindir@ | |
31 mandir=@mandir@ | |
32 man6dir=$(mandir)/man6 | |
33 docdir=@docdir@ | |
34 | |
104
fbc75509f4cd
Add config.h to the list of headers in the Makefiles.
John "Elwin" Edwards
parents:
96
diff
changeset
|
35 HDRS= rogue.h extern.h config.h |
51 | 36 DOBJS= vers.o extern.o armor.o chase.o command.o daemon.o daemons.o \ |
37 fight.o init.o io.o list.o main.o misc.o monsters.o move.o \ | |
38 new_level.o options.o pack.o passages.o potions.o rings.o rip.o \ | |
39 rooms.o save.o scrolls.o state.o sticks.o things.o weapons.o wizard.o\ | |
40 xcrypt.o mdport.o | |
41 OBJS= $(DOBJS) mach_dep.o | |
42 CFILES= vers.c extern.c armor.c chase.c command.c daemon.c daemons.c \ | |
43 fight.c init.c io.c list.c main.c misc.c monsters.c move.c \ | |
44 new_level.c options.c pack.c passages.c potions.c rings.c rip.c \ | |
45 rooms.c save.c scrolls.c state.c sticks.c things.c weapons.c wizard.c \ | |
46 mach_dep.c xcrypt.c mdport.c | |
47 MISC= Makefile LICENSE.TXT rogue.6 rogue.me | |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
48 DOCS= $(PROGRAM).cat $(PROGRAM).doc |
51 | 49 |
116
97f8fdf9595c
Makefiles: don't set defaults for CFLAGS.
John "Elwin" Edwards
parents:
109
diff
changeset
|
50 CFLAGS= |
109
ec9db3bb6b0b
rogue4: don't include config.h if it wasn't created.
John "Elwin" Edwards
parents:
104
diff
changeset
|
51 CPPFLAGS=@DEFS@ |
51 | 52 CRLIB = -lcurses |
53 RM = rm -f | |
54 TAR = tar | |
55 TOUCH=touch | |
56 MKDIR=mkdir | |
57 CHGRP=chgrp | |
58 CHMOD=chmod | |
59 INSTALL=@INSTALL@ | |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
60 GROFF=@GROFF@ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
61 NROFF=@NROFF@ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
62 COLCRT=@COLCRT@ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
63 TBL=@TBL@ |
51 | 64 |
65 SF= | |
66 NAMELIST= | |
67 NL= | |
68 #MACHDEP= -DMAXLOAD=40 -DLOADAV -DCHECKTIME=4 | |
69 MACHDEP= | |
70 | |
71 .c.o: | |
109
ec9db3bb6b0b
rogue4: don't include config.h if it wasn't created.
John "Elwin" Edwards
parents:
104
diff
changeset
|
72 @echo $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c |
ec9db3bb6b0b
rogue4: don't include config.h if it wasn't created.
John "Elwin" Edwards
parents:
104
diff
changeset
|
73 @$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c -o $*.o |
51 | 74 # @cpp -P $(CFLAGS) $*.c | ./xstr -v -c - |
75 # @cc -c $(CFLAGS) x.c | |
76 # @mv x.o $*.o | |
77 | |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
78 all: $(PROGRAM) docs |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
79 |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
80 $(PROGRAM): $(HDRS) $(OBJS) # xs.o |
51 | 81 # @rm -f x.c |
82 # $(CC) $(LDFLAGS) xs.o $(OBJS) $(CRLIB) | |
83 $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ | |
84 | |
85 main.o: main.c $(HDRS) | |
109
ec9db3bb6b0b
rogue4: don't include config.h if it wasn't created.
John "Elwin" Edwards
parents:
104
diff
changeset
|
86 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ main.c |
51 | 87 |
88 vers.o: | |
109
ec9db3bb6b0b
rogue4: don't include config.h if it wasn't created.
John "Elwin" Edwards
parents:
104
diff
changeset
|
89 $(CC) -c $(CPPFLAGS) $(CFLAGS) vers.c |
51 | 90 |
91 mach_dep.o: mach_dep.c | |
109
ec9db3bb6b0b
rogue4: don't include config.h if it wasn't created.
John "Elwin" Edwards
parents:
104
diff
changeset
|
92 $(CC) -c $(CPPFLAGS) $(CFLAGS) $(SF) $(NL) $(MACHDEP) mach_dep.c |
51 | 93 |
94 xs.o: strings | |
95 ./xstr | |
96 $(CC) -c $(CFLAGS) xs.c | |
97 | |
98 xstr: xstr.c | |
99 $(CC) -s -O -o xstr xstr.c | |
100 | |
101 findpw: findpw.c xcrypt.c | |
102 $(CC) -s -o findpw findpw.c xcrypt.c | |
103 | |
104 prob: prob.o extern.o xs.o | |
105 $(CC) -O -o prob prob.o extern.o xs.o | |
106 | |
107 prob.o: prob.c rogue.h | |
108 $(CC) -O -c prob.c | |
109 | |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
110 docs: $(DOCS) |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
111 |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
112 $(PROGRAM).cat: rogue.6 |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
113 if test "x$(GROFF)" != "x" ; then \ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
114 $(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
115 elif test "x$(NROFF)" != "x" -a "x$(COLCRT)" != "x" ; then \ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
116 $(NROFF) -man rogue.6 | colcrt - > $(PROGRAM).cat ;\ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
117 fi |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
118 |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
119 $(PROGRAM).doc: rogue.me |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
120 if test "x$(GROFF)" != "x" ; then \ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
121 $(GROFF) -P-c -P-b -P-u -t -me -Tutf8 rogue.me > $(PROGRAM).doc ;\ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
122 elif test "x$(NROFF)" != "x" -a "x$(COLCRT)" != "x" -a "x$(TBL)" != "x" ; then \ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
123 $(TBL) rogue.me | $(NROFF) -me | $(COLCRT) - > $(PROGRAM).doc ;\ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
124 fi |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
125 |
51 | 126 clean: |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
127 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 |
51 | 128 |
129 maintainer-clean: | |
130 make clean | |
131 $(RM) Makefile config.h | |
132 $(RM) config.status config.log | |
133 $(RM) $(PROGRAM).scr $(PROGRAM).log $(PROGRAM).lck | |
134 $(RM) rogue.6 rogue.me | |
135 | |
136 install: $(PROGRAM) | |
137 -$(TOUCH) test | |
138 -if test ! -f $(DESTDIR)$(SCOREFILE) ; \ | |
139 then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi | |
96
9fb343307b6b
Fix some 'test' failures when running 'make install'.
John "Elwin" Edwards
parents:
93
diff
changeset
|
140 -if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \ |
51 | 141 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi |
96
9fb343307b6b
Fix some 'test' failures when running 'make install'.
John "Elwin" Edwards
parents:
93
diff
changeset
|
142 -if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \ |
51 | 143 $(MKDIR) -p $(DESTDIR)$(SAVEDIR) ; fi |
144 -$(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) | |
145 -if test "x$(GROUPOWNER)" != "x" ; then \ | |
146 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \ | |
147 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \ | |
148 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \ | |
149 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \ | |
150 $(CHMOD) 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \ | |
151 $(CHMOD) 0464 $(DESTDIR)$(SCOREFILE) ; \ | |
152 $(CHMOD) 0464 $(DESTDIR)$(LOGFILE) ; \ | |
153 $(CHMOD) 0775 $(DESTDIR)$(SAVEDIR) ; \ | |
154 fi | |
155 -if test -d $(DESTDIR)$(man6dir) ; \ | |
156 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(man6dir)/$(PROGRAM).6 ; fi | |
157 -if test ! -d $(DESTDIR)$(man6dir) ; \ | |
158 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; fi | |
159 -if test ! -d $(DESTDIR)$(docdir) ; \ | |
160 then $(MKDIR) -p $(DESTDIR)$(docdir) ; fi | |
161 -$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT | |
162 -$(INSTALL) -m 0644 rogue.me $(DESTDIR)$(docdir)/$(PROGRAM).me | |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
163 -$(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
164 -$(INSTALL) -m 0644 $(PROGRAM).cat $(DESTDIR)$(docdir)/$(PROGRAM).cat |
96
9fb343307b6b
Fix some 'test' failures when running 'make install'.
John "Elwin" Edwards
parents:
93
diff
changeset
|
165 -if test "x$(LOCKFILE)" != "x" && test ! -f $(DESTDIR)$(LOCKFILE) ; then \ |
51 | 166 $(INSTALL) -m 0666 test $(DESTDIR)$(LOCKFILE) ; \ |
167 $(RM) $(DESTDIR)$(LOCKFILE) ; \ | |
168 fi | |
169 -$(RM) test | |
170 | |
171 uninstall: | |
172 -$(RM) $(DESTDIR)$(bindir)/$(PROGRAM) | |
173 -$(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6 | |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
174 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).doc |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
175 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).cat |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
176 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).me |
51 | 177 -$(RM) $(DESTDIR)$(LOCKFILE) |
178 -$(RMDIR) $(DESTDIR)$(docdir)$(PROGRAM) | |
179 | |
180 reinstall: uninstall install | |
181 | |
182 dist.src: | |
183 make clean | |
184 tar cf $(DISTNAME)-src.tar $(CFILES) $(HDRS) $(MISC) | |
185 gzip -f $(DISTNAME)-src.tar | |
186 | |
187 debug.irix: | |
188 make clean | |
189 make CC=cc CFLAGS="-woff 1116 -g -DWIZARD" rogue | |
190 dist.irix: | |
191 make clean | |
192 make CC=cc CFLAGS="-woff 1116 -O3" rogue | |
193 tbl rogue.me | nroff -me | colcrt - > rogue.doc | |
194 nroff -man rogue.6 | colcrt - > rogue.cat | |
195 tar cf $(DISTNAME)-irix.tar rogue LICENSE.TXT rogue.cat rogue.doc | |
196 gzip -f $(DISTNAME)-irix.tar | |
197 | |
198 debug.aix: | |
199 make clean | |
200 make CC=xlc CFLAGS="-qmaxmem=16768 -g -qstrict -DWIZARD" rogue | |
201 dist.aix: | |
202 make clean | |
203 make CC=xlc CFLAGS="-qmaxmem=16768 -O3 -qstrict" rogue | |
204 tbl rogue.me | nroff -me | colcrt - > rogue.doc | |
205 nroff -man rogue.6 | colcrt - > rogue.cat | |
206 tar cf $(DISTNAME)-aix.tar rogue LICENSE.TXT rogue.cat rogue.doc | |
207 gzip -f $(DISTNAME)-aix.tar | |
208 | |
209 debug.linux: | |
210 make clean | |
211 make CFLAGS="-g3 -DWIZARD" rogue | |
212 dist.linux: | |
213 make clean | |
214 make rogue | |
215 groff -P-c -t -me -Tascii rogue.me | sed -e 's/.\x08//g' > rogue.doc | |
216 groff -man rogue.6 | sed -e 's/.\x08//g' > rogue.cat | |
217 tar cf $(DISTNAME)-linux.tar rogue LICENSE.TXT rogue.cat rogue.doc | |
218 gzip -f $(DISTNAME)-linux.tar | |
219 | |
220 debug.interix: | |
221 make clean | |
222 make CFLAGS="-g3 -DWIZARD" rogue | |
223 dist.interix: | |
224 make clean | |
225 make rogue | |
226 groff -P-b -P-u -t -me -Tascii rogue.me > rogue.doc | |
227 groff -P-b -P-u -man -Tascii rogue.6 > rogue.cat | |
228 tar cf $(DISTNAME)-interix.tar rogue LICENSE.TXT rogue.cat rogue.doc | |
229 gzip -f $(DISTNAME)-interix.tar | |
230 | |
231 debug.cygwin: | |
232 make clean | |
233 make CFLAGS="-g3 -DWIZARD" rogue | |
234 dist.cygwin: | |
235 make clean | |
236 make rogue | |
237 groff -P-c -t -me -Tascii rogue.me | sed -e 's/.\x08//g' > rogue.doc | |
238 groff -P-c -man -Tascii rogue.6 | sed -e 's/.\x08//g' > rogue.cat | |
239 tar cf $(DISTNAME)-cygwin.tar rogue.exe LICENSE.TXT rogue.cat rogue.doc | |
240 gzip -f $(DISTNAME)-cygwin.tar | |
241 | |
242 debug.djgpp: | |
243 make clean | |
244 make CFLAGS="-g3 -DWIZARD" LDFLAGS="-L$(DJDIR)/LIB" rogue | |
245 dist.djgpp: | |
246 make clean | |
247 make CFLAGS="-O3" LDFLAGS="-L$(DJDIR)/LIB" rogue | |
248 groff -t -me -Tascii rogue.me | sed -e 's/.\x08//g' > rogue.doc | |
249 groff -man -Tascii rogue.6 | sed -e 's/.\x08//g' > rogue.cat | |
250 rm -f $(DISTNAME)-djgpp.zip | |
251 zip $(DISTNAME)-djgpp.zip rogue.exe LICENSE.TXT rogue.cat rogue.doc |