Merge remote-tracking branch 'origin/NetHack-3.6.0'
This commit is contained in:
@@ -169,3 +169,4 @@ spotless:
|
||||
-rm -f spec_levs quest_levs *.lev $(VARDAT) dungeon dungeon.pdf
|
||||
-rm -f nhdat x11tiles beostiles pet_mark.xbm pilemark.xbm rip.xpm mapbg.xpm
|
||||
-rm -f rip.img GEM_RSC.RSC title.img nh16.img NetHack.ad
|
||||
-rm -f nhsplash.xpm nhtiles.bmp
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# NetHack Makefile.
|
||||
# NetHack 3.6 Makefile.src $NHDT-Date: 1459122529 2016/03/27 23:48:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.46 $
|
||||
# NetHack 3.6 Makefile.src $NHDT-Date: 1520201829 2018/03/04 22:17:09 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.52 $
|
||||
|
||||
# Root of source tree:
|
||||
NHSROOT=..
|
||||
@@ -332,6 +332,14 @@ RANDOBJ =
|
||||
# used by `make depend' to reconstruct this Makefile; you shouldn't need this
|
||||
AWK = nawk
|
||||
|
||||
# when using 'makedefs -v', also force dat/gitinfo.txt to be up to date;
|
||||
# changing this to 0 will change the behavior to only make that file if
|
||||
# it doesn't already exist; to skip it completely, create an empty file
|
||||
# of that name and also set this to 0; there shouldn't be any need to
|
||||
# skip it--if nethack's sources don't reside in a git repository than
|
||||
# the script which creates that file will fail benignly and 'makedefs -v'
|
||||
# will proceed without it
|
||||
GITINFO=1
|
||||
|
||||
#VERBOSEMAKE = 1
|
||||
|
||||
@@ -606,10 +614,13 @@ tile.c: ../win/share/tilemap.c $(HACK_H)
|
||||
# file far more complex. Since "hack.h" depends on most of the include
|
||||
# files, we kludge around this by making date.h dependent on hack.h,
|
||||
# even though it doesn't include this file.
|
||||
# Do NOT include ../dat/gitinfo.txt as either a prerequisite or target.
|
||||
# 'makedefs -v' processes it when present and ignores it if not.
|
||||
#
|
||||
# hack.h depends on makedefs' output, so we know makedefs will be
|
||||
# up to date before being executed
|
||||
../include/date.h: $(VERSOURCES) $(HACK_H)
|
||||
-$(SHELL) ../sys/unix/gitinfo.sh $(GITINFO) #before 'makedefs -v'
|
||||
../util/makedefs -v
|
||||
|
||||
|
||||
|
||||
@@ -481,4 +481,4 @@ spotless: clean
|
||||
-rm -f ../include/tile.h tiletxt.c
|
||||
-rm -f makedefs lev_comp dgn_comp recover dlb
|
||||
-rm -f gif2txt txt2ppm tile2x11 tile2img.ttp xpm2img.ttp \
|
||||
tilemap tileedit
|
||||
tilemap tileedit tile2bmp
|
||||
|
||||
28
sys/unix/gitinfo.sh
Executable file
28
sys/unix/gitinfo.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
# NetHack 3.6 gitinfo.sh $NHDT-Date: 1520201830 2018/03/04 22:17:10 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.0 $
|
||||
|
||||
# bring dat/gitinfo.txt up to date; called from Makefile.src
|
||||
|
||||
#
|
||||
# gitinfo.txt is used during development to augment the version number
|
||||
# (for nethack's 'v' command) with more specific information. That is not
|
||||
# necessary when building a released version and it is perfectly OK for
|
||||
# this script to be skipped or to run but fail to generate dat/gitinfo.txt.
|
||||
#
|
||||
|
||||
always=0
|
||||
if [[ $1 -eq 1 || $1 == "force" || $1 == "always" ]]; then always=1; fi
|
||||
|
||||
# try to figure out where we are: top, one level down (expected), or sys/unix
|
||||
prefix=.
|
||||
if [ -f ../sys/unix/gitinfo.sh ]; then prefix=..; fi
|
||||
if [ -f ../../sys/unix/gitinfo.sh ]; then prefix=../..; fi
|
||||
|
||||
# try to run a perl script which is part of nethack's git repository
|
||||
if [[ $always -eq 1 || ! -f $prefix/dat/gitinfo.txt ]]; then
|
||||
( cd $prefix; \
|
||||
perl -IDEVEL/hooksdir -MNHgithook -e '&NHgithook::nhversioning' \
|
||||
2> /dev/null ) \
|
||||
|| true
|
||||
fi
|
||||
exit 0
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# NetHack 3.6 macosx.sh $NHDT-Date: 1518800856 2018/02/16 17:07:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.19 $
|
||||
# NetHack 3.6 macosx.sh $NHDT-Date: 1517231957 2018/01/29 13:19:17 $ $NHDT-Branch: githash $:$NHDT-Revision: 1.20 $
|
||||
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
|
||||
# NetHack may be freely redistributed. See license for details.
|
||||
#
|
||||
|
||||
@@ -110,6 +110,9 @@ char *argv[];
|
||||
dir = nh_getenv("HACKDIR");
|
||||
|
||||
if (argc > 1) {
|
||||
if (argcheck(argc, argv, ARG_VERSION))
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
if (!strncmp(argv[1], "-d", 2) && argv[1][2] != 'e') {
|
||||
/* avoid matching "-dec" for DECgraphics; since the man page
|
||||
* says -d directory, hope nobody's using -desomething_else
|
||||
@@ -720,4 +723,40 @@ get_login_name()
|
||||
return buf;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
extern int errno;
|
||||
|
||||
void
|
||||
port_insert_pastebuf(buf)
|
||||
char *buf;
|
||||
{
|
||||
/* This should be replaced when there is a Cocoa port. */
|
||||
const char *errfmt;
|
||||
size_t len;
|
||||
FILE *PB = popen("/usr/bin/pbcopy","w");
|
||||
if(!PB){
|
||||
errfmt = "Unable to start pbcopy (%d)\n";
|
||||
goto error;
|
||||
}
|
||||
|
||||
len = strlen(buf);
|
||||
/* Remove the trailing \n, carefully. */
|
||||
if(buf[len-1] == '\n') len--;
|
||||
|
||||
/* XXX Sorry, I'm too lazy to write a loop for output this short. */
|
||||
if(len!=fwrite(buf,1,len,PB)){
|
||||
errfmt = "Error sending data to pbcopy (%d)\n";
|
||||
goto error;
|
||||
}
|
||||
|
||||
if(pclose(PB)!=-1){
|
||||
return;
|
||||
}
|
||||
errfmt = "Error finishing pbcopy (%d)\n";
|
||||
|
||||
error:
|
||||
raw_printf(errfmt,strerror(errno));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*unixmain.c*/
|
||||
|
||||
Reference in New Issue
Block a user