2 # NetHack 3.6 macosx10.7 $NHDT-Date: 1546082882 2018/12/29 11:28:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.34 $
3 # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009.
4 # NetHack may be freely redistributed. See license for details.
7 # Mac OS X (Darwin) hints file
8 # This is for Mac OS X 10.7.2. If this doesn't work for some other version
9 # of Mac OS X, make a new file for that OS, don't change this one. And
10 # let us know about it.
11 # Useful info: http://www.opensource.apple.com/darwinsource/index.html
13 # This hints file can build several different types of installations.
14 # Edit the next section to match the type of build you need.
16 # 1. Which window system(s) should be included in this binary?
21 # 1a. What is the default window system?
26 # 1b. If you set WANT_WIN_QT, you need to
27 # A) set QTDIR either here or in the environment to point to the Qt2 or Qt3
28 # library installation root. (Qt4 will not work; Qt3 does not presently
29 # compile under Leopard (MacOSX 10.5) out-of-the-box.)
30 # B) set XPMLIB to point to the Xpm library
33 LIBXPM= -L/Developer/SDKs/MacOSX10.3.9.sdk/usr/X11R6/lib -lXpm
36 # 2. Is this a build for a binary that will be shared among different users
37 # or will it be private to you?
39 # - it will be owned by the user and group listed
40 # - if the user does not exist, you MUST create it before installing
42 # - if the group does not exist, it will be created.
43 # NB: if the group already exists and is being used for something
44 # besides games, you probably want to specify a new group instead
45 # NB: the group will be created locally; if your computer is centrally
46 # administered this may not be what you (or your admin) want.
47 # Consider a non-shared install (WANT_SHARE_INSTALL=0) instead.
48 # - 'make install' must be run as "sudo make install"
52 # build to run in the source tree - primarily for development. Build with "make all"
53 #WANT_SOURCE_INSTALL=1
57 # At the moment this is just for debugging, but in the future it could be
58 # useful for other things. Requires SYSCF and an ANSI compiler.
62 # You shouldn't need to change anything below here.
65 #CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
66 CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic -Wno-long-long
67 # As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
68 # leave it out by default.
69 #CFLAGS+=-Wunreachable-code
71 # XXX -g vs -O should go here, -I../include goes in the makefile
72 CFLAGS+=-g -I../include
73 # older binaries use NOCLIPPING, but that disables SIGWINCH
75 CFLAGS+= -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
76 CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
78 CFLAGS+= -DGREPPATH=\"/usr/bin/grep\"
92 CFLAGS += -DNOTTYGRAPHICS
96 WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
97 VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
98 POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir);
99 CFLAGS += -DX11_GRAPHICS
105 WINSRC += $(WINX11SRC)
106 WINOBJ += $(WINX11OBJ)
107 WINLIB += $(WINX11LIB)
108 LFLAGS=-L/usr/X11R6/lib
112 CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
113 CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
115 WINSRC += $(WINQTSRC)
116 WINLIB += $(WINQTLIB) $(LIBXPM)
117 WINLIB += -framework Carbon -framework QuickTime -lz -framework OpenGL
118 WINLIB += -framework AGL
120 # prevent duplicate tile.o in WINOBJ
121 WINOBJ = $(sort $(WINQTOBJ) $(WINX11OBJ))
123 WINOBJ += $(WINTTYOBJ)
126 WINOBJ += $(WINQTOBJ)
127 endif # !WANT_WIN_X11
129 # XXX if /Developer/qt exists and QTDIR not set, use that
131 $(error QTDIR not defined in the environment or Makefile)
133 # XXX make sure QTDIR points to something reasonable
138 ifdef WANT_SHARE_INSTALL
139 # if $GAMEUID is root, we install into roughly proper Mac locations, otherwise
140 # we install into ~/nethackdir
141 ifeq ($(GAMEUID),root)
142 PREFIX:=/Library/NetHack
143 SHELLDIR=/usr/local/bin
144 HACKDIR=$(PREFIX)/nethackdir
149 # We run sgid so the game has access to both HACKDIR and user preferences.
152 PREFIX:=/Users/$(GAMEUID)
153 SHELLDIR=$(PREFIX)/bin
154 HACKDIR=$(PREFIX)/nethackdir
163 ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
164 # XXX it's nice we don't write over sysconf, but we've already erased it
165 # make sure we have group GAMEUID and group GAMEGRP
166 PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
167 POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
168 CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
169 else ifdef WANT_SOURCE_INSTALL
170 PREFIX=$(abspath $(NHSROOT))
171 # suppress nethack.sh
173 HACKDIR=$(PREFIX)/playground
181 # We can use "make all" to build the whole thing - but it misses some things:
182 MOREALL=$(MAKE) install
183 CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
184 else # !WANT_SOURCE_INSTALL
185 PREFIX:=$(wildcard ~)
186 SHELLDIR=$(PREFIX)/bin
187 HACKDIR=$(PREFIX)/nethackdir
196 # install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
197 PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc
199 POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
200 CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
201 endif # !WANT_SOURCE_INSTALL
204 # ~/Library/Preferences/NetHack Defaults
205 # OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
206 # OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
208 # Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
209 # package under the docs directory).
217 # 1) The Apple developer utilities must be installed in the default location.
218 # 2) Do a normal build before trying to package the game.
219 # 3) This matches the 3.4.3 Term package, but there are some things that should
223 DEVUTIL=/Developer/Applications/Utilities
224 PKGR=$(DEVUTIL)/PackageMaker.app/Contents/MacOS/PackageMaker
225 SVS=$(shell $(NHSROOT)/util/makedefs --svs)
226 SVSDOT=$(shell $(NHSROOT)/util/makedefs --svs .)
228 PKGROOT_UG = PKGROOT/usr/games
229 PKGROOT_UGLN = PKGROOT/usr/games/lib/nethackdir
231 ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT))
232 -echo build_tty_pkg only works for a tty-only build
235 rm -rf NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
236 $(MAKE) build_package_root
239 #enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf
240 sys/unix/hints/macosx.sh descplist > RESOURCES/Description.plist
241 sys/unix/hints/macosx.sh infoplist > Info.plist
243 mkdir PKGROOT/Applications
244 #osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
245 # win/macosx/NetHackRecover.applescript
246 #cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
247 osacompile -o PKGROOT/Applications/NetHackRecover.app \
248 win/macosx/NetHackRecover.applescript
249 cp win/macosx/recover.pl $(PKGROOT_UGLN)
251 osacompile -o PKGROOT/Applications/NetHackTerm.app \
252 win/macosx/NetHackTerm.applescript
254 # XXX integrate into Makefile.doc
255 (cd doc; cat Guidebook.mn | ../util/makedefs --grep --input - --output - \
256 | tbl tmac.n - | groff |ps2pdf - > Guidebook.pdf)
257 cp doc/Guidebook.pdf $(PKGROOT_UG)/doc/NetHackGuidebook.pdf
259 osacompile -o PKGROOT/Applications/NetHackGuidebook.app \
260 win/macosx/NetHackGuidebook.applescript
262 $(PKGR) --root PKGROOT --info Info.plist -e RESOURCES -v -o NetHack-$(SVS)-mac-Term.pkg
263 hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
266 cd src/.. # make sure we are at TOP
268 mkdir -p $(PKGROOT_UG)/lib $(PKGROOT_UG)/bin $(PKGROOT_UG)/man/man6 $(PKGROOT_UG)/doc $(PKGROOT_UGLN)
269 install -p src/nethack $(PKGROOT_UG)/bin
270 # XXX should this be called nethackrecover?
271 install -p util/recover $(PKGROOT_UG)/bin
272 install -p doc/nethack.6 $(PKGROOT_UG)/man/man6
273 install -p doc/recover.6 $(PKGROOT_UG)/man/man6
274 install -p doc/Guidebook $(PKGROOT_UG)/doc
275 install -p dat/nhdat $(PKGROOT_UGLN)
276 cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
277 # XXX these files should be somewhere else for good Mac form
278 touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile
279 # XXX may need postinstall script to get perms right for sgid, etc.
280 mkdir $(PKGROOT_UGLN)/save
281 # XXX what about a news file?
282 endif # end of build_tty_pkg
283 endif # WANT_WIN_TTY for packaging
286 # XXX untested and incomplete (see below)
288 ifneq (,$(WANT_WIN_X11)$(WANT_WIN_TTY))
289 -echo build_qt_pkg only works for a qt-only build
292 $(MAKE) build_package_root
294 mkdir -p NetHackQt/NetHackQt.app/nethackdir/save
295 mkdir NetHackQt/Documentation
296 cp doc/Guidebook.txt doc/nethack.txt doc/recover.txt NetHackQt/Documentation
298 osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
299 win/macosx/NetHackRecover.applescript
300 cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
302 mkdir -p NetHackQt/NetHackQt.app/Contents/Frameworks
303 cp $(QTDIR)/libqt-mt.3.dylib NetHackQt/NetHackQt.app/Contents/Frameworks
305 mkdir NetHackQt/NetHackQt.app/Contents/MacOS
306 mv PKGROOT/nethack NetHackQt/NetHackQt.app/Contents/MacOS
308 mv PKGROOT/lib/nethackdir NetHackQt/NetHackQt.app/nethackdir
311 #NetHackQt/NetHackQt.app
314 # Resources/nethack.icns
315 #NetHackQt/Documentation
316 #NetHackQtRecover.txt
317 #NetHack Defaults.txt
318 #changes.patch XXX is this still needed? why isn't it part of the tree?
320 hdiutil create -verbose -srcfolder NetHackQt NetHack-$(SVS)-macosx-qt.dmg
321 endif # end of build_qt_pkg
322 endif # WANT_WIN_QT for packaging