[comp.sources.d] Compilation of Nethack 2.2

srp@ethz.UUCP (Scott Presnell) (12/08/87)

In article <9714@shemp.UCLA.EDU> claus@CS.UCLA.EDU (Claus Giloi) writes:

>I just downloaded Nethack 2.2 from the net and compiled it on my AT
>at home.
>There were only a few small problems, then it came to linking the 
>monster. An executable was produced, but I get a "Stack Overflow" 
>error when I try to run the 350K executable, and changing the
>value of (STACK:) to outlandish figures (8000, 3fff) didn't change
>that. Someone out there must have gotten it to run, please tell me
>what value you used to link it. (I am using MSC 4.0)

Here's the makefile that I used to get Nethack up under MSC 4.0... NB: the
CFLAGS macro and the link command.  I was able to play a couple of levels
without stack errors or hangups, however there are some problems,
(everything seems to be identified, inventory not displayed correctly,
color not quite right (but overall it works)) so i did not "install" it.

"good luck, jim"

Scott Presnell 						Organic Chemistry
Swiss Federal Institute of Technology  (ETH-Zentrum)
CH-8092 Zurich, Switzerland.
uucp:seismo!mcvax!cernvax!ethz!srp (srp@ethz.uucp); bitnet:Benner@CZHETH5A



#	SCCS Id: @(#)Makefile.pc	2.2	87/11/11
# 	Makefile for NetHack (PC) version 1.0 written using
#	Microsoft(tm) "C" v3.0 or better.
# 
# Large memory model, register bug, remove stack probes:
WIZARD=
V = 22
#CFLAGS = -A$(MODEL) -DREGBUG -DLINT_ARGS -DVER=$V $(WIZARD) -Ot -Gs -Gt100
CFLAGS = -nologo -A$(MODEL) -DLINT_ARGS -DVER=$V -Ox -Gt10
CC = cl
LIBS =
LFLAGS =
MODEL = L
SETARGV = #$(LIB)\$(MODEL)SETARGV
.SUFFIXES: .exe .obj .c
.c.obj:; cl $(CFLAGS) -c $*.c
.c.exe:;
    cl $(CFLAGS) -c $*.c
    link $*.obj $(SETARGV), $@,, $(LIBS) $(LFLAGS);

# The game name
GAME = hack.exe

# The game directory
GAMEDIR = \h

# All object modules
OBJS = decl.obj apply.obj bones.obj cmd.obj do.obj dothrow.obj\
	do_name.obj do_wear.obj dog.obj dogmove.obj eat.obj end.obj \
	engrave.obj fight.obj fountain.obj hack.obj invent.obj \
	lev.obj main.obj makemon.obj mhitu.obj mklev.obj \
	mkmaze.obj mkobj.obj mkshop.obj mon.obj monmove.obj\
	monst.obj o_init.obj objnam.obj options.obj \
	pager.obj polyself.obj potion.obj pray.obj pri.obj prisym.obj\
	read.obj rip.obj rumors.obj save.obj \
	search.obj shk.obj shknam.obj sit.obj spell.obj steal.obj \
	termcap.obj timeout.obj topl.obj topten.obj track.obj trap.obj \
	tty.obj unix.obj u_init.obj vault.obj wield.obj \
	wizard.obj worm.obj worn.obj write.obj zap.obj \
	version.obj rnd.obj alloc.obj msdos.obj

# The main target - you may want to try both of these alternatives.
#
$(GAME) : $(OBJS)
#	link $(OBJS), $(GAME) /NOIG /STACK:4000 /CP:1;
	link $(OBJS), $(GAME) /NOIG /STACK:10000 /SEG:512;
	

#	variable auxilary files.
#
VARAUX = data rumors

install : $(GAME) $(VARAUX)
	- exepack $(GAME) $(GAMEDIR)\$(GAME)
	- exemod $(GAMEDIR)\$(GAME) /max 1

clean :
	erase $(GAME)

spotless: clean
	erase *.obj
	erase main.c
	erase tty.c
	erase unix.c

srcs :
	copy makefile \tmp
	copy *.c \tmp
	copy *.h \tmp
	copy \local\make\make.doc \tmp
	copy \local\make\make.ini \tmp
	copy \bin\make.exe \tmp
	cd \tmp
	time
	touch *.*
	arc m hack$Vs * *.*
	cd $(CWD)


#	Other dependencies
#
RUMORFILES= rumors.bas rumors.kaa rumors.mrx

makedefs.exe:	makedefs.c alloc.obj config.h
	cl -AL makedefs.c alloc.obj


rumors :  config.h $(RUMORFILES) makedefs.exe
	makedefs.exe -r

data :  config.h data.bas makedefs.exe
	makedefs.exe -d

onames.h :  config.h objects.h makedefs.exe
	makedefs.exe -o

#	Below is a kluge.  date.h should actually depend on any source
#	module being changed. (but hack.h is close enough for most).
#
date.h :  hack.h makedefs.exe
	makedefs.exe -D

trap.h :  config.h makedefs.exe
	makedefs.exe -t

main.obj :  pcmain.c hack.h
	$(CC) $(CFLAGS) -Fo$@ -c pcmain.c

tty.obj :  pctty.c hack.h msdos.h
	$(CC) $(CFLAGS) -Fo$@ -c pctty.c

unix.obj :  pcunix.c hack.h mkroom.h
	$(CC) $(CFLAGS) -Fo$@ -c pcunix.c

decl.obj :  hack.h mkroom.h
apply.obj :  hack.h edog.h mkroom.h
bones.obj :  hack.h
hack.obj :  hack.h
cmd.obj :  hack.h func_tab.h
do.obj :  hack.h
do_name.obj :  hack.h
do_wear.obj :  hack.h
dog.obj :  hack.h edog.h mkroom.h
dogmove.obj :  hack.h mfndpos.h edog.h mkroom.h
dothrow.obj :  hack.h
eat.obj :  hack.h
end.obj :  hack.h
engrave.obj :  hack.h
fight.obj :  hack.h
fountain.obj :  hack.h mkroom.h
invent.obj :  hack.h wseg.h
ioctl.obj :  config.h
lev.obj :  hack.h mkroom.h wseg.h
makemon.obj :  hack.h
mhitu.obj :  hack.h
mklev.obj :  hack.h mkroom.h
mkmaze.obj :  hack.h mkroom.h
mkobj.obj :  hack.h
mkshop.obj :  hack.h mkroom.h eshk.h
mon.obj :  hack.h mfndpos.h
monmove.obj :  hack.h mfndpos.h
monst.obj :  hack.h eshk.h
msdos.obj : msdos.h
o_init.obj :  config.h objects.h onames.h
objnam.obj :  hack.h
options.obj :  hack.h
pager.obj :  hack.h
polyself.obj : hack.h
potion.obj :  hack.h
pray.obj :  hack.h
pri.obj :  hack.h
prisym.obj :  hack.h wseg.h
read.obj :  hack.h
rip.obj :  hack.h
rumors.obj :  hack.h
save.obj :  hack.h
search.obj :  hack.h
shk.obj :  hack.h mfndpos.h mkroom.h eshk.h
shknam.obj :  hack.h
sit.obj : hack.h
spell.obj :  hack.h
steal.obj :  hack.h
termcap.obj :  hack.h
timeout.obj :  hack.h
topl.obj :  hack.h
topten.obj :  hack.h
track.obj :  hack.h
trap.obj :  hack.h edog.h mkroom.h
u_init.obj :  hack.h
vault.obj :  hack.h mkroom.h
wield.obj :  hack.h
wizard.obj :  hack.h
worm.obj :  hack.h wseg.h
worn.obj :  hack.h
write.obj :  hack.h
zap.obj :  hack.h
version.obj :  hack.h date.h
extern.h: config.h spell.h obj.h
	touch extern.h
hack.h: extern.h flag.h gold.h monst.h objclass.h rm.h trap.h you.h 
	touch hack.h
objects.h:  config.h objclass.h
	touch objects.h
you.h: config.h onames.h permonst.h 
	touch you.h