2 # aNetHack 0.0.1 Makefile.top $ANH-Date: 1465114189 2016/06/05 08:09:49 $ $ANH-Branch: master $:$ANH-Revision: 1.35 $
7 # newer makes predefine $(MAKE) to 'make' and do smarter processing of
8 # recursive make calls if $(MAKE) is used
9 # these makes allow $(MAKE) to be overridden by the environment if someone
10 # wants to (or has to) use something other than the standard make, so we do
11 # not want to unconditionally set $(MAKE) here
13 # unfortunately, some older makes do not predefine $(MAKE); if you have one of
14 # these, uncomment the following line
15 # (you will know that you have one if you get complaints about unable to
16 # execute things like 'data' and 'rumors')
26 # Permissions - some places use setgid instead of setuid, for instance
27 # See also the option "SECURE" in include/config.h
35 # VARDIR may also appear in unixconf.h as "VAR_PLAYGROUND" else HACKDIR
37 # note that 'make install' believes in creating a nice tidy HACKDIR for
38 # installation, free of debris from previous aNetHack versions --
39 # therefore there should not be anything in HACKDIR that you want to keep
40 # (if there is, you'll have to do the installation by hand or modify the
42 #HACKDIR = $(PREFIX)/games/lib/$(GAME)dir
44 # Where anethack.sh in installed. If this is not defined, the wrapper is not used.
45 #SHELLDIR = $(PREFIX)/games
47 # per discussion in Install.X11 and Install.Qt
49 # VARDATND = x11tiles aNetHack.ad pet_mark.xbm pilemark.xbm
50 # VARDATND = x11tiles aNetHack.ad pet_mark.xbm pilemark.xbm rip.xpm
52 # VARDATND = nh16.img title.img GEM_RSC.RSC rip.img
54 # VARDATND = beostiles
56 # VARDATND = x11tiles pet_mark.xbm pilemark.xbm rip.xpm mapbg.xpm
58 VARDATD = bogusmon data engrave epitaph oracles options quest.dat rumors
59 VARDAT = $(VARDATD) $(VARDATND)
61 # Some versions of make use the SHELL environment variable as the shell
62 # for running commands. We need this to be a Bourne shell.
65 # SHELL=E:/GEMINI2/MUPFEL.TTP
67 # Commands for setting the owner and group on files during installation.
68 # Some systems fail with one or the other when installing over NFS or for
69 # other permission-related reasons. If that happens, you may want to set the
70 # command to "true", which is a no-op. Note that disabling chown or chgrp
71 # will only work if setuid (or setgid) behavior is not desired or required.
76 # end of configuration
79 DATHELP = help hh cmdhelp keyhelp history opthelp wizhelp
81 SPEC_LEVS = asmodeus.lev baalz.lev bigrm-*.lev castle.lev fakewiz?.lev \
82 juiblex.lev knox.lev medusa-?.lev minend-?.lev minefill.lev \
83 minetn-?.lev oracle.lev orcus.lev sanctum.lev soko?-?.lev \
84 tower?.lev valley.lev wizard?.lev \
85 astral.lev air.lev earth.lev fire.lev water.lev
86 QUEST_LEVS = ???-goal.lev ???-fil?.lev ???-loca.lev ???-strt.lev
88 DATNODLB = $(VARDATND) license symbols
89 DATDLB = $(DATHELP) dungeon tribute $(SPEC_LEVS) $(QUEST_LEVS) $(VARDATD)
90 DAT = $(DATNODLB) $(DATDLB)
95 all: $(GAME) recover Guidebook $(VARDAT) dungeon spec_levs check-dlb
99 # Note: many of the dependencies below are here to allow parallel make
100 # to generate valid output
103 ( cd doc ; $(MAKE) Guidebook )
106 ( cd doc ; $(MAKE) manpages )
109 ( cd dat ; $(MAKE) data )
112 ( cd dat ; $(MAKE) engrave )
115 ( cd dat ; $(MAKE) bogusmon )
118 ( cd dat ; $(MAKE) epitaph )
121 ( cd dat ; $(MAKE) rumors )
124 ( cd dat ; $(MAKE) oracles )
126 # Note: options should have already been made with make, but...
128 ( cd dat ; $(MAKE) options )
131 ( cd dat ; $(MAKE) quest.dat )
134 ( cd util ; $(MAKE) lev_comp )
135 ( cd dat ; $(MAKE) spec_levs )
136 ( cd dat ; $(MAKE) quest_levs )
139 ( cd util ; $(MAKE) dgn_comp )
140 ( cd dat ; $(MAKE) dungeon )
143 ( cd dat ; $(MAKE) nhtiles.bmp )
146 ( cd util ; $(MAKE) tile2x11 )
147 ( cd dat ; $(MAKE) x11tiles )
150 ( cd util ; $(MAKE) tile2beos )
151 ( cd dat ; $(MAKE) beostiles )
154 ( cd dat ; $(MAKE) aNetHack.ad )
157 ( cd dat ; $(MAKE) pet_mark.xbm )
160 ( cd dat ; $(MAKE) pilemark.xbm )
163 ( cd dat ; $(MAKE) rip.xpm )
166 (cd dat ; $(MAKE) mapbg.xpm )
169 ( cd dat ; $(MAKE) nhsplash.xpm )
172 ( cd util ; $(MAKE) tile2img.ttp )
173 ( cd dat ; $(MAKE) nh16.img )
176 ( cd util ; $(MAKE) xpm2img.ttp )
177 ( cd dat ; $(MAKE) rip.img )
179 ( cd dat ; $(MAKE) GEM_RSC.RSC )
182 ( cd dat ; $(MAKE) title.img )
185 @if egrep -s librarian dat/options ; then $(MAKE) dlb ; else true ; fi
188 ( cd util ; $(MAKE) dlb )
189 ( cd dat ; LC_ALL=C ; ../util/dlb cf anhdat $(DATDLB) )
191 # recover can be used when INSURANCE is defined in include/config.h
192 # and the checkpoint option is true
194 ( cd util ; $(MAKE) recover )
202 -e '$$s/.*/nodlb/p' < dat/options` ; \
203 $(MAKE) dofiles-$${target-nodlb}
204 cp src/$(GAME) $(INSTDIR)
205 cp util/recover $(INSTDIR)
206 -if test -n '$(SHELLDIR)'; then rm -f $(SHELLDIR)/$(GAME); fi
207 if test -n '$(SHELLDIR)'; then \
208 sed -e 's;/usr/games/lib/anethackdir;$(HACKDIR);' \
209 -e 's;HACKDIR/anethack;HACKDIR/$(GAME);' \
210 < sys/unix/anethack.sh \
211 > $(SHELLDIR)/$(GAME) ; fi
212 # set up their permissions
213 -( cd $(INSTDIR) ; $(CHOWN) $(GAMEUID) $(GAME) recover ; \
214 $(CHGRP) $(GAMEGRP) $(GAME) recover )
215 chmod $(GAMEPERM) $(INSTDIR)/$(GAME)
216 chmod $(EXEPERM) $(INSTDIR)/recover
217 -if test -n '$(SHELLDIR)'; then \
218 $(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME); fi
219 if test -n '$(SHELLDIR)'; then \
220 $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME); \
221 chmod $(EXEPERM) $(SHELLDIR)/$(GAME); fi
223 dofiles-dlb: check-dlb
224 ( cd dat ; cp anhdat $(DATNODLB) $(INSTDIR) )
225 # set up their permissions
226 -( cd $(INSTDIR) ; $(CHOWN) $(GAMEUID) anhdat $(DATNODLB) ; \
227 $(CHGRP) $(GAMEGRP) anhdat $(DATNODLB) ; \
228 chmod $(FILEPERM) anhdat $(DATNODLB) )
231 # copy over the game files
232 ( cd dat ; cp $(DAT) $(INSTDIR) )
233 # set up their permissions
234 -( cd $(INSTDIR) ; $(CHOWN) $(GAMEUID) $(DAT) ; \
235 $(CHGRP) $(GAMEGRP) $(DAT) ; \
236 chmod $(FILEPERM) $(DAT) )
238 update: $(GAME) recover $(VARDAT) dungeon spec_levs
239 # (don't yank the old version out from under people who're playing it)
240 -mv $(INSTDIR)/$(GAME) $(INSTDIR)/$(GAME).old
241 # quest.dat is also kept open and has the same problems over NFS
242 # (quest.dat may be inside anhdat if dlb is in use)
243 -mv $(INSTDIR)/quest.dat $(INSTDIR)/quest.dat.old
244 -mv $(INSTDIR)/anhdat $(INSTDIR)/anhdat.old
245 # set up new versions of the game files
247 # touch time-sensitive files
248 -touch -c $(VARDIR)/bones* $(VARDIR)/?lock* $(VARDIR)/wizard*
249 -touch -c $(VARDIR)/save/*
250 touch $(VARDIR)/perm $(VARDIR)/record
252 @echo You may also want to install the man pages via the doc Makefile.
257 install: rootcheck $(GAME) recover $(VARDAT) dungeon spec_levs
259 # set up the directories
260 # not all mkdirs have -p; those that don't will create a -p directory
261 -if test -n '$(SHELLDIR)'; then \
262 mkdir -p $(SHELLDIR); fi
263 rm -rf $(INSTDIR) $(VARDIR)
264 -mkdir -p $(INSTDIR) $(VARDIR) $(VARDIR)/save
265 if test -d ./-p; then rmdir ./-p; fi
266 -$(CHOWN) $(GAMEUID) $(INSTDIR) $(VARDIR) $(VARDIR)/save
267 $(CHGRP) $(GAMEGRP) $(INSTDIR) $(VARDIR) $(VARDIR)/save
269 chmod $(DIRPERM) $(INSTDIR)
270 chmod $(VARDIRPERM) $(VARDIR) $(VARDIR)/save
271 # set up the game files
273 # set up some additional files
274 touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile $(VARDIR)/xlogfile
275 -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile xlogfile ; \
276 $(CHGRP) $(GAMEGRP) perm record logfile xlogfile ; \
277 chmod $(VARFILEPERM) perm record logfile xlogfile )
280 @echo You may also want to reinstall the man pages via the doc Makefile.
283 # 'make clean' removes all the .o files, but leaves around all the executables
284 # and compiled data files
286 ( cd src ; $(MAKE) clean )
287 ( cd util ; $(MAKE) clean )
288 ( cd doc ; $(MAKE) clean )
290 # 'make spotless' returns the source tree to near-distribution condition.
291 # it removes .o files, executables, and compiled data files
293 ( cd src ; $(MAKE) spotless )
294 ( cd util ; $(MAKE) spotless )
295 ( cd dat ; $(MAKE) spotless )
296 ( cd doc ; $(MAKE) spotless )