2 # NetHack 3.6 macosx10.5 $NHDT-Date: 1546082882 2018/12/29 11:28:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.30 $
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.5.3 (Darwin 9.3). If this doesn't work for some
9 # other version of either Darwin or Mac OS X, make a new file for that OS,
10 # don't change this one. And 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
55 #CC=gcc -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
56 CC=gcc -Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic -Wno-long-long
59 # You shouldn't need to change anything below here.
62 # XXX -g vs -O should go here, -I../include goes in the makefile
63 CFLAGS=-g -I../include
64 CFLAGS+=-DNOCLIPPING -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
65 CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
67 CFLAGS+= -DGREPPATH=\"/usr/bin/grep\"
75 CFLAGS += -DNOTTYGRAPHICS
79 WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
80 VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
81 POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir);
82 CFLAGS += -DX11_GRAPHICS
88 WINSRC += $(WINX11SRC)
89 WINOBJ += $(WINX11OBJ)
90 WINLIB += $(WINX11LIB)
91 LFLAGS=-L/usr/X11R6/lib
95 CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
96 CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
99 WINLIB += $(WINQTLIB) $(LIBXPM)
100 WINLIB += -framework Carbon -framework QuickTime -lz -framework OpenGL
101 WINLIB += -framework AGL
103 # prevent duplicate tile.o in WINOBJ
104 WINOBJ = $(sort $(WINQTOBJ) $(WINX11OBJ))
106 WINOBJ += $(WINTTYOBJ)
109 WINOBJ += $(WINQTOBJ)
110 endif # !WANT_WIN_X11
112 # XXX if /Developer/qt exists and QTDIR not set, use that
114 $(error QTDIR not defined in the environment or Makefile)
116 # XXX make sure QTDIR points to something reasonable
121 ifdef WANT_SHARE_INSTALL
122 # if $GAMEUID is root, we install into roughly proper Mac locations, otherwise
123 # we install into ~/nethackdir
124 ifeq ($(GAMEUID),root)
125 PREFIX:=/Library/NetHack
126 SHELLDIR=/usr/local/bin
127 HACKDIR=$(PREFIX)/nethackdir
132 # We run sgid so the game has access to both HACKDIR and user preferences.
135 PREFIX:=/Users/$(GAMEUID)
136 SHELLDIR=$(PREFIX)/bin
137 HACKDIR=$(PREFIX)/nethackdir
146 ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
147 # XXX it's nice we don't write over sysconf, but we've already erased it
148 # make sure we have group GAMEUID and group GAMEGRP
149 PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
150 POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
151 CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
152 else ifdef WANT_SOURCE_INSTALL
153 PREFIX=$(abspath $(NHSROOT))
154 # suppress nethack.sh"
156 HACKDIR=$(PREFIX)/playground
164 # We can use "make all" to build the whole thing - but it misses some things:
165 MOREALL=$(MAKE) install
166 else # !WANT_SOURCE_INSTALL
167 PREFIX:=$(wildcard ~)
168 SHELLDIR=$(PREFIX)/bin
169 HACKDIR=$(PREFIX)/nethackdir
178 # install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
179 PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc
181 POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
182 CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
183 endif # !WANT_SOURCE_INSTALL
186 # ~/Library/Preferences/NetHack Defaults
187 # OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
188 # OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
190 # Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
191 # package under the docs directory).
199 # 1) The Apple developer utilities must be installed in the default location.
200 # 2) Do a normal build before trying to package the game.
201 # 3) This matches the 3.4.3 Term package, but there are some things that should
205 DEVUTIL=/Developer/Applications/Utilities
206 PKGR=$(DEVUTIL)/PackageMaker.app/Contents/MacOS/PackageMaker
207 SVS=$(shell $(NHSROOT)/util/makedefs --svs)
208 SVSDOT=$(shell $(NHSROOT)/util/makedefs --svs .)
210 PKGROOT_UG = PKGROOT/usr/games
211 PKGROOT_UGLN = PKGROOT/usr/games/lib/nethackdir
213 ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT))
214 -echo build_tty_pkg only works for a tty-only build
217 rm -rf NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
218 $(MAKE) build_package_root
221 #enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf
222 sys/unix/hints/macosx.sh descplist > RESOURCES/Description.plist
223 sys/unix/hints/macosx.sh infoplist > Info.plist
225 mkdir PKGROOT/Applications
226 #osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
227 # win/macosx/NetHackRecover.applescript
228 #cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
229 osacompile -o PKGROOT/Applications/NetHackRecover.app \
230 win/macosx/NetHackRecover.applescript
231 cp win/macosx/recover.pl $(PKGROOT_UGLN)
233 osacompile -o PKGROOT/Applications/NetHackTerm.app \
234 win/macosx/NetHackTerm.applescript
236 # XXX integrate into Makefile.doc
237 (cd doc; cat Guidebook.mn | ../util/makedefs --grep --input - --output - \
238 | tbl tmac.n - | groff |ps2pdf - > Guidebook.pdf)
239 cp doc/Guidebook.pdf $(PKGROOT_UG)/doc/NetHackGuidebook.pdf
241 osacompile -o PKGROOT/Applications/NetHackGuidebook.app \
242 win/macosx/NetHackGuidebook.applescript
244 $(PKGR) --root PKGROOT --info Info.plist -e RESOURCES -v -o NetHack-$(SVS)-mac-Term.pkg
245 hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
248 cd src/.. # make sure we are at TOP
250 mkdir -p $(PKGROOT_UG)/lib $(PKGROOT_UG)/bin $(PKGROOT_UG)/man/man6 $(PKGROOT_UG)/doc $(PKGROOT_UGLN)
251 install -p src/nethack $(PKGROOT_UG)/bin
252 # XXX should this be called nethackrecover?
253 install -p util/recover $(PKGROOT_UG)/bin
254 install -p doc/nethack.6 $(PKGROOT_UG)/man/man6
255 install -p doc/recover.6 $(PKGROOT_UG)/man/man6
256 install -p doc/Guidebook $(PKGROOT_UG)/doc
257 install -p dat/nhdat $(PKGROOT_UGLN)
258 cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
259 # XXX these files should be somewhere else for good Mac form
260 touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile
261 # XXX may need postinstall script to get perms right for sgid, etc.
262 mkdir $(PKGROOT_UGLN)/save
263 # XXX what about a news file?
264 endif # end of build_tty_pkg
265 endif # WANT_WIN_TTY for packaging
268 # XXX untested and incomplete (see below)
270 ifneq (,$(WANT_WIN_X11)$(WANT_WIN_TTY))
271 -echo build_qt_pkg only works for a qt-only build
274 $(MAKE) build_package_root
276 mkdir -p NetHackQt/NetHackQt.app/nethackdir/save
277 mkdir NetHackQt/Documentation
278 cp doc/Guidebook.txt doc/nethack.txt doc/recover.txt NetHackQt/Documentation
280 osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
281 win/macosx/NetHackRecover.applescript
282 cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
284 mkdir -p NetHackQt/NetHackQt.app/Contents/Frameworks
285 cp $(QTDIR)/libqt-mt.3.dylib NetHackQt/NetHackQt.app/Contents/Frameworks
287 mkdir NetHackQt/NetHackQt.app/Contents/MacOS
288 mv PKGROOT/nethack NetHackQt/NetHackQt.app/Contents/MacOS
290 mv PKGROOT/lib/nethackdir NetHackQt/NetHackQt.app/nethackdir
293 #NetHackQt/NetHackQt.app
296 # Resources/nethack.icns
297 #NetHackQt/Documentation
298 #NetHackQtRecover.txt
299 #NetHack Defaults.txt
300 #changes.patch XXX is this still needed? why isn't it part of the tree?
302 hdiutil create -verbose -srcfolder NetHackQt NetHack-$(SVS)-macosx-qt.dmg
303 endif # end of build_qt_pkg
304 endif # WANT_WIN_QT for packaging