Mercurial > hg > early-roguelike
annotate srogue/Makefile.in @ 294:fe6b7a1a6dfc
Improve the documentation build process.
The choice between troff implementations is now made at configure time,
rather than using shell logic in the Makefile to choose while building.
author | John "Elwin" Edwards |
---|---|
date | Sat, 30 Dec 2017 14:15:52 -0500 |
parents | 0b3d1b38998f |
children |
rev | line source |
---|---|
101 | 1 # Makefile for rogue |
2 # %W% (Berkeley) %G% | |
3 # | |
4 # Super-Rogue | |
5 # Copyright (C) 1984 Robert D. Kindelberger | |
6 # All rights reserved. | |
7 # | |
8 # Based on "Rogue: Exploring the Dungeons of Doom" | |
9 # Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman | |
10 # All rights reserved. | |
11 # | |
12 # See the file LICENSE.TXT for full copyright and licensing information. | |
13 | |
287
0b3d1b38998f
Remove version numbers from docdir paths.
John "Elwin" Edwards
parents:
232
diff
changeset
|
14 DISTNAME=@PACKAGE_TARNAME@-@PACKAGE_VERSION@ |
0b3d1b38998f
Remove version numbers from docdir paths.
John "Elwin" Edwards
parents:
232
diff
changeset
|
15 PACKAGE_TARNAME=@PACKAGE_TARNAME@ |
101 | 16 PROGRAM=@PROGRAM@ |
17 | |
102
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
18 SCOREFILE=@SCOREFILE@ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
19 LOGFILE=@LOGFILE@ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
20 SAVEDIR=@SAVEDIR@ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
21 GROUPOWNER=@GROUPOWNER@ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
22 |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
23 DESTDIR= |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
24 prefix=@prefix@ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
25 exec_prefix=@exec_prefix@ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
26 datarootdir=@datarootdir@ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
27 bindir=@bindir@ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
28 docdir=@docdir@ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
29 |
104
fbc75509f4cd
Add config.h to the list of headers in the Makefiles.
John "Elwin" Edwards
parents:
102
diff
changeset
|
30 HDRS= bob.h cx.h ncx.h rdk.h rogue.h config.h |
101 | 31 OBJS= vers.o armor.o chase.o command.o daemon.o daemons.o disply.o encumb.o \ |
32 fight.o global.o init.o io.o list.o main.o mdport.o misc.o monsters.o \ | |
33 move.o new_leve.o options.o pack.o passages.o potions.o pstats.o \ | |
34 rings.o rip.o rooms.o save.o scrolls.o state.o sticks.o things.o \ | |
35 trader.o weapons.o wizard.o xcrypt.o | |
36 CFILES= vers.c armor.c chase.c command.c daemon.c daemons.c disply.c encumb.c \ | |
37 fight.c global.c init.c io.c list.c main.c mdport.c misc.c monsters.c \ | |
38 move.c new_leve.c options.c pack.c passages.c potions.c pstats.c \ | |
39 rings.c rip.c rooms.c save.c scrolls.c state.c sticks.c things.c \ | |
40 trader.c weapons.c wizard.c xcrypt.c | |
41 | |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
222
diff
changeset
|
42 DOCS= $(PROGRAM).doc |
101 | 43 MISC= Makefile LICENSE.TXT rogue.nr |
44 | |
231 | 45 CC = @CC@ |
116
97f8fdf9595c
Makefiles: don't set defaults for CFLAGS.
John "Elwin" Edwards
parents:
104
diff
changeset
|
46 CFLAGS= |
101 | 47 CPPFLAGS=@DEFS@ |
222 | 48 CRLIB = @LIBS@ |
101 | 49 RM = rm -f |
50 TAR = tar | |
102
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
51 INSTALL=@INSTALL@ |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
222
diff
changeset
|
52 GROFF=@GROFF@ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
222
diff
changeset
|
53 NROFF=@NROFF@ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
222
diff
changeset
|
54 COLCRT=@COLCRT@ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
222
diff
changeset
|
55 TBL=@TBL@ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
222
diff
changeset
|
56 |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
222
diff
changeset
|
57 all: $(PROGRAM) docs |
101 | 58 |
59 $(PROGRAM): $(HDRS) $(OBJS) | |
60 $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(CRLIB) -o $@ | |
61 | |
232
bac2c81fec78
Makefiles: don't rely on built-in implicit rules.
John "Elwin" Edwards
parents:
231
diff
changeset
|
62 .SUFFIXES: .c .o |
bac2c81fec78
Makefiles: don't rely on built-in implicit rules.
John "Elwin" Edwards
parents:
231
diff
changeset
|
63 |
bac2c81fec78
Makefiles: don't rely on built-in implicit rules.
John "Elwin" Edwards
parents:
231
diff
changeset
|
64 .c.o: |
bac2c81fec78
Makefiles: don't rely on built-in implicit rules.
John "Elwin" Edwards
parents:
231
diff
changeset
|
65 $(CC) $(CPPFLAGS) $(CFLAGS) -c $*.c |
bac2c81fec78
Makefiles: don't rely on built-in implicit rules.
John "Elwin" Edwards
parents:
231
diff
changeset
|
66 |
101 | 67 tags: $(HDRS) $(CFILES) |
68 ctags -u $? | |
69 ed - tags < :ctfix | |
70 sort tags -o tags | |
71 | |
72 lint: | |
73 lint -hxbc $(CFILES) $(CRLIB) > linterrs | |
74 | |
75 clean: | |
76 rm -f $(OBJS) core | |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
222
diff
changeset
|
77 rm -f $(PROGRAM) $(PROGRAM).exe $(PROGRAM) $(PROGRAM).exe $(PROGRAM).tar $(PROGRAM).tar.gz $(DOCS) |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
222
diff
changeset
|
78 |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
222
diff
changeset
|
79 docs: $(DOCS) |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
222
diff
changeset
|
80 |
294
fe6b7a1a6dfc
Improve the documentation build process.
John "Elwin" Edwards
parents:
287
diff
changeset
|
81 $(PROGRAM).doc@DOCS_GROFF@: rogue.nr |
fe6b7a1a6dfc
Improve the documentation build process.
John "Elwin" Edwards
parents:
287
diff
changeset
|
82 $(GROFF) -P-c -P-b -P-u -t -mm -Tascii rogue.nr >$(PROGRAM).doc |
fe6b7a1a6dfc
Improve the documentation build process.
John "Elwin" Edwards
parents:
287
diff
changeset
|
83 |
fe6b7a1a6dfc
Improve the documentation build process.
John "Elwin" Edwards
parents:
287
diff
changeset
|
84 $(PROGRAM).doc@DOCS_NROFF@: rogue.nr |
fe6b7a1a6dfc
Improve the documentation build process.
John "Elwin" Edwards
parents:
287
diff
changeset
|
85 $(TBL) rogue.nr | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc |
fe6b7a1a6dfc
Improve the documentation build process.
John "Elwin" Edwards
parents:
287
diff
changeset
|
86 |
fe6b7a1a6dfc
Improve the documentation build process.
John "Elwin" Edwards
parents:
287
diff
changeset
|
87 $(PROGRAM).doc@DOCS_NONE@: rogue.nr |
fe6b7a1a6dfc
Improve the documentation build process.
John "Elwin" Edwards
parents:
287
diff
changeset
|
88 @echo "Not building" $(PROGRAM).doc |
101 | 89 |
224
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
90 install: all |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
91 touch test |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
92 if test ! -f $(DESTDIR)$(SCOREFILE) ; then \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
93 mkdir -p `dirname $(DESTDIR)$(SCOREFILE)` ; \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
94 $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
95 if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
96 mkdir -p `dirname $(DESTDIR)$(LOGFILE)` ; \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
97 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
98 if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
99 mkdir -p $(DESTDIR)$(SAVEDIR) ; fi |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
100 mkdir -p $(DESTDIR)$(bindir) |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
101 $(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) |
102
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
102 -if test "x$(GROUPOWNER)" != "x" ; then \ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
103 chgrp $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
104 chgrp $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
105 chgrp $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
106 chgrp $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
107 chmod 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
108 chmod 0464 $(DESTDIR)$(SCOREFILE) ; \ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
109 chmod 0464 $(DESTDIR)$(LOGFILE) ; \ |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
110 chmod 0775 $(DESTDIR)$(SAVEDIR) ; \ |
224
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
111 fi |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
112 if test ! -d $(DESTDIR)$(docdir) ; \ |
102
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
113 then mkdir -p $(DESTDIR)$(docdir) ; fi |
224
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
114 $(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
115 $(INSTALL) -m 0644 rogue.nr $(DESTDIR)$(docdir)/$(PROGRAM).nr |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
116 $(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
117 $(RM) test |
102
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
118 |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
119 uninstall: |
224
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
120 $(RM) $(DESTDIR)$(bindir)/$(PROGRAM) |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
121 $(RM) -r $(DESTDIR)$(docdir) |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
122 |
102
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
123 reinstall: uninstall install |
1906d183f1f5
srogue: add install and uninstall targets to Makefile
John "Elwin" Edwards
parents:
101
diff
changeset
|
124 |
101 | 125 count: |
126 wc -l $(HDRS) $(CFILES) | |
127 | |
128 realcount: | |
129 cc -E $(CFILES) | ssp - | wc -l | |
130 | |
131 update: | |
132 ar uv .SAVE $(CFILES) $(HDRS) $(MISC) | |
133 | |
134 dist: | |
135 @mkdir dist | |
136 cp $(CFILES) $(HDRS) $(MISC) dist | |
137 | |
138 dist.src: | |
139 make clean | |
140 tar cf $(DISTNAME)-src.tar $(CFILES) $(HDRS) $(MISC) | |
141 gzip -f $(DISTNAME)-src.tar | |
142 | |
143 dist.irix: | |
144 make clean | |
145 make CC=cc CFLAGS="-woff 1116 -O3" $(PROGRAM) | |
146 tbl rogue.nr | nroff -mm | colcrt - > $(PROGRAM).doc | |
147 tar cf $(DISTNAME)-irix.tar $(PROGRAM) LICENSE.TXT $(PROGRAM).doc | |
148 gzip -f $(DISTNAME)-irix.tar | |
149 | |
150 debug.aix: | |
151 make clean | |
152 make CC=xlc CFLAGS="-qmaxmem=16768 -g -DWIZARD -qstrict" $(PROGRAM) | |
153 | |
154 dist.aix: | |
155 make clean | |
156 make CC=xlc CFLAGS="-qmaxmem=16768 -O3 -qstrict" $(PROGRAM) | |
157 tbl rogue.nr | nroff -mm | colcrt - > $(PROGRAM).doc | |
158 tar cf $(DISTNAME)-aix.tar $(PROGRAM) LICENSE.TXT $(PROGRAM).doc | |
159 gzip -f $(DISTNAME)-aix.tar | |
160 | |
161 debug.linux: | |
162 make clean | |
163 make CFLAGS="-g -DWIZARD" $(PROGRAM) | |
164 | |
165 dist.linux: | |
166 make clean | |
167 make $(PROGRAM) | |
168 groff -P-c -t -mm -Tascii rogue.nr | sed -e 's/.\x08//g' >$(PROGRAM).doc | |
169 tar cf $(DISTNAME)-linux.tar $(PROGRAM) LICENSE.TXT $(PROGRAM).doc | |
170 gzip -f $(DISTNAME)-linux.tar | |
171 | |
172 debug.interix: | |
173 make clean | |
174 make CFLAGS="-g3 -DWIZARD" $(PROGRAM) | |
175 | |
176 dist.interix: | |
177 make clean | |
178 make $(PROGRAM) | |
179 groff -P-b -P-u -t -mm -Tascii rogue.nr > $(PROGRAM).doc | |
180 tar cf $(DISTNAME)-interix.tar $(PROGRAM) LICENSE.TXT $(PROGRAM).doc | |
181 gzip -f $(DISTNAME)-interix.tar | |
182 | |
183 debug.cygwin: | |
184 make clean | |
185 make CFLAGS="-g3 -DWIZARD" $(PROGRAM) | |
186 | |
187 dist.cygwin: | |
188 make clean | |
189 make $(PROGRAM) | |
190 groff -P-c -t -mm -Tascii rogue.nr | sed -e 's/.\x08//g' >$(PROGRAM).doc | |
191 tar cf $(DISTNAME)-cygwin.tar $(PROGRAM).exe LICENSE.TXT $(PROGRAM).doc | |
192 gzip -f $(DISTNAME)-cygwin.tar | |
193 | |
194 debug.djgpp: | |
195 make clean | |
196 make CFGLAGS="-g3 -DWIZARD" LDFLAGS="-L$(DJDIR)/LIB" CRLIB="-lpdcurses" $(PROGRAM) | |
197 | |
198 dist.djgpp: | |
199 make clean | |
200 make LDFLAGS="-L$(DJDIR)/LIB" CRLIB="-lpdcurses" $(PROGRAM) | |
201 groff -t -mm -Tascii rogue.nr | sed -e 's/.\x08//g' > $(PROGRAM).doc | |
202 rm -f $(DISTNAME)-djgpp.zip | |
203 zip $(DISTNAME)-djgpp.zip $(PROGRAM).exe LICENSE.TXT $(PROGRAM).doc |