Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 256 lines (210 sloc) 7.644 kb
a82d95c @sorear Original NH343 tarball contents
authored
1 # NetHack Makefile.
2 # SCCS Id: @(#)Makefile.top 3.4 1995/01/05
3
4 # newer makes predefine $(MAKE) to 'make' and do smarter processing of
5 # recursive make calls if $(MAKE) is used
6 # these makes allow $(MAKE) to be overridden by the environment if someone
7 # wants to (or has to) use something other than the standard make, so we do
8 # not want to unconditionally set $(MAKE) here
9 #
10 # unfortunately, some older makes do not predefine $(MAKE); if you have one of
11 # these, uncomment the following line
12 # (you will know that you have one if you get complaints about unable to
13 # execute things like 'data' and 'rumors')
14 # MAKE = make
15
16 # make NetHack
17 PREFIX = /usr
18 GAME = nethack
19 # GAME = nethack.prg
20 GAMEUID = games
21 GAMEGRP = bin
22
23 # Permissions - some places use setgid instead of setuid, for instance
24 # See also the option "SECURE" in include/config.h
25 GAMEPERM = 04755
26 FILEPERM = 0644
27 EXEPERM = 0755
28 DIRPERM = 0755
29
30 # GAMEDIR also appears in config.h as "HACKDIR".
31 # VARDIR may also appear in unixconf.h as "VAR_PLAYGROUND" else GAMEDIR
32 #
33 # note that 'make install' believes in creating a nice tidy GAMEDIR for
34 # installation, free of debris from previous NetHack versions --
35 # therefore there should not be anything in GAMEDIR that you want to keep
36 # (if there is, you'll have to do the installation by hand or modify the
37 # instructions)
38 GAMEDIR = $(PREFIX)/games/lib/$(GAME)dir
39 VARDIR = $(GAMEDIR)
40 SHELLDIR = $(PREFIX)/games
41
3e3e2cb @sorear Rip out sys/ and win/ system, force unix+tty for now
authored
42 VARDAT = data oracles options quest.dat rumors
a82d95c @sorear Original NH343 tarball contents
authored
43
44 # Some versions of make use the SHELL environment variable as the shell
45 # for running commands. We need this to be a Bourne shell.
46 # SHELL = /bin/sh
47 # for Atari
48 # SHELL=E:/GEMINI2/MUPFEL.TTP
49
50 # Commands for setting the owner and group on files during installation.
51 # Some systems fail with one or the other when installing over NFS or for
52 # other permission-related reasons. If that happens, you may want to set the
53 # command to "true", which is a no-op. Note that disabling chown or chgrp
54 # will only work if setuid (or setgid) behavior is not desired or required.
55 CHOWN = chown
56 CHGRP = chgrp
57
58 #
59 # end of configuration
60 #
61
62 DATHELP = help hh cmdhelp history opthelp wizhelp
63
64 SPEC_LEVS = asmodeus.lev baalz.lev bigrm-?.lev castle.lev fakewiz?.lev \
65 juiblex.lev knox.lev medusa-?.lev minend-?.lev minefill.lev \
66 minetn-?.lev oracle.lev orcus.lev sanctum.lev soko?-?.lev \
67 tower?.lev valley.lev wizard?.lev \
68 astral.lev air.lev earth.lev fire.lev water.lev
69 QUEST_LEVS = ???-goal.lev ???-fil?.lev ???-loca.lev ???-strt.lev
70
71 DATNODLB = $(VARDATND) license
af58215 @sorear Fix DLB errors introduced earlier, disable chdir usage
authored
72 DATDLB = $(DATHELP) dungeon $(SPEC_LEVS) $(QUEST_LEVS) $(VARDAT)
a82d95c @sorear Original NH343 tarball contents
authored
73 DAT = $(DATNODLB) $(DATDLB)
74
75 all: $(GAME) recover Guidebook $(VARDAT) dungeon spec_levs check-dlb
cd7cd8d @sorear Finishing touches on building libnethack.so. Assumes ELF for now.
authored
76 cp src/libnethack.so dat/nhdat .
a82d95c @sorear Original NH343 tarball contents
authored
77 @echo "Done."
78
cd7cd8d @sorear Finishing touches on building libnethack.so. Assumes ELF for now.
authored
79 $(GAME):
80 ( cd src ; $(MAKE) )
81
a82d95c @sorear Original NH343 tarball contents
authored
82 # Note: many of the dependencies below are here to allow parallel make
83 # to generate valid output
84
85 Guidebook:
86 ( cd doc ; $(MAKE) Guidebook )
87
88 manpages:
89 ( cd doc ; $(MAKE) manpages )
90
91 data: $(GAME)
92 ( cd dat ; $(MAKE) data )
93
94 rumors: $(GAME)
95 ( cd dat ; $(MAKE) rumors )
96
97 oracles: $(GAME)
98 ( cd dat ; $(MAKE) oracles )
99
100 # Note: options should have already been made with make, but...
101 options: $(GAME)
102 ( cd dat ; $(MAKE) options )
103
104 quest.dat: $(GAME)
105 ( cd dat ; $(MAKE) quest.dat )
106
107 spec_levs: dungeon
108 ( cd util ; $(MAKE) lev_comp )
109 ( cd dat ; $(MAKE) spec_levs )
110 ( cd dat ; $(MAKE) quest_levs )
111
112 dungeon: $(GAME)
113 ( cd util ; $(MAKE) dgn_comp )
114 ( cd dat ; $(MAKE) dungeon )
115
116 nhtiles.bmp: $(GAME)
117 ( cd dat ; $(MAKE) nhtiles.bmp )
118
119 x11tiles: $(GAME)
120 ( cd util ; $(MAKE) tile2x11 )
121 ( cd dat ; $(MAKE) x11tiles )
122
123 beostiles: $(GAME)
124 ( cd util ; $(MAKE) tile2beos )
125 ( cd dat ; $(MAKE) beostiles )
126
127 NetHack.ad: $(GAME)
128 ( cd dat ; $(MAKE) NetHack.ad )
129
130 pet_mark.xbm:
131 ( cd dat ; $(MAKE) pet_mark.xbm )
132
133 rip.xpm:
134 ( cd dat ; $(MAKE) rip.xpm )
135
136 mapbg.xpm:
137 (cd dat ; $(MAKE) mapbg.xpm )
138
139 nhsplash.xpm:
140 ( cd dat ; $(MAKE) nhsplash.xpm )
141
142 nh16.img: $(GAME)
143 ( cd util ; $(MAKE) tile2img.ttp )
144 ( cd dat ; $(MAKE) nh16.img )
145
146 rip.img:
147 ( cd util ; $(MAKE) xpm2img.ttp )
148 ( cd dat ; $(MAKE) rip.img )
149 GEM_RSC.RSC:
150 ( cd dat ; $(MAKE) GEM_RSC.RSC )
151
152 title.img:
153 ( cd dat ; $(MAKE) title.img )
154
155 check-dlb: options
156 @if egrep -s librarian dat/options ; then $(MAKE) dlb ; else true ; fi
157
158 dlb:
159 ( cd util ; $(MAKE) dlb )
160 ( cd dat ; ../util/dlb cf nhdat $(DATDLB) )
161
162 # recover can be used when INSURANCE is defined in include/config.h
163 # and the checkpoint option is true
164 recover: $(GAME)
165 ( cd util ; $(MAKE) recover )
166
167 dofiles:
168 target=`sed -n \
169 -e '/librarian/{' \
170 -e 's/.*/dlb/p' \
171 -e 'q' \
172 -e '}' \
173 -e '$$s/.*/nodlb/p' < dat/options` ; \
174 $(MAKE) dofiles-$${target-nodlb}
175 cp src/$(GAME) $(GAMEDIR)
176 cp util/recover $(GAMEDIR)
177 -rm -f $(SHELLDIR)/$(GAME)
178 sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \
179 -e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \
180 < sys/unix/nethack.sh \
181 > $(SHELLDIR)/$(GAME)
182 # set up their permissions
183 -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(GAME) recover ; \
184 $(CHGRP) $(GAMEGRP) $(GAME) recover )
185 chmod $(GAMEPERM) $(GAMEDIR)/$(GAME)
186 chmod $(EXEPERM) $(GAMEDIR)/recover
187 -$(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME)
188 $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME)
189 chmod $(EXEPERM) $(SHELLDIR)/$(GAME)
190
191 dofiles-dlb: check-dlb
192 ( cd dat ; cp nhdat $(DATNODLB) $(GAMEDIR) )
193 # set up their permissions
194 -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) nhdat $(DATNODLB) ; \
195 $(CHGRP) $(GAMEGRP) nhdat $(DATNODLB) ; \
196 chmod $(FILEPERM) nhdat $(DATNODLB) )
197
198 dofiles-nodlb:
199 # copy over the game files
200 ( cd dat ; cp $(DAT) $(GAMEDIR) )
201 # set up their permissions
202 -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(DAT) ; \
203 $(CHGRP) $(GAMEGRP) $(DAT) ; \
204 chmod $(FILEPERM) $(DAT) )
205
206 update: $(GAME) recover $(VARDAT) dungeon spec_levs
207 # (don't yank the old version out from under people who're playing it)
208 -mv $(GAMEDIR)/$(GAME) $(GAMEDIR)/$(GAME).old
209 # quest.dat is also kept open and has the same problems over NFS
210 # (quest.dat may be inside nhdat if dlb is in use)
211 -mv $(GAMEDIR)/quest.dat $(GAMEDIR)/quest.dat.old
212 -mv $(GAMEDIR)/nhdat $(GAMEDIR)/nhdat.old
213 # set up new versions of the game files
214 ( $(MAKE) dofiles )
215 # touch time-sensitive files
216 -touch -c $(VARDIR)/bones* $(VARDIR)/?lock* $(VARDIR)/wizard*
217 -touch -c $(VARDIR)/save/*
218 touch $(VARDIR)/perm $(VARDIR)/record
219 # and a reminder
220 @echo You may also want to install the man pages via the doc Makefile.
221
222 install: $(GAME) recover $(VARDAT) dungeon spec_levs
223 # set up the directories
224 # not all mkdirs have -p; those that don't will create a -p directory
225 -mkdir -p $(SHELLDIR)
226 -rm -rf $(GAMEDIR) $(VARDIR)
227 -mkdir -p $(GAMEDIR) $(VARDIR) $(VARDIR)/save
228 -rmdir ./-p
229 -$(CHOWN) $(GAMEUID) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
230 $(CHGRP) $(GAMEGRP) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
231 chmod $(DIRPERM) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
232 # set up the game files
233 ( $(MAKE) dofiles )
234 # set up some additional files
235 touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile
236 -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile ; \
237 $(CHGRP) $(GAMEGRP) perm record logfile ; \
238 chmod $(FILEPERM) perm record logfile )
239 # and a reminder
240 @echo You may also want to reinstall the man pages via the doc Makefile.
241
242
243 # 'make clean' removes all the .o files, but leaves around all the executables
244 # and compiled data files
245 clean:
246 ( cd src ; $(MAKE) clean )
247 ( cd util ; $(MAKE) clean )
248
249 # 'make spotless' returns the source tree to near-distribution condition.
250 # it removes .o files, executables, and compiled data files
251 spotless:
252 ( cd src ; $(MAKE) spotless )
253 ( cd util ; $(MAKE) spotless )
254 ( cd dat ; $(MAKE) spotless )
255 ( cd doc ; $(MAKE) spotless )
Something went wrong with that request. Please try again.