Mercurial > hg > early-roguelike
annotate rogue4/Makefile.in @ 239:837044d2c362
Merge the GCC5 and build fix branches.
This fixes all warnings produced by GCC 5, except the ones related to
system functions. Those could be fixed by including the proper headers,
but it would be better to replace the system-dependent code with
functions from mdport.c.
author | John "Elwin" Edwards |
---|---|
date | Fri, 11 Mar 2016 19:47:52 -0500 |
parents | bac2c81fec78 |
children | 0b3d1b38998f |
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 | |
232
bac2c81fec78
Makefiles: don't rely on built-in implicit rules.
John "Elwin" Edwards
parents:
224
diff
changeset
|
71 .SUFFIXES: .c .o |
bac2c81fec78
Makefiles: don't rely on built-in implicit rules.
John "Elwin" Edwards
parents:
224
diff
changeset
|
72 |
51 | 73 .c.o: |
109
ec9db3bb6b0b
rogue4: don't include config.h if it wasn't created.
John "Elwin" Edwards
parents:
104
diff
changeset
|
74 @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
|
75 @$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c -o $*.o |
51 | 76 # @cpp -P $(CFLAGS) $*.c | ./xstr -v -c - |
77 # @cc -c $(CFLAGS) x.c | |
78 # @mv x.o $*.o | |
79 | |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
80 all: $(PROGRAM) docs |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
81 |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
82 $(PROGRAM): $(HDRS) $(OBJS) # xs.o |
51 | 83 # @rm -f x.c |
84 # $(CC) $(LDFLAGS) xs.o $(OBJS) $(CRLIB) | |
85 $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ | |
86 | |
87 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
|
88 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ main.c |
51 | 89 |
90 vers.o: | |
109
ec9db3bb6b0b
rogue4: don't include config.h if it wasn't created.
John "Elwin" Edwards
parents:
104
diff
changeset
|
91 $(CC) -c $(CPPFLAGS) $(CFLAGS) vers.c |
51 | 92 |
93 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
|
94 $(CC) -c $(CPPFLAGS) $(CFLAGS) $(SF) $(NL) $(MACHDEP) mach_dep.c |
51 | 95 |
96 xs.o: strings | |
97 ./xstr | |
98 $(CC) -c $(CFLAGS) xs.c | |
99 | |
100 xstr: xstr.c | |
101 $(CC) -s -O -o xstr xstr.c | |
102 | |
103 findpw: findpw.c xcrypt.c | |
104 $(CC) -s -o findpw findpw.c xcrypt.c | |
105 | |
106 prob: prob.o extern.o xs.o | |
107 $(CC) -O -o prob prob.o extern.o xs.o | |
108 | |
109 prob.o: prob.c rogue.h | |
110 $(CC) -O -c prob.c | |
111 | |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
112 docs: $(DOCS) |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
113 |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
114 $(PROGRAM).cat: rogue.6 |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
115 if test "x$(GROFF)" != "x" ; then \ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
116 $(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\ |
224
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
117 elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then \ |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
118 $(NROFF) -man rogue.6 | colcrt - > $(PROGRAM).cat ;\ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
119 fi |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
120 |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
121 $(PROGRAM).doc: rogue.me |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
122 if test "x$(GROFF)" != "x" ; then \ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
123 $(GROFF) -P-c -P-b -P-u -t -me -Tutf8 rogue.me > $(PROGRAM).doc ;\ |
224
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
124 elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" && test "x$(TBL)" != "x" ; then \ |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
125 $(TBL) rogue.me | $(NROFF) -me | $(COLCRT) - > $(PROGRAM).doc ;\ |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
126 fi |
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
127 |
51 | 128 clean: |
223
0e99eade579c
Generate text documentation from the troff source files.
John "Elwin" Edwards
parents:
116
diff
changeset
|
129 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 | 130 |
131 maintainer-clean: | |
132 make clean | |
133 $(RM) Makefile config.h | |
134 $(RM) config.status config.log | |
135 $(RM) $(PROGRAM).scr $(PROGRAM).log $(PROGRAM).lck | |
136 $(RM) rogue.6 rogue.me | |
137 | |
224
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
138 install: all |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
139 $(TOUCH) test |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
140 if test ! -f $(DESTDIR)$(SCOREFILE) ; then \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
141 $(MKDIR) -p `dirname $(DESTDIR)$(SCOREFILE)` ; \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
142 $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
143 if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
144 $(MKDIR) -p `dirname $(DESTDIR)$(LOGFILE)` ; \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
145 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
146 if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
147 $(MKDIR) -p $(DESTDIR)$(SAVEDIR) ; fi |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
148 $(MKDIR) -p $(DESTDIR)$(bindir) |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
149 $(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) |
51 | 150 -if test "x$(GROUPOWNER)" != "x" ; then \ |
151 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \ | |
152 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \ | |
153 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \ | |
154 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \ | |
155 $(CHMOD) 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \ | |
156 $(CHMOD) 0464 $(DESTDIR)$(SCOREFILE) ; \ | |
157 $(CHMOD) 0464 $(DESTDIR)$(LOGFILE) ; \ | |
158 $(CHMOD) 0775 $(DESTDIR)$(SAVEDIR) ; \ | |
224
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
159 fi |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
160 if test ! -d $(DESTDIR)$(man6dir) && test -d $(DESTDIR)$(mandir) ; \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
161 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
162 else $(MKDIR) -p $(DESTDIR)$(man6dir) ; \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
163 $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(man6dir)/$(PROGRAM).6 ; fi |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
164 if test ! -d $(DESTDIR)$(docdir) ; \ |
51 | 165 then $(MKDIR) -p $(DESTDIR)$(docdir) ; fi |
224
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
166 $(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
167 $(INSTALL) -m 0644 rogue.me $(DESTDIR)$(docdir)/$(PROGRAM).me |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
168 $(INSTALL) -m 0644 $(DOCS) $(DESTDIR)$(docdir) |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
169 if test "x$(LOCKFILE)" != "x" && test ! -f $(DESTDIR)$(LOCKFILE) ; then \ |
51 | 170 $(INSTALL) -m 0666 test $(DESTDIR)$(LOCKFILE) ; \ |
171 $(RM) $(DESTDIR)$(LOCKFILE) ; \ | |
224
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
172 fi |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
173 $(RM) test |
51 | 174 |
175 uninstall: | |
224
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
176 $(RM) $(DESTDIR)$(bindir)/$(PROGRAM) |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
177 $(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6 |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
178 $(RM) $(DESTDIR)$(mandir)/$(PROGRAM).6 |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
179 $(RM) -r $(DESTDIR)$(docdir) |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
180 if test "x$(LOCKFILE)" != "x" ; then \ |
4d0f53998e8a
Makefile fixes related to installation.
John "Elwin" Edwards
parents:
223
diff
changeset
|
181 $(RM) $(DESTDIR)$(LOCKFILE) ; fi |
51 | 182 |
183 reinstall: uninstall install | |
184 | |
185 dist.src: | |
186 make clean | |
187 tar cf $(DISTNAME)-src.tar $(CFILES) $(HDRS) $(MISC) | |
188 gzip -f $(DISTNAME)-src.tar | |
189 | |
190 debug.irix: | |
191 make clean | |
192 make CC=cc CFLAGS="-woff 1116 -g -DWIZARD" rogue | |
193 dist.irix: | |
194 make clean | |
195 make CC=cc CFLAGS="-woff 1116 -O3" rogue | |
196 tbl rogue.me | nroff -me | colcrt - > rogue.doc | |
197 nroff -man rogue.6 | colcrt - > rogue.cat | |
198 tar cf $(DISTNAME)-irix.tar rogue LICENSE.TXT rogue.cat rogue.doc | |
199 gzip -f $(DISTNAME)-irix.tar | |
200 | |
201 debug.aix: | |
202 make clean | |
203 make CC=xlc CFLAGS="-qmaxmem=16768 -g -qstrict -DWIZARD" rogue | |
204 dist.aix: | |
205 make clean | |
206 make CC=xlc CFLAGS="-qmaxmem=16768 -O3 -qstrict" rogue | |
207 tbl rogue.me | nroff -me | colcrt - > rogue.doc | |
208 nroff -man rogue.6 | colcrt - > rogue.cat | |
209 tar cf $(DISTNAME)-aix.tar rogue LICENSE.TXT rogue.cat rogue.doc | |
210 gzip -f $(DISTNAME)-aix.tar | |
211 | |
212 debug.linux: | |
213 make clean | |
214 make CFLAGS="-g3 -DWIZARD" rogue | |
215 dist.linux: | |
216 make clean | |
217 make rogue | |
218 groff -P-c -t -me -Tascii rogue.me | sed -e 's/.\x08//g' > rogue.doc | |
219 groff -man rogue.6 | sed -e 's/.\x08//g' > rogue.cat | |
220 tar cf $(DISTNAME)-linux.tar rogue LICENSE.TXT rogue.cat rogue.doc | |
221 gzip -f $(DISTNAME)-linux.tar | |
222 | |
223 debug.interix: | |
224 make clean | |
225 make CFLAGS="-g3 -DWIZARD" rogue | |
226 dist.interix: | |
227 make clean | |
228 make rogue | |
229 groff -P-b -P-u -t -me -Tascii rogue.me > rogue.doc | |
230 groff -P-b -P-u -man -Tascii rogue.6 > rogue.cat | |
231 tar cf $(DISTNAME)-interix.tar rogue LICENSE.TXT rogue.cat rogue.doc | |
232 gzip -f $(DISTNAME)-interix.tar | |
233 | |
234 debug.cygwin: | |
235 make clean | |
236 make CFLAGS="-g3 -DWIZARD" rogue | |
237 dist.cygwin: | |
238 make clean | |
239 make rogue | |
240 groff -P-c -t -me -Tascii rogue.me | sed -e 's/.\x08//g' > rogue.doc | |
241 groff -P-c -man -Tascii rogue.6 | sed -e 's/.\x08//g' > rogue.cat | |
242 tar cf $(DISTNAME)-cygwin.tar rogue.exe LICENSE.TXT rogue.cat rogue.doc | |
243 gzip -f $(DISTNAME)-cygwin.tar | |
244 | |
245 debug.djgpp: | |
246 make clean | |
247 make CFLAGS="-g3 -DWIZARD" LDFLAGS="-L$(DJDIR)/LIB" rogue | |
248 dist.djgpp: | |
249 make clean | |
250 make CFLAGS="-O3" LDFLAGS="-L$(DJDIR)/LIB" rogue | |
251 groff -t -me -Tascii rogue.me | sed -e 's/.\x08//g' > rogue.doc | |
252 groff -man -Tascii rogue.6 | sed -e 's/.\x08//g' > rogue.cat | |
253 rm -f $(DISTNAME)-djgpp.zip | |
254 zip $(DISTNAME)-djgpp.zip rogue.exe LICENSE.TXT rogue.cat rogue.doc |