Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2018-11-28 20:04:07 -05:00
43 changed files with 1603 additions and 726 deletions

View File

@@ -1,5 +1,5 @@
# NetHack Makefile.
# NetHack 3.6 Makefile.src $NHDT-Date: 1539968067 2018/10/19 16:54:27 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.58 $
# NetHack 3.6 Makefile.src $NHDT-Date: 1543447374 2018/11/28 23:22:54 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.60 $
# Copyright (c) 2018 by Pasi Kallinen
# NetHack may be freely redistributed. See license for details.
@@ -462,7 +462,7 @@ SYSCXXSRC = ../sys/share/cppregex.cpp
GENCSRC = vis_tab.c #tile.c
# all windowing-system-dependent .c (for dependencies and such)
WINCSRC = $(WINTTYSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC)
WINCSRC = $(WINTTYSRC) $(WINCURSESSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC)
# all windowing-system-dependent .cpp (for dependencies and such)
WINCXXSRC = $(WINQTSRC) $(WINQT4SRC) $(WINBESRC)
@@ -775,36 +775,38 @@ topl.o: ../win/tty/topl.c $(HACK_H) ../include/tcap.h
$(CC) $(CFLAGS) -c ../win/tty/topl.c
wintty.o: ../win/tty/wintty.c $(HACK_H) ../include/dlb.h ../include/tcap.h
$(CC) $(CFLAGS) -c ../win/tty/wintty.c
cursmain.o: ../win/curses/cursmain.c $(HACK_H) ../include/wincurs.h
cursmain.o: ../win/curses/cursmain.c $(HACK_H) ../include/patchlevel.h \
../include/wincurs.h
$(CC) $(CFLAGS) -c ../win/curses/cursmain.c
curswins.o: ../win/curses/curswins.c $(HACK_H) ../include/func_tab.h \
../include/wincurs.h ../win/curses/curswins.h
curswins.o: ../win/curses/curswins.c $(HACK_H) ../include/wincurs.h \
../win/curses/curswins.h
$(CC) $(CFLAGS) -c ../win/curses/curswins.c
cursmisc.o: ../win/curses/cursmisc.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursmisc.h
../win/curses/cursmisc.h ../include/func_tab.h ../include/dlb.h
$(CC) $(CFLAGS) -c ../win/curses/cursmisc.c
cursdial.o: ../win/curses/cursdial.c $(HACK_H) ../include/func_tab.h \
../include/wincurs.h ../win/curses/cursdial.h
cursdial.o: ../win/curses/cursdial.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursdial.h ../include/func_tab.h
$(CC) $(CFLAGS) -c ../win/curses/cursdial.c
cursstat.o: ../win/curses/cursstat.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursstat.h
$(CC) $(CFLAGS) -c ../win/curses/cursstat.c
cursinit.o: ../win/curses/cursinit.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursinit.h
../win/curses/cursinit.h ../include/patchlevel.h
$(CC) $(CFLAGS) -c ../win/curses/cursinit.c
cursinvt.o: ../win/curses/cursinvt.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursinvt.h
$(CC) $(CFLAGS) -c ../win/curses/cursinvt.c
cursmesg.o: ../win/curses/cursmesg.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursmesg.h
$(CC) $(CFLAGS) -c ../win/curses/cursmesg.c
cursinvt.o: ../win/curses/cursinvt.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursinvt.h
$(CC) $(CFLAGS) -c ../win/curses/cursinvt.c
Window.o: ../win/X11/Window.c ../include/xwindowp.h ../include/xwindow.h \
$(CONFIG_H) ../include/lint.h
$(CC) $(CFLAGS) -c ../win/X11/Window.c
dialogs.o: ../win/X11/dialogs.c $(CONFIG_H) ../include/lint.h
$(CC) $(CFLAGS) -c ../win/X11/dialogs.c
winX.o: ../win/X11/winX.c $(HACK_H) ../include/winX.h ../include/dlb.h \
../win/X11/nh72icon ../win/X11/nh56icon ../win/X11/nh32icon
../include/xwindow.h ../win/X11/nh72icon ../win/X11/nh56icon \
../win/X11/nh32icon
$(CC) $(CFLAGS) -c ../win/X11/winX.c
winmap.o: ../win/X11/winmap.c ../include/xwindow.h $(HACK_H) ../include/dlb.h \
../include/winX.h ../include/tile2x11.h
@@ -816,7 +818,7 @@ winmesg.o: ../win/X11/winmesg.c ../include/xwindow.h $(HACK_H) ../include/winX.h
winmisc.o: ../win/X11/winmisc.c $(HACK_H) ../include/func_tab.h \
../include/winX.h
$(CC) $(CFLAGS) -c ../win/X11/winmisc.c
winstat.o: ../win/X11/winstat.c $(HACK_H) ../include/winX.h
winstat.o: ../win/X11/winstat.c $(HACK_H) ../include/winX.h ../include/xwindow.h
$(CC) $(CFLAGS) -c ../win/X11/winstat.c
wintext.o: ../win/X11/wintext.c $(HACK_H) ../include/winX.h ../include/xwindow.h
$(CC) $(CFLAGS) -c ../win/X11/wintext.c
@@ -887,51 +889,82 @@ qt_clust.o: ../win/Qt/qt_clust.cpp ../include/qt_clust.h
$(CXX) $(CXXFLAGS) -c ../win/Qt/qt_clust.cpp
qttableview.o: ../win/Qt/qttableview.cpp ../include/qttableview.h
$(CXX) $(CXXFLAGS) -c ../win/Qt/qttableview.cpp
qt4bind.o : ../win/Qt4/qt4bind.cpp $(HACK_H) ../win/Qt4/qt4bind.h
qt4bind.o: ../win/Qt4/qt4bind.cpp $(HACK_H) ../win/Qt4/qt4bind.h \
../win/Qt4/qt4click.h ../win/Qt4/qt4delay.h \
../win/Qt4/qt4xcmd.h ../win/Qt4/qt4key.h ../win/Qt4/qt4map.h \
../win/Qt4/qt4menu.h ../win/Qt4/qt4msg.h ../win/Qt4/qt4plsel.h \
../win/Qt4/qt4svsel.h ../win/Qt4/qt4set.h ../win/Qt4/qt4stat.h \
../win/Qt4/qt4streq.h ../win/Qt4/qt4yndlg.h \
../win/Qt4/qt4str.h ../include/dlb.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4bind.cpp
qt4click.o : ../win/Qt4/qt4click.cpp $(HACK_H) ../win/Qt4/qt4click.h
qt4click.o: ../win/Qt4/qt4click.cpp $(HACK_H) ../win/Qt4/qt4click.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4click.cpp
qt4clust.o : ../win/Qt4/qt4clust.cpp $(HACK_H) ../win/Qt4/qt4clust.h
qt4clust.o: ../win/Qt4/qt4clust.cpp ../win/Qt4/qt4clust.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4clust.cpp
qt4delay.o : ../win/Qt4/qt4delay.cpp $(HACK_H) ../win/Qt4/qt4delay.h
qt4delay.o: ../win/Qt4/qt4delay.cpp $(HACK_H) ../win/Qt4/qt4delay.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4delay.cpp
qt4glyph.o : ../win/Qt4/qt4glyph.cpp $(HACK_H) ../win/Qt4/qt4glyph.h
qt4glyph.o: ../win/Qt4/qt4glyph.cpp $(HACK_H) ../include/tile2x11.h \
../win/Qt4/qt4glyph.h ../win/Qt4/qt4set.h ../win/Qt4/qt4str.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4glyph.cpp
qt4icon.o : ../win/Qt4/qt4icon.cpp $(HACK_H) ../win/Qt4/qt4icon.h
qt4icon.o: ../win/Qt4/qt4icon.cpp $(HACK_H) ../win/Qt4/qt4icon.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4icon.cpp
qt4inv.o : ../win/Qt4/qt4inv.cpp $(HACK_H) ../win/Qt4/qt4inv.h
qt4inv.o: ../win/Qt4/qt4inv.cpp $(HACK_H) ../win/Qt4/qt4inv.h \
../win/Qt4/qt4glyph.h ../win/Qt4/qt4set.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4inv.cpp
qt4key.o : ../win/Qt4/qt4key.cpp $(HACK_H) ../win/Qt4/qt4key.h
qt4key.o: ../win/Qt4/qt4key.cpp $(HACK_H) ../win/Qt4/qt4key.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4key.cpp
qt4line.o : ../win/Qt4/qt4line.cpp $(HACK_H) ../win/Qt4/qt4line.h
qt4line.o: ../win/Qt4/qt4line.cpp $(HACK_H) ../win/Qt4/qt4line.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4line.cpp
qt4main.o : ../win/Qt4/qt4main.cpp $(HACK_H) qt4main.moc ../win/Qt4/qt4main.h qt4kde0.moc
qt4main.o: ../win/Qt4/qt4main.cpp $(HACK_H) ../include/patchlevel.h \
../win/Qt4/qt4main.h qt4main.moc ../win/Qt4/qt4bind.h \
../win/Qt4/qt4glyph.h ../win/Qt4/qt4inv.h ../win/Qt4/qt4key.h \
../win/Qt4/qt4map.h ../win/Qt4/qt4msg.h ../win/Qt4/qt4set.h \
../win/Qt4/qt4stat.h ../win/Qt4/qt4str.h qt4kde0.moc
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4main.cpp
qt4map.o : ../win/Qt4/qt4map.cpp $(HACK_H) qt4map.moc ../win/Qt4/qt4map.h
qt4map.o: ../win/Qt4/qt4map.cpp $(HACK_H) ../win/Qt4/qt4map.h qt4map.moc \
../win/Qt4/qt4click.h ../win/Qt4/qt4glyph.h \
../include/qt_xpms.h ../win/Qt4/qt4set.h ../win/Qt4/qt4str.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4map.cpp
qt4menu.o : ../win/Qt4/qt4menu.cpp $(HACK_H) qt4menu.moc ../win/Qt4/qt4menu.h
qt4menu.o: ../win/Qt4/qt4menu.cpp $(HACK_H) ../win/Qt4/qt4menu.h qt4menu.moc \
../win/Qt4/qt4glyph.h ../win/Qt4/qt4set.h \
../win/Qt4/qt4streq.h ../win/Qt4/qt4str.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4menu.cpp
qt4msg.o : ../win/Qt4/qt4msg.cpp $(HACK_H) qt4msg.moc ../win/Qt4/qt4msg.h
qt4msg.o: ../win/Qt4/qt4msg.cpp $(HACK_H) ../win/Qt4/qt4msg.h qt4msg.moc \
../win/Qt4/qt4map.h ../win/Qt4/qt4set.h ../win/Qt4/qt4str.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4msg.cpp
qt4plsel.o : ../win/Qt4/qt4plsel.cpp $(HACK_H) qt4plsel.moc ../win/Qt4/qt4plsel.h
qt4plsel.o: ../win/Qt4/qt4plsel.cpp $(HACK_H) ../win/Qt4/qt4plsel.h \
qt4plsel.moc ../win/Qt4/qt4bind.h ../win/Qt4/qt4glyph.h \
../win/Qt4/qt4set.h ../win/Qt4/qt4str.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4plsel.cpp
qt4rip.o : ../win/Qt4/qt4rip.cpp $(HACK_H) ../win/Qt4/qt4rip.h
qt4rip.o: ../win/Qt4/qt4rip.cpp $(HACK_H) ../win/Qt4/qt4rip.h \
../win/Qt4/qt4bind.h ../win/Qt4/qt4str.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4rip.cpp
qt4set.o : ../win/Qt4/qt4set.cpp $(HACK_H) qt4set.moc ../win/Qt4/qt4set.h
qt4set.o: ../win/Qt4/qt4set.cpp $(HACK_H) ../win/Qt4/qt4set.h qt4set.moc \
../win/Qt4/qt4glyph.h ../win/Qt4/qt4str.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4set.cpp
qt4stat.o : ../win/Qt4/qt4stat.cpp $(HACK_H) qt4stat.moc ../win/Qt4/qt4stat.h
qt4stat.o: ../win/Qt4/qt4stat.cpp $(HACK_H) ../win/Qt4/qt4stat.h qt4stat.moc \
../win/Qt4/qt4set.h ../win/Qt4/qt4str.h ../include/qt_xpms.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4stat.cpp
qt4str.o : ../win/Qt4/qt4str.cpp ../win/Qt4/qt4str.h
qt4str.o: ../win/Qt4/qt4str.cpp ../win/Qt4/qt4str.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4str.cpp
qt4streq.o : ../win/Qt4/qt4streq.cpp $(HACK_H) ../win/Qt4/qt4streq.h
qt4streq.o: ../win/Qt4/qt4streq.cpp $(HACK_H) ../win/Qt4/qt4streq.h \
../win/Qt4/qt4str.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4streq.cpp
qt4svsel.o : ../win/Qt4/qt4svsel.cpp $(HACK_H) ../win/Qt4/qt4svsel.h
qt4svsel.o: ../win/Qt4/qt4svsel.cpp $(HACK_H) ../win/Qt4/qt4svsel.h \
../win/Qt4/qt4bind.h ../win/Qt4/qt4str.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4svsel.cpp
qt4win.o : ../win/Qt4/qt4win.cpp $(HACK_H) ../win/Qt4/qt4win.h
qt4win.o: ../win/Qt4/qt4win.cpp $(HACK_H) ../win/Qt4/qt4win.h \
../win/Qt4/qt4bind.h ../win/Qt4/qt4click.h \
../win/Qt4/qt4glyph.h ../win/Qt4/qt4inv.h ../win/Qt4/qt4key.h \
../win/Qt4/qt4icon.h ../win/Qt4/qt4map.h ../win/Qt4/qt4menu.h \
../win/Qt4/qt4msg.h ../win/Qt4/qt4set.h ../win/Qt4/qt4clust.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4win.cpp
qt4xcmd.o : ../win/Qt4/qt4xcmd.cpp $(HACK_H) qt4xcmd.moc ../win/Qt4/qt4xcmd.h
qt4xcmd.o: ../win/Qt4/qt4xcmd.cpp $(HACK_H) ../include/func_tab.h \
../win/Qt4/qt4xcmd.h qt4xcmd.moc ../win/Qt4/qt4bind.h \
../win/Qt4/qt4set.h ../win/Qt4/qt4str.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4xcmd.cpp
qt4yndlg.o : ../win/Qt4/qt4yndlg.cpp $(HACK_H) qt4yndlg.moc ../win/Qt4/qt4yndlg.h
qt4yndlg.o: ../win/Qt4/qt4yndlg.cpp $(HACK_H) ../win/Qt4/qt4yndlg.h \
qt4yndlg.moc ../win/Qt4/qt4str.h
$(CXX) $(CXXFLAGS) -c ../win/Qt4/qt4yndlg.cpp
wc_chainin.o: ../win/chain/wc_chainin.c $(HACK_H)
$(CC) $(CFLAGS) -c ../win/chain/wc_chainin.c
@@ -948,7 +981,7 @@ attrib.o: attrib.c $(HACK_H)
ball.o: ball.c $(HACK_H)
bones.o: bones.c $(HACK_H) ../include/lev.h
botl.o: botl.c $(HACK_H)
cmd.o: cmd.c $(HACK_H) ../include/func_tab.h
cmd.o: cmd.c $(HACK_H) ../include/lev.h ../include/func_tab.h
dbridge.o: dbridge.c $(HACK_H)
decl.o: decl.c $(HACK_H)
detect.o: detect.c $(HACK_H) ../include/artifact.h

View File

@@ -291,7 +291,7 @@ clean:
# 'make spotless' returns the source tree to near-distribution condition.
# it removes .o files, executables, and compiled data files
spotless:
spotless::
( cd src ; $(MAKE) spotless )
( cd util ; $(MAKE) spotless )
( cd dat ; $(MAKE) spotless )

View File

@@ -15,8 +15,10 @@
// the identifier XCode needs in order to sign your builds.
//
// Your DEVELOPMENT_TEAM can be found by opening Keychain Access
// (found by Finder->Applications->Utilities). Click on "My Certificates".
// Look for your "Mac Developer" certificate. Right click on
// (found by Finder->Applications->Utilities). Click on "Login" key chain.
// Click on catagory "My Certificates".
//
// Look for your "Mac Developer" certificate. Double click on
// the certificate to open a dialog that shows certificate details.
// Look for "Organizational Unit" among the details. This ten digit value
// is your development team identifier.

View File

@@ -1,6 +1,6 @@
# depend.awk -- awk script used to construct makefile dependencies
# for nethack's source files (`make depend' support for Makefile.src).
# $NHDT-Date: 1524684206 2018/04/25 19:23:26 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.6 $
# $NHDT-Date: 1543447376 2018/11/28 23:22:56 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.7 $
#
# usage:
# cd src ; nawk -f depend.awk ../include/*.h list-of-.c/.cpp-files
@@ -39,8 +39,16 @@ FNR == 1 { output_dep() #finish previous file
/^\#[ \t]*include[ \t]+\"/ { #find `#include "X"'
incl = $2
#[3.4.0: gnomehack headers currently aren't in include]
#[3.6.2: Qt4 headers aren't in include either]
#[3.6.2: curses headers likewise]
if (incl ~ /\.h$/) {
if (incl ~ /^gn/) # gnomehack special case
if (incl ~ "curses\.h")
incl = "" # skip "curses.h"; it should be <curses.h>
else if (incl ~ /^curs/) # curses special case
incl = "../win/curses/" incl
else if (incl ~ /^qt4/) # Qt v4 special case
incl = "../win/Qt4/" incl
else if (incl ~ /^gn/) # gnomehack special case
incl = "../win/gnome/" incl
else
incl = "../include/" incl
@@ -80,7 +88,7 @@ function output_specials( i, sp, alt_sp)
print "#", alt_sp, "timestamp" #output a `make' comment
#- sub("\\.", "_", alt_sp); alt_sp = "$(" toupper(alt_sp) ")"
#+ Some nawks don't have toupper(), so hardwire these instead.
sub("config.h", "$(CONFIG_H)", alt_sp); sub("hack.h", "$(HACK_H)", alt_sp);
sub("config.h", "$(CONFIG_H)", alt_sp); sub("hack.h", "$(HACK_H)", alt_sp)
format_dep(alt_sp, sp) #output the target
print "\ttouch " alt_sp #output a build command
alt_deps[sp] = alt_sp #alternate dependency for depend()

397
sys/unix/hints/macosx10.14 Normal file
View File

@@ -0,0 +1,397 @@
#
# NetHack 3.6 macosx10.11 $NHDT-Date: 1515549543 2018/01/10 01:59:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.48 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015.
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Mac OS X (Darwin) hints file
# This is for Mac OS X 10.10 or later, and has been tested on 10.11
# (El Capitan). If this doesn't work for some other
# version of Mac OS X, make a new file for that OS, don't change this one.
# And let us know about it.
# Useful info: http://www.opensource.apple.com/darwinsource/index.html
# You'll need to obtain and install XQuartz if you want X11 support.
# (Attempting to run X11.app will describe where to get it.)
# This hints file can build several different types of installations.
# Edit the next section to match the type of build you need.
# 1. Which window system(s) should be included in this binary?
WANT_WIN_TTY=1
#WANT_WIN_X11=1
#WANT_WIN_QT=1
#WANT_WIN_CURSES=1
# 1a. What is the default window system?
WANT_DEFAULT=tty
#WANT_DEFAULT=x11
#WANT_DEFAULT=qt
#WANT_DEFAULT=curses
# 1b. If you set WANT_WIN_QT, you need to
# A) set QTDIR either here or in the environment to point to the Qt2 or Qt3
# library installation root. (Qt4 will not work; Qt3 does not presently
# compile under Leopard (MacOSX 10.5) out-of-the-box.)
# B) set XPMLIB to point to the Xpm library
ifdef WANT_WIN_QT
QTDIR=/Developer/Qt
LIBXPM= -L/opt/X11/lib -lXpm
endif # WANT_WIN_QT
# 2. Is this a build for a binary that will be shared among different users
# or will it be private to you?
# If it is shared:
# - it will be owned by the user and group listed
# - if the user does not exist, you MUST create it before installing
# NetHack
# - if the group does not exist, it will be created.
# NB: if the group already exists and is being used for something
# besides games, you probably want to specify a new group instead
# NB: the group will be created locally; if your computer is centrally
# administered this may not be what you (or your admin) want.
# Consider a non-shared install (WANT_SHARE_INSTALL=0) instead.
# - 'make install' must be run as "sudo make install"
#WANT_SHARE_INSTALL=1
GAMEUID = $(USER)
GAMEGRP = games
# build to run in the source tree - primarily for development. Build with "make all"
#WANT_SOURCE_INSTALL=1
CC=gcc
# At the moment this is just for debugging, but in the future it could be
# useful for other things. Requires SYSCF and an ANSI compiler.
#WANT_WIN_CHAIN=1
#
# You shouldn't need to change anything below here.
#
#CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic
# As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
# leave it out by default.
#CFLAGS+=-Wunreachable-code
# XXX -g vs -O should go here, -I../include goes in the makefile
CFLAGS+=-g -I../include
# older binaries use NOCLIPPING, but that disables SIGWINCH
#CFLAGS+=-DNOCLIPPING
CFLAGS+= -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
CFLAGS+= -DGREPPATH=\"/usr/bin/grep\"
ifdef WANT_WIN_CHAIN
CFLAGS+= -DWINCHAIN
HINTSRC=$(CHAINSRC)
HINTOBJ=$(CHAINOBJ)
endif
ifdef WANT_WIN_TTY
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
WINTTYLIB=-lncurses
else # !WANT_WIN_TTY
CFLAGS += -DNOTTYGRAPHICS
endif # !WANT_WIN_TTY
ifdef WANT_WIN_CURSES
CFLAGS += -DCURSES_GRAPHICS
WINSRC += $(WINCURSESSRC)
WINOBJ += $(WINCURSESOBJ)
WINLIB += -lncurses
endif
ifdef WANT_WIN_X11
WINSRC += $(WINX11SRC)
WINOBJ += $(WINX11OBJ)
WINLIB += $(WINX11LIB)
LFLAGS=-L/opt/X11/lib
VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; (cd $(HACKDIR); mkfontdir);
CFLAGS += -DX11_GRAPHICS -I/opt/X11/include
# avoid repeated complaints about _X_NONNULL(args...) in <X11/Xfuncproto.h>
CFLAGS += -Wno-variadic-macros
endif # WANT_WIN_X11
ifdef WANT_WIN_QT
CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
LINK=g++
WINSRC += $(WINQTSRC)
WINLIB += $(WINQTLIB) $(LIBXPM)
WINLIB += -framework Carbon -framework QuickTime -lz -framework OpenGL
WINLIB += -framework AGL
ifdef WANT_WIN_X11
# prevent duplicate tile.o in WINOBJ
WINOBJ = $(sort $(WINQTOBJ) $(WINX11OBJ))
ifdef WANT_WIN_TTY
WINOBJ += $(WINTTYOBJ)
endif # WANT_WIN_TTY
else # !WANT_WIN_X11
WINOBJ += $(WINQTOBJ)
endif # !WANT_WIN_X11
# XXX if /Developer/qt exists and QTDIR not set, use that
ifndef QTDIR
$(error QTDIR not defined in the environment or Makefile)
endif # QTDIR
# XXX make sure QTDIR points to something reasonable
else # !WANT_WIN_QT
LINK=$(CC)
endif # !WANT_WIN_QT
ifdef WANT_SHARE_INSTALL
# if $GAMEUID is root, we install into roughly proper Mac locations, otherwise
# we install into ~/nethackdir
ifeq ($(GAMEUID),root)
PREFIX:=/Library/NetHack
SHELLDIR=/usr/local/bin
HACKDIR=$(PREFIX)/nethackdir
CHOWN=chown
CHGRP=chgrp
# We run sgid so the game has access to both HACKDIR and user preferences.
GAMEPERM = 02755
else # ! root
PREFIX:=/Users/$(GAMEUID)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/Library/NetHack/nethackdir
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0500
endif # ! root
VARFILEPERM = 0664
VARDIRPERM = 0775
ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
# XXX it's nice we don't write over sysconf, but we've already erased it
# make sure we have group GAMEUID and group GAMEGRP
PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else ifdef WANT_SOURCE_INSTALL
PREFIX=$(abspath $(NHSROOT))
# suppress nethack.sh
#SHELLDIR=
HACKDIR=$(PREFIX)/playground
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf;
# We can use "make all" to build the whole thing - but it misses some things:
MOREALL=$(MAKE) install
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else # !WANT_SOURCE_INSTALL
PREFIX:=$(wildcard ~)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
ifdef WANT_WIN_X11
# install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc
endif # WANT_WIN_X11
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
endif # !WANT_SOURCE_INSTALL
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
# ~/Library/Preferences/NetHack Defaults
# OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
# OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
#
# Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
# package under the docs directory).
#-POST
ifdef MAKEFILE_TOP
###
### Packaging
###
# Notes:
# 1) The Apple developer utilities must be installed in the default location.
# 2) Do a normal build before trying to package the game.
# 3) This matches the 3.4.3 Term package, but there are some things that should
# be changed.
#
# Packages that are being distributed must be signed by a Developer ID Installer
# certificate. Set DEVELOPER_CERT to the name of the certificate if you wish
# for your package to be signed for distribution.
#
# If building a package for signing, you must use sudo approriately.
# the binaries and package using sudo but you DO NOT use sudo to sign the
# package. If you use sudo to sign the package, it will fail.
#
# sudo make all
# sudo make build_tty_pkg
# sudo sign_tty_pkg
#
ifdef WANT_WIN_TTY
DEVUTIL=/Developer/Applications/Utilities
SVS=$(shell $(NHSROOT)/util/makedefs --svs)
SVSDOT=$(shell $(NHSROOT)/util/makedefs --svs .)
PKGROOT_UG = PKGROOT/$(PREFIX)
PKGROOT_UGLN = PKGROOT/$(HACKDIR)
PKGROOT_BIN = PKGROOT/$(SHELLDIR)
#DEVELOPER_CERT = Developer ID Installer: Bart House
DEVELOPER_CERT = NONE
spotless::
rm -rf RESOURCES
rm -rf PKG
rm -rf PKGSCRIPTS
rm -rf PKGROOT
rm -f Info.plist
rm -f Distribution.xml
rm -f NetHack-*-mac-Term*
build_tty_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT))
-echo build_tty_pkg only works for a tty-only build
exit 1
else
rm -rf NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
$(MAKE) build_package_root
rm -rf RESOURCES
mkdir RESOURCES
#enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf
sys/unix/hints/macosx.sh descplist > RESOURCES/Description.plist
sys/unix/hints/macosx.sh infoplist > Info.plist
mkdir PKGROOT/Applications
#osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
# win/macosx/NetHackRecover.applescript
#cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
osacompile -o PKGROOT/Applications/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl $(PKGROOT_UGLN)
osacompile -o PKGROOT/Applications/NetHackTerm.app \
win/macosx/NetHackTerm.applescript
# XXX integrate into Makefile.doc
(cd doc; cat Guidebook.mn | ../util/makedefs --grep --input - --output - \
| tbl tmac.n - | groff | pstopdf -i -o Guidebook.pdf)
cp doc/Guidebook.pdf $(PKGROOT_UG)/doc/NetHackGuidebook.pdf
osacompile -o PKGROOT/Applications/NetHackGuidebook.app \
win/macosx/NetHackGuidebook.applescript
mkdir -p PKG
pkgbuild --root PKGROOT --identifier org.nethack.term --scripts PKGSCRIPTS PKG/NH-Term.pkg
productbuild --synthesize --product Info.plist --package PKG/NH-Term.pkg Distribution.xml
productbuild --distribution Distribution.xml --resources RESOURCES --package-path PKG NetHack-$(SVS)-mac-Term-unsigned.pkg
ifeq ($(DEVELOPER_CERT),NONE)
cp NetHack-$(SVS)-mac-Term-unsigned.pkg NetHack-$(SVS)-mac-Term.pkg
hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term-unsigned.pkg NetHack-$(SVS)-mac-Term-unsigned.dmg
@echo -------------------------------------------
@echo PACKAGE IS NOT SIGNED FOR DISTRIBUTION!!!!!
@echo ===========================================
else
@echo "run 'make sign_tty_pkg' to complete package"
endif
sign_tty_pkg:
productsign --timestamp=none --sign "$(DEVELOPER_CERT)" NetHack-$(SVS)-mac-Term-unsigned.pkg NetHack-$(SVS)-mac-Term.pkg || (echo "Package signing failed"; exit 1)
spctl -a -v --type install NetHack-$(SVS)-mac-Term.pkg || (echo "Package not signed properly"; exit 1)
hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
build_package_root:
cd src/.. # make sure we are at TOP
rm -rf PKGROOT
mkdir -p $(PKGROOT_UG)/lib $(PKGROOT_BIN) $(PKGROOT_UG)/man/man6 $(PKGROOT_UG)/doc $(PKGROOT_UGLN)
install -p src/nethack $(PKGROOT_BIN)
# XXX should this be called nethackrecover?
install -p util/recover $(PKGROOT_BIN)
install -p doc/nethack.6 $(PKGROOT_UG)/man/man6
install -p doc/recover.6 $(PKGROOT_UG)/man/man6
install -p doc/Guidebook $(PKGROOT_UG)/doc
install -p dat/nhdat $(PKGROOT_UGLN)
sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(PKGROOT_UGLN)/sysconf
cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
# XXX these files should be somewhere else for good Mac form
touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile $(PKGROOT_UGLN)/xlogfile
mkdir $(PKGROOT_UGLN)/save
# XXX what about a news file?
mkdir -p PKGSCRIPTS
echo '#!/bin/sh' > PKGSCRIPTS/postinstall
echo dseditgroup -o create -r '"Games Group"' -s 3600 $(GAMEGRP) >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(HACKDIR)/* >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(HACKDIR)/* >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
echo chmod $(VARDIRPERM) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo chmod $(VARDIRPERM) $(HACKDIR)/save >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/license >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/nhdat >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/symbols >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/perm >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/record >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/logfile >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/xlogfile >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/sysconf >> PKGSCRIPTS/postinstall
echo chmod $(GAMEPERM) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo chmod $(EXEPERM) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
chmod 0775 PKGSCRIPTS/postinstall
endif # end of build_tty_pkg
endif # WANT_WIN_TTY for packaging
ifdef WANT_WIN_QT
# XXX untested and incomplete (see below)
build_qt_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_TTY))
-echo build_qt_pkg only works for a qt-only build
exit 1
else
$(MAKE) build_package_root
rm -rf NetHackQt
mkdir -p NetHackQt/NetHackQt.app/nethackdir/save
mkdir NetHackQt/Documentation
cp doc/Guidebook.txt doc/nethack.txt doc/recover.txt NetHackQt/Documentation
osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
mkdir -p NetHackQt/NetHackQt.app/Contents/Frameworks
cp $(QTDIR)/libqt-mt.3.dylib NetHackQt/NetHackQt.app/Contents/Frameworks
mkdir NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/nethack NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/lib/nethackdir NetHackQt/NetHackQt.app/nethackdir
# XXX still missing:
#NetHackQt/NetHackQt.app
# /Contents
# Info.plist
# Resources/nethack.icns
#NetHackQt/Documentation
#NetHackQtRecover.txt
#NetHack Defaults.txt
#changes.patch XXX is this still needed? why isn't it part of the tree?
# doesn't go here
hdiutil create -verbose -srcfolder NetHackQt NetHack-$(SVS)-macosx-qt.dmg
endif # end of build_qt_pkg
endif # WANT_WIN_QT for packaging
endif # MAKEFILE_TOP