[comp.sources.bugs] nethack: Makefile for Sys V/286

tif@cpe.UUCP (08/18/87)

tuh-duh!  Got a little long:

Here is a Makefile for nethack that seems to work for System V/286.  I have
compiled this using Tandy XENIX System V/286.  This should be close to, if
not exactly, what is needed for SCO XENIX as well.  Unfortunately, I'm not
skilled enough at playing to know wether everything works right.  Please
let me know if it still dumps core and in what routine.  I have played it
for several hours with no unusual (other than getting killed) problems.
I will discuss the technical reasons for the changes I made in a minute.

Since I also made the obvious changes to config.h I decided to include it
as well.  My sources have the 3 fixes posted (by postgres.UUCP!grady,
b.gp.cs.cmu.edu.UUCP!ralf, and myab.UUCP!jonas) installed as well.  This
means that there is an additional line in the config.h file.  I think
I also defined REGBUG (just in case).

I would like to make one request to future software efforts.  Please don't
assume that machines are any more efficient with a dozen registers declared
in one routine.  If you must declare 75% of the variables as registers, at
least put the word "int" after "register" so I can compile with "-Dregister=".
The '286 is not particularly efficient with register declarations.

As for the actual changes that I made, I noticed that the author(s) was
attempting to put most of the data in other segments.  You can't do
this and expect it to run unless you load ds every time you enter a routine.
That's what the "-Au" option does.  Furthermore, libc was not compiled this
way, so any routine that calls libc should (in theory) have ds pointing
to the default data segment.  I found, by experimentation, that at least
the abs() function call does not have this requirement.  I arrived at this
Makefile by making a list of the library functions that were no-no's and
fgrep-ping all the .c's for this list.  Any that didn't have a library
call could be put into another data segment.  I noticed that it would be
to my advantage to verify that abs() was not a no-no.  I also noticed that
free() did cause problems but did not show up as such in libc.  It also was
not necessary to spread the data over six or seven segments, two is enough.
In fact, I had some problems that way that I never did quite understand.
My _DATA segment has about 55K in it and my AUXDATA segment has about 15K.
There also is no need to use the -NT option.  Large model compilation takes
care of that for you.

I have seen some discussion of the "-Gt" (I think) option, I'm still not
sure what that does.  It could be an easier way to accomplish what I have
done.

My employer would be		Paul Chamberlain
a fool to be responsible	Computer Product Engineering, Tandy Corp.
this posting.			ihnp4!sys1!cpe!tif

------------------ you know what to do by now ------------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	Makefile
#	config.h
# This archive created: Mon Aug 17 18:02:58 1987
export PATH; PATH=/bin:/usr/bin:$PATH
echo shar: "extracting 'Makefile'" '(8465 characters)'
if test -f 'Makefile'
then
	echo shar: "will not over-write existing file 'Makefile'"
else
sed 's/^	X//' << \SHAR_EOF > 'Makefile'
	X#	Hack or Quest Makefile.
	X#	SCCS Id: @(#)Makefile.xenix	1.3	87/07/14
	X
	X# if you are cross-compiling (eg. from Xenix into a Dos enviornment)
	X# you will have to redefine these filenames.
	XMAIN = unixmain.c
	XTTY  = unixtty.c
	XUNIX = unixunix.c
	X
	X# on some systems the termcap library is in -ltermcap
	XTERMLIB = -ltermlib
	X# TERMLIB = /lib/Llibtermlib.a
	X# CRT0   = /lib/crt0.o
	XCRT0   =
	XLIBS = ${TERMLIB} -lc
	X# LIBS = ${TERMLIB} /lib/Llibc.a
	X
	X# make NetHack
	XGAME = nethack
	XGAMEUID = games
	XGAMEGRP = bin
	XGAMEDIR = /usr/games/lib/hackdir
	XSHELLDIR = /usr/games
	XMANDIR  = .
	XCFLAGS = -O -M2l -Au
	XLFLAGS = -Ml
	XHACKCSRC = apply.c bones.c decl.c\
	X	cmd.c do.c dothrow.c do_name.c do_wear.c dog.c dogmove.c eat.c end.c\
	X	engrave.c fight.c fountain.c hack.c invent.c ioctl.c lev.c main.c\
	X	makemon.c mhitu.c mklev.c mkmaze.c mkobj.c mkshop.c\
	X	mon.c monmove.c monst.c o_init.c objnam.c options.c\
	X	pager.c polyself.c potion.c pray.c pri.c prisym.c read.c rip.c\
	X	rumors.c save.c search.c shk.c shknam.c sit.c spell.c steal.c\
	X	termcap.c timeout.c topl.c topten.c track.c trap.c tty.c unix.c\
	X	u_init.c vault.c wield.c wizard.c worm.c worn.c write.c zap.c\
	X	version.c rnd.c alloc.c
	X
	XCSOURCES = $(HACKCSRC) makedefs.c
	X
	XHSOURCES = hack.h mfndpos.h config.h edog.h eshk.h extern.h\
	X	flag.h func_tab.h gold.h mkroom.h monst.h obj.h\
	X	objclass.h objects.h permonst.h rm.h spell.h trap.h wseg.h you.h
	X
	XSOURCES = $(CSOURCES) $(HSOURCES)
	X
	XAUX = help hh nethack.6 nethack.sh
	XVARAUX = data rumors
	X
	XDISTR = $(SOURCES) $(AUX) $(VARAUX) README.OLD README\
	X	Makefile.unix Makefile.xenix Makefile.pc Make.ini
	X
	XHOBJ = apply.o bones.o decl.o cmd.o do.o dothrow.o do_name.o do_wear.o dog.o\
	X	dogmove.o eat.o end.o engrave.o fight.o fountain.o hack.o\
	X	invent.o ioctl.o lev.o main.o makemon.o mhitu.o mklev.o\
	X	mkmaze.o mkobj.o mkshop.o mon.o monmove.o monst.o\
	X	o_init.o objnam.o options.o pager.o polyself.o potion.o pray.o\
	X	pri.o prisym.o read.o rip.o rumors.o save.o search.o shk.o shknam.o\
	X	sit.o spell.o steal.o termcap.o timeout.o topl.o topten.o track.o\
	X	trap.o tty.o unix.o u_init.o vault.o wield.o wizard.o worm.o worn.o\
	X	write.o zap.o version.o rnd.o alloc.o
	X
	X$(GAME):	specifics $(HOBJ) Makefile
	X	@echo "Loading ..."
	X	@cc $(LFLAGS) -o $(GAME) $(CRT0) $(HOBJ) $(LIBS)
	X
	Xall:	$(GAME) lint
	X	@echo "Done."
	X
	Xmakedefs:	makedefs.c alloc.o config.h
	X	cc ${CFLAGS} -o makedefs alloc.o makedefs.c
	X
	XRUMORFILES= rumors.base rumors.kaa rumors.mrx
	X
	Xrumors:	config.h $(RUMORFILES) makedefs
	X	./makedefs -r
	X
	Xdata:	config.h data.base makedefs
	X	./makedefs -d
	X
	Xdate.h:	$(SOURCES) makedefs
	X	./makedefs -D
	X
	Xtrap.h:	config.h makedefs
	X	./makedefs -t
	X
	Xonames.h:	makedefs objects.h
	X	./makedefs -o
	X
	Xspecifics:	main.o tty.o unix.o
	X
	X#main.o: main.c
	X#	cc ${CFLAGS} -c -ND AUXDATA main.c
	X
	Xmain.c:	unixmain.c hack.h
	X	cp ${MAIN} main.c
	X
	X#tty.o:	tty.c
	X#	cc ${CFLAGS} -c -ND AUXDATA tty.c
	X
	Xtty.c:	unixtty.c extern.h
	X	cp ${TTY} tty.c
	X
	X#unix.o:	unix.c
	X#	cc ${CFLAGS} -c -ND AUXDATA unix.c
	X
	Xunix.c:	unixunix.c hack.h mkroom.h
	X	cp ${UNIX} unix.c
	X
	Xlint:
	X# lint cannot have -p here because (i) capitals are meaningful:
	X# [Ww]izard, (ii) identifiers may coincide in the first six places:
	X# doweararm() versus dowearring().
	X# _flsbuf comes from <stdio.h>, a bug in the system libraries.
	X	@echo lint -axbh -DLINT ...
	X	@lint -axbh -DLINT $(HACKCSRC) | sed '/_flsbuf/d'
	X
	X
	Xdiff:
	X	@- for i in $(SOURCES) $(AUX) ; do \
	X		cmp -s $$i $D/$$i || \
	X		( echo diff $D/$$i $$i ; diff $D/$$i $$i ; echo ) ; done
	X
	Xdistribution: Makefile
	X	@- for i in READ_ME $(SOURCES) $(AUX) Makefile date.h onames.h\
	X		; do \
	X		cmp -s $$i $D/$$i || \
	X		( echo cp $$i $D ; cp $$i $D ) ; done
	X# the distribution directory also contains the empty files perm and record.
	X
	Xinitial:
	X	-rm -rf $(GAMEDIR)
	X	-mkdir $(SHELLDIR)
	X	mkdir $(GAMEDIR) $(GAMEDIR)/save
	X	touch $(GAMEDIR)/perm
	X	touch $(GAMEDIR)/record
	X	chown $(GAMEUID) $(GAMEDIR) $(GAMEDIR)/*
	X	chgrp $(GAMEGRP) $(GAMEDIR) $(GAMEDIR)/*
	X	chmod 666 $(GAMEDIR)/*
	X	chmod 777 $(GAMEDIR) $(GAMEDIR)/save
	X
	Xinstall: $(VARAUX)
	X	-rm -f $(GAMEDIR)/$(GAME)
	X	-rm -f $(GAMEDIR)/bones*
	X	-rm -f $(GAMEDIR)/save/*
	X	cp help hh rumors data $(GAMEDIR)
	X	cp $(GAME).sh $(SHELLDIR)/$(GAME)
	X	cp $(GAME) $(GAMEDIR)/$(GAME)
	X	chown $(GAMEUID) $(SHELLDIR)/$(GAME) $(GAMEDIR)/*
	X	chgrp $(GAMEGRP) $(SHELLDIR)/$(GAME) $(GAMEDIR)/*
	X	chmod 0755 $(SHELLDIR)/$(GAME)
	X	chmod 04755 $(GAMEDIR)/$(GAME)
	X	-cp nethack.6 $(MANDIR)
	X
	Xclean:
	X	rm -f *.o
	X
	Xspotless: clean
	X	rm -f a.out core $(GAME) makedefs
	X	rm -f Makefile $(VARAUX) main.c tty.c unix.c
	X
	Xalloc.o:
	X#	cc ${CFLAGS} -ND DAUXDATA -c alloc.c
	Xbones.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c bones.c
	Xdecl.o:  hack.h mkroom.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c decl.c
	Xend.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c end.c
	Xhack.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c hack.c
	Xioctl.o:  config.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c ioctl.c
	Xo_init.o:  config.h objects.h onames.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c o_init.c
	Xobjnam.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c objnam.c
	Xrnd.o:
	X#	cc ${CFLAGS} -ND DAUXDATA -c rnd.c
	Xu_init.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c u_init.c
	Xversion.o:  hack.h date.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c version.c
	Xapply.o:  hack.h edog.h mkroom.h
	X	cc ${CFLAGS} -ND DAUXDATA -c apply.c
	Xcmd.o:  hack.h func_tab.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c cmd.c
	Xdo.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c do.c
	Xdothrow.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c dothrow.c
	Xdo_name.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c do_name.c
	Xdo_wear.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c do_wear.c
	Xdog.o:  hack.h edog.h mkroom.h
	X	cc ${CFLAGS} -ND DAUXDATA -c dog.c
	Xdogmove.o:  hack.h mfndpos.h
	X	cc ${CFLAGS} -ND DAUXDATA -c dogmove.c
	Xeat.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c eat.c
	Xengrave.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c engrave.c
	Xfight.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c fight.c
	Xfountain.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c fountain.c
	Xinvent.o:  hack.h wseg.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c invent.c
	Xlev.o:  hack.h mkroom.h wseg.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c lev.c
	Xmakemon.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c makemon.c
	Xmhitu.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c mhitu.c
	Xmklev.o:  hack.h mkroom.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c mklev.c
	Xmkmaze.o:  hack.h mkroom.h
	X	cc ${CFLAGS} -ND DAUXDATA -c mkmaze.c
	Xmkobj.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c mkobj.c
	Xmkshop.o:  hack.h mkroom.h eshk.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c mkshop.c
	Xmon.o:  hack.h mfndpos.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c mon.c
	Xmonmove.o:  hack.h mfndpos.h
	X	cc ${CFLAGS} -ND DAUXDATA -c monmove.c
	Xmonst.o:  hack.h eshk.h
	X	cc ${CFLAGS} -ND DAUXDATA -c monst.c
	Xoptions.o:  config.h hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c options.c
	Xpager.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c pager.c
	Xpolyself.o: hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c polyself.c
	Xpotion.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c potion.c
	Xpray.o: hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c pray.c
	Xpri.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c pri.c
	Xprisym.o:  hack.h wseg.h
	X	cc ${CFLAGS} -ND DAUXDATA -c prisym.c
	Xread.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c read.c
	Xrip.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c rip.c
	Xrumors.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c rumors.c
	Xsave.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c save.c
	Xsearch.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c search.c
	Xshk.o:  hack.h mfndpos.h mkroom.h eshk.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c shk.c
	Xshknam.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c shknam.c
	Xsit.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c sit.c
	Xspell.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c spell.c
	Xsteal.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c steal.c
	Xtermcap.o:  config.h flag.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c termcap.c
	Xtimeout.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c timeout.c
	Xtopl.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c topl.c
	Xtopten.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c topten.c
	Xtrack.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c track.c
	Xtrap.o:  hack.h mkroom.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c trap.c
	Xvault.o:  hack.h mkroom.h
	X	cc ${CFLAGS} -ND DAUXDATA -c vault.c
	Xwield.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c wield.c
	Xwizard.o:  hack.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c wizard.c
	Xworm.o:  hack.h wseg.h
	X#	cc ${CFLAGS} -ND DAUXDATA -c worm.c
	Xworn.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c worn.c
	Xwrite.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c write.c
	Xzap.o:  hack.h
	X	cc ${CFLAGS} -ND DAUXDATA -c zap.c
	Xextern.h: config.h
	X	touch extern.h
	Xhack.h:  config.h objclass.h monst.h gold.h trap.h obj.h flag.h rm.h permonst.h spell.h onames.h extern.h you.h
	X	touch hack.h
	Xobjects.h:  config.h objclass.h
	X	touch objects.h
SHAR_EOF
if test 8465 -ne "`wc -c < 'Makefile'`"
then
	echo shar: "error transmitting 'Makefile'" '(should have been 8465 characters)'
fi
fi
echo shar: "extracting 'config.h'" '(7687 characters)'
if test -f 'config.h'
then
	echo shar: "will not over-write existing file 'config.h'"
else
sed 's/^	X//' << \SHAR_EOF > 'config.h'
	X/*	SCCS Id: @(#)config.h	1.3	87/07/14
	X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
	X/* config.h - version 1.0.3 */
	X
	X#ifndef CONFIG	/* make sure the compiler does not see the typedefs twice */
	X#define	CONFIG
	X
	X#define	CHDIR		/* delete if no chdir() available */
	X
	X/*
	X * Some include files are in a different place under SYSV
	X * 	BSD		   SYSV
	X * <strings.h>		<string.h>
	X * <sys/wait.h>		<wait.h>
	X * <sys/time.h>		<time.h>
	X * <sgtty.h>		<termio.h>
	X * Some routines are called differently
	X * index		strchr
	X * rindex		strrchr
	X * Also, the code for suspend and various ioctls is only given for BSD4.2
	X * (I do not have access to a SYSV system.)
	X */
	X/* #define MSDOS 	/* define for MS-DOS (actually defined by compiler) */
	X#define	UNIX		/* delete if no fork(), exec() available */
	X/* #define BSD		/* defind for 4.n BSD  */
	X#define SYSV		/* define for System V */
	X
	X/* #define BETA		/* if a beta-test copy  [MRS] */
	X#define VERSION	"1.3d"	/* version number. */
	X
	X/* #define TERMINFO	/* if Terminfo curses package is used (System V.[23]) */
	X/* #define PYRAMID_BUG 	/* avoid a bug on the Pyramid */
	X/* #define APOLLO		/* same for the Apollo */
	X#define REGBUG
	X#define STUPID		/* avoid some complicated expressions if
	X			   your C compiler chokes on them */
	X#define NOWAITINCLUDE	/* neither <wait.h> nor <sys/wait.h> exists */
	X#ifdef MSDOS
	X#define	NOWAITINCLUDE
	X#endif
	X
	X#define WIZARD  "root"	/* the person allowed to use the -D option */
	X#define RECORD	"record"/* the file containing the list of topscorers */
	X#define	NEWS	"news"	/* the file containing the latest hack news */
	X#define	HELP	"help"	/* the file containing a description of the commands */
	X#define	SHELP	"hh"	/* abbreviated form of the same */
	X#define	RUMORFILE	"rumors"	/* a file with fortune cookies */
	X#define	DATAFILE	"data"	/* a file giving the meaning of symbols used */
	X#define	FMASK	0660	/* file creation mask */
	X
	X#ifdef UNIX
	X#define	HLOCK	"perm"	/* an empty file used for locking purposes */
	X#define LLOCK	"safelock"	/* link to previous */
	X
	X/*
	X * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
	X * If defined, it can be overridden by the environment variable PAGER.
	X * Hack will use its internal pager if DEF_PAGER is not defined.
	X * (This might be preferable for security reasons.)
	X * #define DEF_PAGER	".../mydir/mypager"
	X */
	X
	X/*
	X * If you define MAIL, then the player will be notified of new mail
	X * when it arrives. If you also define DEF_MAILREADER then this will
	X * be the default mail reader, and can be overridden by the environment
	X * variable MAILREADER; otherwise an internal pager will be used.
	X * A stat system call is done on the mailbox every MAILCKFREQ moves.
	X */
	X#define	MAIL
	X#define	DEF_MAILREADER	"/usr/bin/xmail"	/* or e.g. /bin/mail */
	X#define	MAILCKFREQ	1
	X
	X
	X#define SHELL		/* do not delete the '!' command */
	X
	X#ifdef BSD
	X#define	SUSPEND		/* let ^Z suspend the game */
	X#endif
	X#endif /* UNIX /**/
	X
	X#ifdef CHDIR
	X/*
	X * If you define HACKDIR, then this will be the default playground;
	X * otherwise it will be the current directory.
	X */
	X#define HACKDIR	"/usr/games/lib/hackdir"
	X
	X/*
	X * Some system administrators are stupid enough to make Hack suid root
	X * or suid daemon, where daemon has other powers besides that of reading or
	X * writing Hack files. In such cases one should be careful with chdir's
	X * since the user might create files in a directory of his choice.
	X * Of course SECURE is meaningful only if HACKDIR is defined.
	X */
	X#define SECURE			/* do setuid(getuid()) after chdir() */
	X
	X/*
	X * If it is desirable to limit the number of people that can play Hack
	X * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
	X * #define MAX_NR_OF_PLAYERS	6
	X */
	X#endif /* CHDIR /**/
	X
	X/* size of terminal screen is (at least) (ROWNO+2) by COLNO */
	X#define	COLNO	80
	X#define	ROWNO	22
	X
	X#ifdef BSD
	X#include <strings.h>		/* declarations for strcat etc. */
	X#else
	X#include <string.h>		/* idem on System V */
	X#define	index	strchr
	X#define	rindex	strrchr
	X#endif
	X
	X/*
	X * small signed integers (8 bits suffice)
	X *	typedef	char	schar;
	X * will do when you have signed characters; otherwise use
	X *	typedef	short int schar;
	X */
	Xtypedef	char	schar;
	X
	X/*
	X * small unsigned integers (8 bits suffice - but 7 bits do not)
	X * - these are usually object types; be careful with inequalities! -
	X *	typedef	unsigned char	uchar;
	X * will be satisfactory if you have an "unsigned char" type; otherwise use
	X *	typedef unsigned short int uchar;
	X */
	Xtypedef	unsigned char	uchar;
	X
	X/*
	X * small integers in the range 0 - 127, usually coordinates
	X * although they are nonnegative they must not be declared unsigned
	X * since otherwise comparisons with signed quantities are done incorrectly
	X */
	Xtypedef schar	xchar;
	Xtypedef	xchar	boolean;		/* 0 or 1 */
	X#define	TRUE	1
	X#define	FALSE	0
	X
	X/*
	X * Declaration of bitfields in various structs; if your C compiler
	X * doesnt handle bitfields well, e.g., if it is unable to initialize
	X * structs containing bitfields, then you might use
	X *	#define Bitfield(x,n)	uchar x
	X * since the bitfields used never have more than 7 bits. (Most have 1 bit.)
	X */
	X#define	Bitfield(x,n)	uchar x
	X
	X#define	SIZE(x)	(int)(sizeof(x) / sizeof(x[0]))
	X
	X#ifdef MSDOS
	X#include <fcntl.h>
	X#define	exit	msexit		/* do chdir first */
	X#ifdef getchar
	X#	undef getchar
	X#endif /* getchar /**/
	X#define getchar tgetch
	X#define DGK			/* MS DOS specific enhancements by dgk */
	X
	X#ifdef DGK
	X#  include "msdos.h"	/* contains necessary externs for msdos.c */
	X#  define SHELL		/* via exec of COMMAND.COM */
	X#  define PATHLEN	64	/* maximum pathlength */
	X#  define FILENAME 80	/* maximum filename length (conservative) */
	X#  define FROMPERM	1	/* for ramdisk use */
	X#  define TOPERM	2	/* for ramdisk use */
	X#  define glo(x)	name_file(lock, x)	/* name_file used for bones */
	X#  define IS_CORNER(x)	((x) == symbol.tlcorn || (x) == symbol.trcorn\
	X				|| (x) == symbol.blcorn || (x)==symbol.brcorn)
	X	/* screen symbols for using character graphics. */
	X	struct symbols {
	X		unsigned char vwall, hwall, tlcorn, trcorn, blcorn, brcorn;
	X		unsigned char door, room, corr;
	X	};
	X	extern struct symbols symbol;
	X	extern char *configfile;
	X#endif /* DGK /**/
	X#endif /* MSDOS /**/
	X
	X/*
	X *	Conditional compilation of special options are controlled here.
	X *	If you define the following flags, you will add not only to the
	X *	complexity of the game but also to the size of the load module.
	X */ 
	X 
	X#define	SPELLS		/* Spell casting by M. Stephenson */
	X#define	PRAYERS		/* Prayer code by M. Stephenson */
	X#define KAA		/* Various changes made by Ken Arromdee */
	X#define MARKER		/* Magic marker modification from Gil Neiger */
	X#define	NEWCLASS	/* Samurai/Ninja etc. by M. Stephenson */ 
	X#define	SAFE_ATTACK 	/* Safe attack code by Don Kneller */
	X#define	PROBING		/* Wand of probing code by Gil Neiger */
	X#define	DIAGS		/* Diagnostics after death/quit by Gil Neiger */
	X#define	SORTING		/* Sorted inventory by Don Kneller */
	X#define	DGKMOD		/* Additional features by Don Kneller */
	X#define REDO 		/* support for redoing last command - DGK */
	X#define	HARD		/* Enhanced wizard code by M. Stephenson */
	X#define	WALKIES		/* Leash code by M. Stephenson */
	X#define NEWTRAPS	/* Magic and Squeeky board traps by Scott R. Turner*/
	X#define FREEHAND	/* Cannot use Pick-axe without wielding it. */
	X#define SPIDERS		/* Spiders and webs by Scott R. Turner */
	X#define FOUNTAINS	/* Fountain code by SRT (+ GAN + EB) */
	X#define KOPS		/* Keystone Kops by Scott R. Turner */
	X#define ROCKMOLE	/* Rockmoles by Scott R. Turner */
	X
	X/*
	X *	Status Line options.
	X */
	X
	X#define	GOLD_ON_BOTL
	X#define	EXP_ON_BOTL
	X	 
	X#ifdef REDO
	X#define DOAGAIN	'\001'		/* Used in tty.c and cmd.c */
	X#endif
	X
	X#ifdef DGKMOD
	X#define LARGEST_INT	((1 << 15) - 1)
	X#endif
	X
	X#endif /* CONFIG /**/
SHAR_EOF
if test 7687 -ne "`wc -c < 'config.h'`"
then
	echo shar: "error transmitting 'config.h'" '(should have been 7687 characters)'
fi
fi
exit 0
#	End of shell archive

oswald@rama.cpe.TANDY.COM (08/21/87)

[...]

Works great!  Thanks Paul (tif).


I have been running nethack since the new Makefile was posted.  The only
problem I found was when applying the pick_axe and digging, nethack
would dump core in apply.c.
By the way I am running nethack on a Tandy 3000HD under Tandy Xenix System V.

Good thing it was easy to fix, just change the Makefile from:

apply.o:  hack.h edog.h mkroom.h
	cc ${CFLAGS} -ND DAUXDATA -c apply.c

To:

apply.o:  hack.h edog.h mkroom.h
#	cc ${CFLAGS} -ND DAUXDATA -c apply.c

Now rm apply.o and make.


/*
Roy W. Oswald				
convex!ctvax!trsvax!cpe!oswald
decvax!microsoft!trsvax!cpe!oswald
ihnp4!sys1!cpe!oswald
allegra!convex!infoswx!hal6000!cpe!oswald
*/