Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Open Watcom?

1 view
Skip to first unread message

loomer

unread,
Mar 9, 2003, 4:40:12 AM3/9/03
to
Anyone made a successful build with the (now really) Open Watcom compiler?

Since it's free, it should be pretty interesting to try to port it to that
environment. I'm working on it but it has been about 10 years since I last
worked with Watcom products (when they had a top-notch optimizing C
compiler), so it's taking some time (have to remember those wcc/wmake/wlib
options ...).

Is anyone else working on this?

Rgds,

Loomer


billu

unread,
Mar 9, 2003, 9:07:19 AM3/9/03
to

"loomer" <loo...@vpizza.net> wrote in message
news:0_Daa.13886$FF4.6...@newsb.telia.net...
Who distributes this? I know Watcom was bought out by PowerSoft which was
bought out by Sybase (I work for Sybase). We were lamenting the death of
watcom C ++ just the other day. So I am wondering. Thanks.


loomer

unread,
Mar 9, 2003, 3:29:38 PM3/9/03
to
"billu" wrote

SciTech and ... Sybase ;)

See http://www.openwatcom.org


Ray Chason

unread,
Mar 9, 2003, 11:24:27 PM3/9/03
to
"loomer" <loo...@vpizza.net> wrote:

As it happens, I had this compiled and under test when 3.4.1 came out. :-/
Right now I'm focusing on Spanish Nethack, but once that goes gold, I
suppose I can post a patch.

It does take a few tweaks to the code, and of course a new Makefile.
The big one is that a variable called "lock" conflicts with a function
defined in the OpenWatcom headers. I renamed it to "lockfile."

It's way past my bedtime, and I don't really have time to post a full
patch for 3.4.0 (and anyway my test-game isn't yet finished). Nonetheless,
here's the Makefile; it's for 3.4.0 but it just may work with 3.4.1 once
you have all the other stuff ironed out. Again, rename "lock" to "lockfile"
on all platforms; the rest of the changes are minor, and are left as an
exercise for the reader.

--CUT HERE--CUT HERE--CUT HERE--CUT HERE--CUT HERE--CUT HERE--CUT HERE--
# SCCS Id: @(#)Makefile.nt 3.4 2002/02/28
# Copyright (c) NetHack PC Development Team 1993-2001
#
# NetHack 3.4.x Makefile for MS Visual C++ V6.x and above and MS NMAKE
#
# Win32 Compilers Tested:
# - Microsoft 32 bit Visual C++ V4.x
# - Microsoft 32 bit Visual C++ V6.0 SP3, SP4
#
# This is used for building a TTY version of NetHack using WIN32 Console
# I/O routines only.
#
# In addition to your C compiler,
#
# if you want to change you will need a
# files with suffix workalike for
# .y yacc (such as bison)
# .l lex (such as flex)
#
#
# If you have any questions read the sys/winnt/Install.nt file included
# with the distribution.
# --
# Michael Allison
#==============================================================================

# Graphical interface
# Set to Y for a graphical version

#GRAPHICAL = Y

#
# Set the gamedir according to your preference.
# If not present prior to compilation it gets created.

GAME = NetHack # Game Name
GAMEDIR = ..\binary # Game directory

#
# Source directories. Makedefs hardcodes these, don't change them.
#

INCL = ..\include # NetHack include files
DAT = ..\dat # NetHack data files
DOC = ..\doc # NetHack documentation files
UTIL = ..\util # Utility source
SRC = ..\src # Main source
SSYS = ..\sys\share # Shared system files
NTSYS = ..\sys\winnt # NT Win32 specific files
TTY = ..\win\tty # window port files (tty)
WIN32 = ..\win\win32 # window port files (Win32)
WSHR = ..\win\share # Tile support files

#
# Object directory.
#

OBJ = o

#
# Identify the tools
#
CC = cl386
LINK = link386
RC = rc

#
#==========================================
# Exe File Info.
#==========================================

# Yacc/Lex ... if you got 'em.
#
# If you have yacc and lex programs (or work-alike such as bison
# and flex), comment out the upper two macros and uncomment
# the lower two.
#

DO_YACC = YACC_MSG
DO_LEX = LEX_MSG
#DO_YACC = YACC_ACT
#DO_LEX = LEX_ACT

# - Specify your yacc and lex programs (or work-alikes) here.

#YACC = bison -y
YACC = byacc
#YACC = yacc

#LEX = lex
LEX = flex

#
# - Specify your flex skeleton file (if needed).
#

FLEXSKEL =
#FLEXSKEL = -S../tools/flex.ske

YTABC = y_tab.c
YTABH = y_tab.h
LEXYYC = lexyy.c

#
# Optional high-quality BSD random number generation routines
# (see pcconf.h). Set to nothing if not used.
#

RANDOM = $(OBJ)\random.obj
#RANDOM =

#
# - For debugging ability, comment out the upper two
# macros and uncomment the lower two.
#

#
# Leave the next two lines uncommented _ONLY_ if you do NOT want any
# debug capability in the object files, or in the NetHack executable.
# Comment them if you want debug capability.

#cdebug =
#linkdebug =

#
# Compiler and Linker flags
#

PRECOMPHEAD = N # set to Y if you want to use precomp. headers

#===============================================
#======= End of Modification Section ===========
#===============================================
################################################
# #
# Nothing below here should have to be changed.#
# #
################################################

!IF "$(GRAPHICAL)" == "Y"
WINPORT = $(O)tile.obj $(O)mhaskyn.obj $(O)mhdlg.obj &
$(O)mhfont.obj $(O)mhinput.obj $(O)mhmain.obj $(O)mhmap.obj &
$(O)mhmenu.obj $(O)mhmsgwnd.obj $(O)mhrip.obj $(O)mhsplash.obj &
$(O)mhstatus.obj $(O)mhtext.obj $(O)mswproc.obj $(O)winhack.obj
WINPFLAG = -DTILES -DMSWIN_GRAPHICS
NHRES = $(O)winhack.res
WINPINC = -I$(WIN32)
WINPHDR = $(WIN32)\mhaskyn.h $(WIN32)\mhdlg.h $(WIN32)\mhfont.h &
$(WIN32)\mhinput.h $(WIN32)\mhmain.h $(WIN32)\mhmap.h $(WIN32)\mhmenu.h &
$(WIN32)\mhmsg.h $(WIN32)\mhmsgwnd.h $(WIN32)\mhrip.h $(WIN32)\mhstatus.h &
$(WIN32)\mhtext.h $(WIN32)\resource.h $(WIN32)\winMS.h
!ELSE
WINPORT = $(O)nttty.obj
WINPFLAG = -DWIN32CON
WINPHDR =
NHRES = $(O)console.res
WINPINC =
!ENDIF

TILEUTIL16 = $(UTIL)\tile2bmp.exe
TILEBMP16 = $(SRC)\tiles.bmp

TILEUTIL32 = $(UTIL)\til2bm32.exe
TILEBMP32 = $(SRC)\tiles32.bmp

#SOUND = $(OBJ)\ntsound.obj

#SOUND =

# To store all the level files,
# help files, etc. in a single library file.
# USE_DLB = Y is left uncommented

USE_DLB = Y

! IF ("$(USE_DLB)"=="Y")
DLBFLG = -DDLB
! ELSE
DLBFLG =
! ENDIF

#==========================================
# Setting up the compiler and linker
# macros. All builds include the base ones.
#==========================================

CFLAGSBASE = -c $(cflags0) $(cvarsmt) -I$(INCL) -nologo $(cdebug) $(WINPINC)
LFLAGSBASEC = $(linkdebug) /NODEFAULTLIB /INCREMENTAL:NO /RELEASE /NOLOGO -subsystem:console,4.0 $(conlibsmt)
LFLAGSBASEG = $(linkdebug) $(guiflags) $(guilibsmt) comctl32.lib

#==========================================
# Util builds
#==========================================

CFLAGSU = $(CFLAGSBASE) $(WINPFLAG)
LFLAGSU = $(LFLAGSBASEC)

#==========================================
# - Game build
#==========================================
LFLAGSBASE = $(linkdebug) /NODEFAULTLIB /INCREMENTAL:NO /RELEASE /NOLOGO -subsystem:console,4.0 $(conlibsmt)
CFLAGS = $(CFLAGSBASE) $(WINPFLAG) $(DLBFLG)
NHLFLAGS1 = /NODEFAULTLIB /INCREMENTAL:NO /PDB:"$(GAME).PDB" /RELEASE /NOLOGO
NHLFLAGS2 = /MAP:"$(GAME).MAP" /MACHINE:$(CPU) -IGNORE:505
!IF ("$(GRAPHICAL)"=="Y")
LFLAGS = $(LFLAGSBASEG) $(NHLFLAGS1) $(NHLFLAGS2)
!ELSE
LFLAGS = $(LFLAGSBASEC) $(NHLFLAGS1) $(NHLFLAGS2)
!ENDIF

GAMEFILE = $(GAMEDIR)\$(GAME).exe # whole thing

! IF ("$(USE_DLB)"=="Y")
DLB = nhdat
! ELSE
DLB =
! ENDIF

#==========================================
#================ RULES ==================
#==========================================

.SUFFIXES: .til .uu .y .l

#==========================================
# Rules for files in src
#==========================================

.c{$(OBJ)}.obj:
@$(cc) $(CFLAGS) -Fo$^@ $[@

{$(SRC)}.c{$(OBJ)}.obj:
@$(CC) $(CFLAGS) -Fo$^@ $[@

#==========================================
# Rules for files in sys\share
#==========================================

{$(SSYS)}.c{$(OBJ)}.obj:
@$(CC) $(CFLAGS) -Fo$^@ $[@

#==========================================
# Rules for files in sys\winnt
#==========================================

{$(NTSYS)}.c{$(OBJ)}.obj:
@$(CC) $(CFLAGS) -Fo$^@ $[@

{$(NTSYS)}.h{$(INCL)}.h:
@copy $[@ $^@

#==========================================
# Rules for files in util
#==========================================

{$(UTIL)}.c{$(OBJ)}.obj:
@$(CC) $(CFLAGSU) -Fo$^@ $[@

#==========================================
# Rules for files in win\share
#==========================================

{$(WSHR)}.c{$(OBJ)}.obj:
@$(CC) $(CFLAGS) -Fo$^@ $[@

{$(WSHR)}.h{$(INCL)}.h:
@copy $[@ $^@

#{$(WSHR)}.txt{$(DAT)}.txt:
# @copy $[@ $^@

#==========================================
# Rules for files in win\tty
#==========================================

{$(TTY)}.c{$(OBJ)}.obj:
@$(CC) $(CFLAGS) -Fo$^@ $[@


#==========================================
# Rules for files in win\win32
#==========================================

{$(WIN32)}.c{$(OBJ)}.obj:
@$(cc) $(CFLAGS) -Fo$^@ $[@

#==========================================
#================ MACROS ==================
#==========================================
# This section creates shorthand macros for many objects
# referenced later on in the Makefile.
#

DEFFILE = $(NTSYS)\$(GAME).def

#
# Shorten up the location for some files
#

O = $(OBJ)\

U = $(UTIL)\

#
# Utility Objects.
#

MAKESRC = $(U)makedefs.c

SPLEVSRC = $(U)lev_yacc.c $(U)lev_$(LEX).c $(U)lev_main.c $(U)panic.c

DGNCOMPSRC = $(U)dgn_yacc.c $(U)dgn_$(LEX).c $(U)dgn_main.c

MAKEOBJS = $(O)makedefs.obj $(O)monst.obj $(O)objects.obj

SPLEVOBJS = $(O)lev_yacc.obj $(O)lev_$(LEX).obj $(O)lev_main.obj &
$(O)alloc.obj $(O)decl.obj $(O)drawing.obj &
$(O)monst.obj $(O)objects.obj $(O)panic.obj

DGNCOMPOBJS = $(O)dgn_yacc.obj $(O)dgn_$(LEX).obj $(O)dgn_main.obj &
$(O)alloc.obj $(O)panic.obj

RECOVOBJS = $(O)recover.obj

TILEFILES = $(WSHR)\monsters.txt $(WSHR)\objects.txt $(WSHR)\other.txt

#
# These are not invoked during a normal game build in 3.4.0
#
TEXT_IO = $(O)tiletext.obj $(O)tiletxt.obj $(O)drawing.obj &
$(O)decl.obj $(O)monst.obj $(O)objects.obj

TEXT_IO32 = $(O)tilete32.obj $(O)tiletx32.obj $(O)drawing.obj &
$(O)decl.obj $(O)monst.obj $(O)objects.obj

GIFREADERS = $(O)gifread.obj $(O)alloc.obj $(O)panic.obj
GIFREADERS32 = $(O)gifrd32.obj $(O)alloc.obj $(O)panic.obj

PPMWRITERS = $(O)ppmwrite.obj $(O)alloc.obj $(O)panic.obj

#
# Object files for the game itself.
#

VOBJ01 = $(O)allmain.obj $(O)alloc.obj $(O)apply.obj $(O)artifact.obj
VOBJ02 = $(O)attrib.obj $(O)ball.obj $(O)bones.obj $(O)botl.obj
VOBJ03 = $(O)cmd.obj $(O)dbridge.obj $(O)decl.obj $(O)detect.obj
VOBJ04 = $(O)dig.obj $(O)display.obj $(O)do.obj $(O)do_name.obj
VOBJ05 = $(O)do_wear.obj $(O)dog.obj $(O)dogmove.obj $(O)dokick.obj
VOBJ06 = $(O)dothrow.obj $(O)drawing.obj $(O)dungeon.obj $(O)eat.obj
VOBJ07 = $(O)end.obj $(O)engrave.obj $(O)exper.obj $(O)explode.obj
VOBJ08 = $(O)extralev.obj $(O)files.obj $(O)fountain.obj $(O)hack.obj
VOBJ09 = $(O)hacklib.obj $(O)invent.obj $(O)light.obj $(O)lock.obj
VOBJ10 = $(O)mail.obj $(O)pcmain.obj $(O)makemon.obj $(O)mapglyph.obj $(O)mcastu.obj
VOBJ11 = $(O)mhitm.obj $(O)mhitu.obj $(O)minion.obj $(O)mklev.obj
VOBJ12 = $(O)mkmap.obj $(O)mkmaze.obj $(O)mkobj.obj $(O)mkroom.obj
VOBJ13 = $(O)mon.obj $(O)mondata.obj $(O)monmove.obj $(O)monst.obj
VOBJ14 = $(O)monstr.obj $(O)mplayer.obj $(O)mthrowu.obj $(O)muse.obj
VOBJ15 = $(O)music.obj $(O)o_init.obj $(O)objects.obj $(O)objnam.obj
VOBJ16 = $(O)options.obj $(O)pager.obj $(O)pickup.obj $(O)pline.obj
VOBJ17 = $(O)polyself.obj $(O)potion.obj $(O)pray.obj $(O)priest.obj
VOBJ18 = $(O)quest.obj $(O)questpgr.obj $(RANDOM) $(O)read.obj
VOBJ19 = $(O)rect.obj $(O)region.obj $(O)restore.obj $(O)rip.obj
VOBJ20 = $(O)rnd.obj $(O)role.obj $(O)rumors.obj $(O)save.obj
VOBJ21 = $(O)shk.obj $(O)shknam.obj $(O)sit.obj $(O)sounds.obj
VOBJ22 = $(O)sp_lev.obj $(O)spell.obj $(O)steal.obj $(O)steed.obj
VOBJ23 = $(O)teleport.obj $(O)timeout.obj $(O)topten.obj $(O)track.obj
VOBJ24 = $(O)trap.obj $(O)u_init.obj $(O)uhitm.obj $(O)vault.obj
VOBJ25 = $(O)vis_tab.obj $(O)vision.obj $(O)weapon.obj $(O)were.obj
VOBJ26 = $(O)wield.obj $(O)windows.obj $(O)wizard.obj $(O)worm.obj
VOBJ27 = $(O)worn.obj $(O)write.obj $(O)zap.obj

DLBOBJ = $(O)dlb.obj

TTYOBJ = $(O)topl.obj $(O)getline.obj $(O)wintty.obj

SOBJ = $(O)winnt.obj $(O)pcsys.obj $(O)pcunix.obj &
$(SOUND) $(O)mapimail.obj $(O)nhlan.obj

OBJS = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) &
$(VOBJ06) $(VOBJ07) $(VOBJ08) $(VOBJ09) $(VOBJ10) &
$(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) &
$(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) &
$(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) &
$(VOBJ26) $(VOBJ27)

WINPOBJ = $(WINPORT)

VVOBJ = $(O)version.obj

ALLOBJ = $(WINPOBJ) $(SOBJ) $(DLBOBJ) $(TTYOBJ) $(WOBJ) $(OBJS) $(VVOBJ)

!IF "$(GRAPHICAL)" == "Y"
OPTIONS_FILE = $(DAT)\guioptions
!ELSE
OPTIONS_FILE = $(DAT)\ttyoptions
!ENDIF
#==========================================
# Header file macros
#==========================================

CONFIG_H = $(INCL)\config.h $(INCL)\config1.h $(INCL)\tradstdc.h &
$(INCL)\global.h $(INCL)\coord.h $(INCL)\vmsconf.h &
$(INCL)\system.h $(INCL)\unixconf.h $(INCL)\os2conf.h &
$(INCL)\micro.h $(INCL)\pcconf.h $(INCL)\tosconf.h &
$(INCL)\amiconf.h $(INCL)\macconf.h $(INCL)\beconf.h &
$(INCL)\ntconf.h $(INCL)\nhlan.h

HACK_H = $(INCL)\hack.h $(CONFIG_H) $(INCL)\align.h &
$(INCL)\dungeon.h $(INCL)\monsym.h $(INCL)\mkroom.h &
$(INCL)\objclass.h $(INCL)\youprop.h $(INCL)\prop.h &
$(INCL)\permonst.h $(INCL)\monattk.h &
$(INCL)\monflag.h $(INCL)\mondata.h $(INCL)\pm.h &
$(INCL)\wintype.h $(INCL)\decl.h $(INCL)\quest.h &
$(INCL)\spell.h $(INCL)\color.h $(INCL)\obj.h &
$(INCL)\you.h $(INCL)\attrib.h $(INCL)\monst.h &
$(INCL)\skills.h $(INCL)\onames.h $(INCL)\timeout.h &
$(INCL)\trap.h $(INCL)\flag.h $(INCL)\rm.h &
$(INCL)\vision.h $(INCL)\display.h $(INCL)\engrave.h &
$(INCL)\rect.h $(INCL)\region.h $(INCL)\winprocs.h &
$(INCL)\wintty.h $(INCL)\trampoli.h

LEV_H = $(INCL)\lev.h
DGN_FILE_H = $(INCL)\dgn_file.h
LEV_COMP_H = $(INCL)\lev_comp.h
SP_LEV_H = $(INCL)\sp_lev.h
TILE_H = ..\win\share\tile.h

#==========================================
# Miscellaneous
#==========================================

DATABASE = $(DAT)\data.base

#
# The name of the game.
#

GAMEFILE = $(GAMEDIR)\$(GAME).exe

#==========================================
#=============== TARGETS ==================
#==========================================

#
# The default make target (so just typing 'nmake' is useful).
#
default : $(GAMEFILE)

#
# The main target.
#

$(GAME): $(O)obj.tag $(O)utility.tag envchk $(GAMEFILE)
@echo $(GAME) is up to date.

#
# Everything
#

all : install

install: envchk $(GAME) $(O)install.tag
@echo Done.

$(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon &
$(DAT)\oracles $(DAT)\quest.dat $(O)sp_lev.tag $(DLB)
! IF ("$(USE_DLB)"=="Y")
copy nhdat $(GAMEDIR)
copy $(DAT)\license $(GAMEDIR)
! ELSE
copy $(DAT)\*. $(GAMEDIR)
copy $(DAT)\*.dat $(GAMEDIR)
copy $(DAT)\*.lev $(GAMEDIR)
if exist $(GAMEDIR)\makefile del $(GAMEDIR)\makefile
! ENDIF
if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt
if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt
if exist $(DOC)\recover.txt copy $(DOC)\recover.txt $(GAMEDIR)\recover.txt
@if exist $(SRC)\$(GAME).PDB copy $(SRC)\$(GAME).pdb $(GAMEDIR)\$(GAME).pdb
@if exist $(GAMEDIR)\$(GAME).PDB echo NOTE: You may want to remove $(GAMEDIR)\$(GAME).pdb to conserve space
-copy $(NTSYS)\defaults.nh $(GAMEDIR)\defaults.nh
copy $(U)recover.exe $(GAMEDIR)
echo install done > $^@

# copy $(NTSYS)\winnt.hlp $(GAMEDIR)

$(O)sp_lev.tag: $(O)utility.tag $(DAT)\bigroom.des $(DAT)\castle.des &
$(DAT)\endgame.des $(DAT)\gehennom.des $(DAT)\knox.des &
$(DAT)\medusa.des $(DAT)\oracle.des $(DAT)\tower.des &
$(DAT)\yendor.des $(DAT)\arch.des $(DAT)\barb.des &
$(DAT)\caveman.des $(DAT)\healer.des $(DAT)\knight.des &
$(DAT)\monk.des $(DAT)\priest.des $(DAT)\ranger.des &
$(DAT)\rogue.des $(DAT)\samurai.des $(DAT)\sokoban.des &
$(DAT)\tourist.des $(DAT)\valkyrie.des $(DAT)\wizard.des
cd $(DAT)
$(U)lev_comp bigroom.des
$(U)lev_comp castle.des
$(U)lev_comp endgame.des
$(U)lev_comp gehennom.des
$(U)lev_comp knox.des
$(U)lev_comp mines.des
$(U)lev_comp medusa.des
$(U)lev_comp oracle.des
$(U)lev_comp sokoban.des
$(U)lev_comp tower.des
$(U)lev_comp yendor.des
$(U)lev_comp arch.des
$(U)lev_comp barb.des
$(U)lev_comp caveman.des
$(U)lev_comp healer.des
$(U)lev_comp knight.des
$(U)lev_comp monk.des
$(U)lev_comp priest.des
$(U)lev_comp ranger.des
$(U)lev_comp rogue.des
$(U)lev_comp samurai.des
$(U)lev_comp tourist.des
$(U)lev_comp valkyrie.des
$(U)lev_comp wizard.des
cd $(SRC)
echo sp_levs done > $(O)sp_lev.tag

$(O)utility.tag: $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h &
$(SRC)\monstr.c $(SRC)\vis_tab.c &
$(U)lev_comp.exe $(INCL)\vis_tab.h &
$(U)dgn_comp.exe $(U)recover.exe
@echo utilities made >$^@
@echo utilities made.

tileutil: $(U)gif2txt.exe $(U)gif2tx32.exe $(U)txt2ppm.exe
@echo Optional tile development utilities are up to date.

!IF "$(GRAPHICAL)"=="Y"
$(NHRES): $(TILEBMP16) $(WIN32)\winhack.rc $(WIN32)\mnsel.bmp &
$(WIN32)\mnselcnt.bmp $(WIN32)\mnunsel.bmp &
$(WIN32)\petmark.bmp $(WIN32)\NetHack.ico $(WIN32)\rip.bmp &
$(WIN32)\splash.bmp
@$(rc) -r -fo$^@ -i$(WIN32) -dNDEBUG $(WIN32)\winhack.rc
!ELSE
$(NHRES): $(NTSYS)\console.rc $(NTSYS)\NetHack.ico
@$(rc) -r -fo$^@ -i$(NTSYS) -dNDEBUG $(NTSYS)\console.rc
!ENDIF

#==========================================
# The main target.
#==========================================

# The section for linking the NetHack image looks a little strange at
# first, especially if you are used to UNIX makes, or NDMAKE. It is
# Microsoft nmake specific, and it gets around the problem of the
# link command line being too long for the linker. An "in-line" linker
# response file is generated temporarily.
#
# It takes advantage of the following features of nmake:
#
# Inline files :
# Specifying the "<<" means to start an inline file.
# Another "<<" at the start of a line closes the
# inline file.
#
# Substitution within Macros:
# $(mymacro:string1=string2) replaces every
# occurrence of string1 with string2 in the
# macro mymacro. Special ascii key codes may be
# used in the substitution text by preceding it
# with ^ as we have done below. Every occurence
# of a <tab> in $(ALLOBJ) is replaced by
# <+><return><tab>.
#
# DO NOT INDENT THE << below!
#

$(GAMEFILE) : $(ALLOBJ) $(NHRES)
@if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR)
@echo Linking....
$(link) $(LFLAGS) -out:$^@ @<<$(GAME).lnk
$(ALLOBJ:^ =^
) $(NHRES)
<<
@if exist $(O)install.tag del $(O)install.tag
@if exist $(GAMEDIR)\$(GAME).bak del $(GAMEDIR)\$(GAME).bak

#
# Secondary Targets.
#

#==========================================
# Makedefs Stuff
#==========================================

$(U)makedefs.exe: $(MAKEOBJS)
@$(link) $(LFLAGSU) -out:$^@ $(MAKEOBJS)

$(O)makedefs.obj: $(CONFIG_H) $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\objclass.h &
$(INCL)\monsym.h $(INCL)\qtext.h $(INCL)\patchlevel.h &
$(U)makedefs.c
@if not exist $(OBJ)\*.* echo creating directory $(OBJ)
@if not exist $(OBJ)\*.* mkdir $(OBJ)
@$(CC) $(CFLAGSU) -Fo$^@ $(U)makedefs.c

#
# date.h should be remade every time any of the source or include
# files is modified.
#

$(INCL)\date.h $(OPTIONS_FILE) : $(U)makedefs.exe
$(U)makedefs -v

$(INCL)\onames.h : $(U)makedefs.exe
$(U)makedefs -o

$(INCL)\pm.h : $(U)makedefs.exe
$(U)makedefs -p

#$(INCL)\trap.h : $(U)makedefs.exe
# $(U)makedefs -t

$(SRC)\monstr.c: $(U)makedefs.exe
$(U)makedefs -m

$(INCL)\vis_tab.h: $(U)makedefs.exe
$(U)makedefs -z

$(SRC)\vis_tab.c: $(U)makedefs.exe
$(U)makedefs -z

#==========================================
# uudecode utility and uuencoded targets
#==========================================

$(U)uudecode.exe: $(O)uudecode.obj
@$(link) $(LFLAGSU) -out:$^@ $(O)\uudecode.obj

$(O)uudecode.obj: $(SSYS)\uudecode.c

$(NTSYS)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu
chdir $(NTSYS)
..\..\util\uudecode.exe nhico.uu
chdir ..\..\src

$(WIN32)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu
chdir $(WIN32)
..\..\util\uudecode.exe ../../sys/winnt/nhico.uu
chdir ..\..\src

$(WIN32)\mnsel.bmp: $(U)uudecode.exe $(WIN32)\mnsel.uu
chdir $(WIN32)
..\..\util\uudecode.exe mnsel.uu
chdir ..\..\src

$(WIN32)\mnselcnt.bmp: $(U)uudecode.exe $(WIN32)\mnselcnt.uu
chdir $(WIN32)
..\..\util\uudecode.exe mnselcnt.uu
chdir ..\..\src

$(WIN32)\mnunsel.bmp: $(U)uudecode.exe $(WIN32)\mnunsel.uu
chdir $(WIN32)
..\..\util\uudecode.exe mnunsel.uu
chdir ..\..\src

$(WIN32)\petmark.bmp: $(U)uudecode.exe $(WIN32)\petmark.uu
chdir $(WIN32)
..\..\util\uudecode.exe petmark.uu
chdir ..\..\src

$(WIN32)\rip.bmp: $(U)uudecode.exe $(WIN32)\rip.uu
chdir $(WIN32)
..\..\util\uudecode.exe rip.uu
chdir ..\..\src

$(WIN32)\splash.bmp: $(U)uudecode.exe $(WIN32)\splash.uu
chdir $(WIN32)
..\..\util\uudecode.exe splash.uu
chdir ..\..\src

#==========================================
# Level Compiler Stuff
#==========================================

LEVCFLAGS=-c -nologo -DWINVER=0x0400 -DWIN32 -D_WIN32 &
-D_MT -MT -I..\include -nologo -Z7 -Od -DDLB

$(U)lev_comp.exe: $(SPLEVOBJS)
@echo Linking $^@...
@$(link) $(LFLAGSU) -out:$^@ @<<$(@B).lnk
$(SPLEVOBJS:^ =^
)
<<

$(O)lev_yacc.obj: $(HACK_H) $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c
@$(CC) $(LEVCFLAGS) -W0 -Fo$^@ $(U)lev_yacc.c

$(O)lev_$(LEX).obj: $(HACK_H) $(INCL)\lev_comp.h $(SP_LEV_H) &
$(U)lev_$(LEX).c
@$(CC) $(LEVCFLAGS) -W0 -Fo$^@ $(U)lev_$(LEX).c

$(O)lev_main.obj: $(U)lev_main.c $(HACK_H) $(SP_LEV_H)
@$(CC) $(LEVCFLAGS) -W0 -Fo$^@ $(U)lev_main.c


$(U)lev_yacc.c $(INCL)\lev_comp.h : $(U)lev_comp.y
! IF "$(DO_YACC)"=="YACC_ACT"
chdir $(UTIL)
$(YACC) -d lev_comp.y
copy $(YTABC) lev_yacc.c
copy $(YTABH) $(INCL)\lev_comp.h
@del $(YTABC)
@del $(YTABH)
chdir $(SRC)
! ELSE
@echo $(U)lev_comp.y has changed.
@echo To update $(U)lev_yacc.c and $(INCL)\lev_comp.h run $(YACC).
@echo ---
@echo For now, we will copy the prebuilt lev_yacc.c and
@echo lev_comp.h from $(SSYS) into $(UTIL) and use them.
@copy $(SSYS)\lev_yacc.c $(U)lev_yacc.c >nul
@copy $(SSYS)\lev_comp.h $(INCL)\lev_comp.h >nul
@echo /**/ >>$(U)lev_yacc.c
@echo /**/ >>$(INCL)\lev_comp.h
! ENDIF

$(U)lev_$(LEX).c: $(U)lev_comp.l
! IF "$(DO_LEX)"=="LEX_ACT"
chdir $(UTIL)
$(LEX) $(FLEXSKEL) lev_comp.l
copy $(LEXYYC) $^@
@del $(LEXYYC)
chdir $(SRC)
! ELSE
@echo $(U)lev_comp.l has changed. To update $^@ run $(LEX).
@echo ---
@echo For now, we will copy the prebuilt lev_lex.c
@echo from $(SSYS) into $(UTIL) and use it.
@copy $(SSYS)\lev_lex.c $^@ >nul
@echo /**/ >>$^@
! ENDIF

#==========================================
# Dungeon Compiler Stuff
#==========================================

$(U)dgn_comp.exe: $(DGNCOMPOBJS)
@echo Linking $^@...
@$(link) $(LFLAGSU) -out:$^@ @<<$(@B).lnk
$(DGNCOMPOBJS:^ =^
)
<<

$(O)dgn_yacc.obj: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h $(U)dgn_yacc.c
@$(CC) $(LEVCFLAGS) -W0 -Fo$^@ $(U)dgn_yacc.c

$(O)dgn_$(LEX).obj: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h &
$(U)dgn_$(LEX).c
@$(CC) $(LEVCFLAGS) -W0 -Fo$^@ $(U)dgn_$(LEX).c

$(O)dgn_main.obj: $(HACK_H) $(U)dgn_main.c
@$(CC) $(LEVCFLAGS) -W0 -Fo$^@ $(U)dgn_main.c

$(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y
! IF "$(DO_YACC)"=="YACC_ACT"
chdir $(UTIL)
$(YACC) -d dgn_comp.y
copy $(YTABC) dgn_yacc.c
copy $(YTABH) $(INCL)\dgn_comp.h
@del $(YTABC)
@del $(YTABH)
chdir $(SRC)
! ELSE
@echo $(U)dgn_comp.y has changed. To update dgn_yacc.c and
@echo $(INCL)\dgn_comp.h run $(YACC).
@echo ---
@echo For now, we will copy the prebuilt $(U)dgn_yacc.c and
@echo dgn_comp.h from $(SSYS) into $(UTIL) and use them.
@copy $(SSYS)\dgn_yacc.c $(U)dgn_yacc.c >nul
@copy $(SSYS)\dgn_comp.h $(INCL)\dgn_comp.h >nul
@echo /**/ >>$(U)dgn_yacc.c
@echo /**/ >>$(INCL)\dgn_comp.h
! ENDIF

$(U)dgn_$(LEX).c: $(U)dgn_comp.l
! IF "$(DO_LEX)"=="LEX_ACT"
chdir $(UTIL)
$(LEX) $(FLEXSKEL) dgn_comp.l
copy $(LEXYYC) $^@
@del $(LEXYYC)
chdir $(SRC)
! ELSE
@echo $(U)dgn_comp.l has changed. To update $^@ run $(LEX).
@echo ---
@echo For now, we will copy the prebuilt dgn_lex.c
@echo from $(SSYS) into $(UTIL) and use it.
@copy $(SSYS)\dgn_lex.c $^@ >nul
@echo /**/ >>$^@
! ENDIF

#==========================================
# Create directory for holding object files
#==========================================

$(O)obj.tag:
@if not exist $(OBJ)\*.* echo creating directory $(OBJ)
@if not exist $(OBJ)\*.* mkdir $(OBJ)
@echo directory created >$^@

#==========================================
# Notify of any CL environment variables
# in effect since they change the compiler
# options.
#==========================================

envchk:
! IF "$(CL)"!=""
@echo Warning, the CL Environment variable is defined:
@echo CL=$(CL)
! ENDIF
! IF "$(GRAPHICAL)"=="Y"
@echo ----
@echo NOTE: This build will include tile support.
@echo ----
! ENDIF

#==========================================
#=========== SECONDARY TARGETS ============
#==========================================

#===========================================
# Header files NOT distributed in ..\include
#===========================================

$(INCL)\win32api.h: $(NTSYS)\win32api.h
copy $(NTSYS)\win32api.h $^@


#==========================================
# DLB utility and nhdat file creation
#==========================================

$(U)dlb_main.exe: $(DLBOBJ) $(O)dlb.obj
@$(link) $(LFLAGSU) -out:$^@ @<<$(@B).lnk
$(O)dlb_main.obj
$(O)dlb.obj
$(O)alloc.obj
$(O)panic.obj
<<

$(O)dlb.obj: $(O)dlb_main.obj $(O)alloc.obj $(O)panic.obj $(INCL)\dlb.h
@$(CC) $(CFLAGS) /Fo$^@ $(SRC)\dlb.c

$(O)dlb_main.obj: $(UTIL)\dlb_main.c $(INCL)\config.h $(INCL)\dlb.h
@$(CC) $(CFLAGS) /Fo$^@ $(UTIL)\dlb_main.c

$(DAT)\porthelp: $(NTSYS)\porthelp
@copy $(NTSYS)\porthelp $^@ >nul

nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) &
$(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp &
$(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon $(DAT)\porthelp &
$(DAT)\license $(O)sp_lev.tag
cd $(DAT)
echo data >dlb.lst
echo oracles >>dlb.lst
if exist options echo options >>dlb.lst
if exist ttyoptions echo ttyoptions >>dlb.lst
if exist guioptions echo guioptions >>dlb.lst
if exist porthelp echo porthelp >>dlb.lst
echo quest.dat >>dlb.lst
echo rumors >>dlb.lst
echo help >>dlb.lst
echo hh >>dlb.lst
echo cmdhelp >>dlb.lst
echo history >>dlb.lst
echo opthelp >>dlb.lst
echo wizhelp >>dlb.lst
echo dungeon >>dlb.lst
echo license >>dlb.lst
for %%N in (*.lev) do echo %%N >>dlb.lst
$(U)dlb_main cIf dlb.lst $(SRC)\nhdat
cd $(SRC)

#==========================================
# Recover Utility
#==========================================

$(U)recover.exe: $(RECOVOBJS)
@$(link) $(LFLAGSU) -out:$^@ $(RECOVOBJS)

$(O)recover.obj: $(CONFIG_H) $(U)recover.c $(INCL)\win32api.h
@$(CC) $(CFLAGSU) -Fo$^@ $(U)recover.c

#==========================================
# Tile Mapping
#==========================================

$(SRC)\tile.c: $(U)tilemap.exe
@echo A new $^@ has been created
@$(U)tilemap

$(U)tilemap.exe: $(O)tilemap.obj
@$(link) $(LFLAGSU) -out:$^@ $(O)tilemap.obj

$(O)tilemap.obj: $(WSHR)\tilemap.c $(HACK_H)
@$(CC) $(CFLAGSU) -Fo$^@ $(WSHR)\tilemap.c

$(O)tiletx32.obj: $(WSHR)\tilemap.c $(HACK_H)
@$(CC) $(CFLAGS) /DTILETEXT /DTILE_X=32 /DTILE_Y=32 -Fo$^@ $(WSHR)\tilemap.c

$(O)tiletxt.obj: $(WSHR)\tilemap.c $(HACK_H)
@$(CC) $(CFLAGS) /DTILETEXT -Fo$^@ $(WSHR)\tilemap.c

$(O)gifread.obj: $(WSHR)\gifread.c $(CONFIG_H) $(TILE_H)
@$(CC) $(CFLAGS) -I$(WSHR) -Fo$^@ $(WSHR)\gifread.c

$(O)gifrd32.obj: $(WSHR)\gifread.c $(CONFIG_H) $(TILE_H)
@$(CC) $(CFLAGS) -I$(WSHR) /DTILE_X=32 /DTILE_Y=32 -Fo$^@ $(WSHR)\gifread.c

$(O)ppmwrite.obj: $(WSHR)\ppmwrite.c $(CONFIG_H) $(TILE_H)
@$(CC) $(CFLAGS) -I$(WSHR) -Fo$^@ $(WSHR)\ppmwrite.c

$(O)tiletext.obj: $(WSHR)\tiletext.c $(CONFIG_H) $(TILE_H)
@$(CC) $(CFLAGS) -I$(WSHR) -Fo$^@ $(WSHR)\tiletext.c

$(O)tilete32.obj: $(WSHR)\tiletext.c $(CONFIG_H) $(TILE_H)
@$(CC) $(CFLAGS) -I$(WSHR) /DTILE_X=32 /DTILE_Y=32 -Fo$^@ $(WSHR)\tiletext.c

#==========================================
# Optional Tile Utilities
#==========================================

$(U)gif2txt.exe: $(GIFREADERS) $(TEXT_IO)
@echo Linking $^@...
@$(link) $(LFLAGSU) -out:$^@ @<<$(@B).lnk
$(GIFREADERS:^ =^
)
$(TEXT_IO:^ =^
)
<<

$(U)gif2tx32.exe: $(GIFREADERS32) $(TEXT_IO32)
@echo Linking $^@...
@$(link) $(LFLAGSU) -out:$^@ @<<$(@B).lnk
$(GIFREADERS32:^ =^
)
$(TEXT_IO32:^ =^
)
<<

$(U)txt2ppm.exe: $(PPMWRITERS) $(TEXT_IO)
@echo Linking $^@...
@$(link) $(LFLAGSU) -out:$^@ @<<$(@B).lnk
$(PPMWRITERS:^ =^
)
$(TEXT_IO:^ =^
)
<<

!IF "$(GRAPHICAL)"=="Y"
$(TILEBMP16): $(TILEUTIL16) $(TILEFILES)
@echo Creating 16x16 binary tile files (this may take some time)
@$(U)tile2bmp $(TILEBMP16)
#$(TILEBMP32): $(TILEUTIL32) $(TILEFILES32)
# @echo Creating 32x32 binary tile files (this may take some time)
# @$(U)til2bm32 $(TILEBMP32)

!ELSE
$(TILEBMP16):
$(TILEBMP32):
!ENDIF

$(U)tile2bmp.exe: $(O)tile2bmp.obj $(TEXT_IO)
@echo Linking $^@...
@$(link) $(LFLAGSU) -out:$^@ @<<$(@B).lnk
$(O)tile2bmp.obj
$(TEXT_IO:^ =^
)
<<

$(U)til2bm32.exe: $(O)til2bm32.obj $(TEXT_IO32)
@echo Linking $^@...
@$(link) $(LFLAGSU) -out:$^@ @<<$(@B).lnk
$(O)til2bm32.obj
$(TEXT_IO32:^ =^
)
<<

$(O)tile2bmp.obj: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)\win32api.h
@$(CC) $(CFLAGS) -I$(WSHR) /DPACKED_FILE /Fo$^@ $(WSHR)\tile2bmp.c

$(O)til2bm32.obj: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)\win32api.h
@$(CC) $(CFLAGS) -I$(WSHR) /DPACKED_FILE /DTILE_X=32 /DTILE_Y=32 /Fo$^@ $(WSHR)\tile2bmp.c

#==========================================
# Housekeeping
#==========================================

spotless: clean .SYMBOLIC
! IF ("$(OBJ)"!="")
-rmdir $(OBJ) /s /Q
! ENDIF
if exist $(INCL)\date.h del $(INCL)\date.h
if exist $(INCL)\onames.h del $(INCL)\onames.h
if exist $(INCL)\pm.h del $(INCL)\pm.h
if exist $(INCL)\vis_tab.h del $(INCL)\vis_tab.h
if exist $(SRC)\vis_tab.c del $(SRC)\vis_tab.c
if exist $(SRC)\tile.c del $(SRC)\tile.c
if exist $(U)*.lnk del $(U)*.lnk
if exist $(U)*.map del $(U)*.map
if exist $(DAT)\data del $(DAT)\data
if exist $(DAT)\rumors del $(DAT)\rumors
if exist $(DAT)\???-fil?.lev del $(DAT)\???-fil?.lev
if exist $(DAT)\???-goal.lev del $(DAT)\???-goal.lev
if exist $(DAT)\???-loca.lev del $(DAT)\???-loca.lev
if exist $(DAT)\???-strt.lev del $(DAT)\???-strt.lev
if exist $(DAT)\air.lev del $(DAT)\air.lev
if exist $(DAT)\asmodeus.lev del $(DAT)\asmodeus.lev
if exist $(DAT)\astral.lev del $(DAT)\astral.lev
if exist $(DAT)\baalz.lev del $(DAT)\baalz.lev
if exist $(DAT)\bigroom.lev del $(DAT)\bigroom.lev
if exist $(DAT)\castle.lev del $(DAT)\castle.lev
if exist $(DAT)\data del $(DAT)\data
if exist $(DAT)\dungeon del $(DAT)\dungeon
if exist $(DAT)\dungeon.pdf del $(DAT)\dungeon.pdf
if exist $(DAT)\earth.lev del $(DAT)\earth.lev
if exist $(DAT)\fakewiz?.lev del $(DAT)\fakewiz?.lev
if exist $(DAT)\fire.lev del $(DAT)\fire.lev
if exist $(DAT)\juiblex.lev del $(DAT)\juiblex.lev
if exist $(DAT)\knox.lev del $(DAT)\knox.lev
if exist $(DAT)\medusa-?.lev del $(DAT)\medusa-?.lev
if exist $(DAT)\mine*.lev del $(DAT)\mine*.lev
if exist $(DAT)\options del $(DAT)\options
if exist $(DAT)\ttyoptions del $(DAT)\ttyoptions
if exist $(DAT)\guioptions del $(DAT)\guioptions
if exist $(DAT)\oracle.lev del $(DAT)\oracle.lev
if exist $(DAT)\oracles del $(DAT)\oracles
if exist $(DAT)\orcus.lev del $(DAT)\orcus.lev
if exist $(DAT)\rumors del $(DAT)\rumors
if exist $(DAT)\quest.dat del $(DAT)\quest.dat
if exist $(DAT)\sanctum.lev del $(DAT)\sanctum.lev
if exist $(DAT)\soko?-?.lev del $(DAT)\soko?-?.lev
if exist $(DAT)\tower?.lev del $(DAT)\tower?.lev
if exist $(DAT)\valley.lev del $(DAT)\valley.lev
if exist $(DAT)\water.lev del $(DAT)\water.lev
if exist $(DAT)\wizard?.lev del $(DAT)\wizard?.lev
if exist $(O)sp_lev.tag del $(O)sp_lev.tag
if exist $(SRC)\monstr.c del $(SRC)\monstr.c
if exist $(SRC)\vis_tab.c del $(SRC)\vis_tab.c
if exist $(U)recover.exe del $(U)recover.exe
if exist nhdat. del nhdat.

clean: .SYMBOLIC
if exist $(O)*.obj del $(O)*.obj
if exist $(O)utility.tag del $(O)utility.tag
if exist $(U)makedefs.exe del $(U)makedefs.exe
if exist $(U)lev_comp.exe del $(U)lev_comp.exe
if exist $(U)dgn_comp.exe del $(U)dgn_comp.exe
if exist $(SRC)\*.lnk del $(SRC)\*.lnk
if exist $(SRC)\*.map del $(SRC)\*.map
! IF ("$(WINPFLAG)"!="")
if exist $(TILEBMP16) del $(TILEBMP16)
if exist $(TILEBMP32) del $(TILEBMP32)
! ENDIF

#===================================================================
# OTHER DEPENDENCIES
#===================================================================

#
# dat dependencies
#

$(DAT)\data: $(O)utility.tag $(DATABASE)
$(U)makedefs -d

$(DAT)\rumors: $(O)utility.tag $(DAT)\rumors.tru $(DAT)\rumors.fal
$(U)makedefs -r

$(DAT)\quest.dat: $(O)utility.tag $(DAT)\quest.txt
$(U)makedefs -q

$(DAT)\oracles: $(O)utility.tag $(DAT)\oracles.txt
$(U)makedefs -h

$(DAT)\dungeon: $(O)utility.tag $(DAT)\dungeon.def
$(U)makedefs -e
cd $(DAT)
$(U)dgn_comp dungeon.pdf
cd $(SRC)

#
# NT dependencies
#

$(O)nttty.obj: $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(NTSYS)\nttty.c
@$(CC) $(CFLAGS) -I$(WSHR) -Fo$^@ $(NTSYS)\nttty.c
$(O)winnt.obj: $(HACK_H) $(INCL)\win32api.h $(NTSYS)\winnt.c
@$(CC) $(CFLAGS) -Fo$^@ $(NTSYS)\winnt.c
$(O)ntsound.obj: $(HACK_H) $(NTSYS)\ntsound.c
@$(CC) $(CFLAGS) -Fo$^@ $(NTSYS)\ntsound.c
$(O)mapimail.obj: $(HACK_H) $(INCL)\nhlan.h $(NTSYS)\mapimail.c
@$(CC) $(CFLAGS) -DMAPI_VERBOSE -Fo$^@ $(NTSYS)\mapimail.c

#
# util dependencies
#

$(O)panic.obj: $(U)panic.c $(CONFIG_H)
@$(CC) $(CFLAGS) -Fo$^@ $(U)panic.c

#
# The rest are stolen from sys/unix/Makefile.src,
# with slashes changed to back-slashes
# and -c (which is included in CFLAGS) substituted
# with -Fo$^@ , but otherwise untouched. That
# means that there is some irrelevant stuff
# in here, but maintenance should be easier.
#
$(O)tos.obj: ..\sys\atari\tos.c $(HACK_H) $(INCL)\tcap.h
$(CC) $(CFLAGS) -Fo$^@ ..\sys\atari\tos.c
$(O)pcmain.obj: ..\sys\share\pcmain.c $(HACK_H) $(INCL)\dlb.h &
$(INCL)\win32api.h
$(CC) $(CFLAGS) -Fo$^@ ..\sys\share\pcmain.c
$(O)pcsys.obj: ..\sys\share\pcsys.c $(HACK_H)
$(CC) $(CFLAGS) -Fo$^@ ..\sys\share\pcsys.c
$(O)pctty.obj: ..\sys\share\pctty.c $(HACK_H)
$(CC) $(CFLAGS) -Fo$^@ ..\sys\share\pctty.c
$(O)pcunix.obj: ..\sys\share\pcunix.c $(HACK_H)
$(CC) $(CFLAGS) -Fo$^@ ..\sys\share\pcunix.c
$(O)random.obj: ..\sys\share\random.c $(HACK_H)
$(CC) $(CFLAGS) -Fo$^@ ..\sys\share\random.c
$(O)ioctl.obj: ..\sys\share\ioctl.c $(HACK_H) $(INCL)\tcap.h
$(CC) $(CFLAGS) -Fo$^@ ..\sys\share\ioctl.c
$(O)unixtty.obj: ..\sys\share\unixtty.c $(HACK_H)
$(CC) $(CFLAGS) -Fo$^@ ..\sys\share\unixtty.c
$(O)unixmain.obj: ..\sys\unix\unixmain.c $(HACK_H) $(INCL)\dlb.h
$(CC) $(CFLAGS) -Fo$^@ ..\sys\unix\unixmain.c
$(O)unixunix.obj: ..\sys\unix\unixunix.c $(HACK_H)
$(CC) $(CFLAGS) -Fo$^@ ..\sys\unix\unixunix.c
$(O)bemain.obj: ..\sys\be\bemain.c $(HACK_H) $(INCL)\dlb.h
$(CC) $(CFLAGS) -Fo$^@ ..\sys\be\bemain.c
$(O)getline.obj: ..\win\tty\getline.c $(HACK_H) $(INCL)\func_tab.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\tty\getline.c
$(O)termcap.obj: ..\win\tty\termcap.c $(HACK_H) $(INCL)\tcap.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\tty\termcap.c
$(O)topl.obj: ..\win\tty\topl.c $(HACK_H) $(INCL)\tcap.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\tty\topl.c
$(O)wintty.obj: ..\win\tty\wintty.c $(HACK_H) $(INCL)\dlb.h &
$(INCL)\patchlevel.h $(INCL)\tcap.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\tty\wintty.c
$(O)Window.obj: ..\win\X11\Window.c $(INCL)\xwindowp.h $(INCL)\xwindow.h &
$(CONFIG_H)
$(CC) $(CFLAGS) -Fo$^@ ..\win\X11\Window.c
$(O)dialogs.obj: ..\win\X11\dialogs.c $(CONFIG_H)
$(CC) $(CFLAGS) -Fo$^@ ..\win\X11\dialogs.c
$(O)winX.obj: ..\win\X11\winX.c $(HACK_H) $(INCL)\winX.h $(INCL)\dlb.h &
$(INCL)\patchlevel.h ..\win\X11\nh72icon &
..\win\X11\nh56icon ..\win\X11\nh32icon
$(CC) $(CFLAGS) -Fo$^@ ..\win\X11\winX.c
$(O)winmap.obj: ..\win\X11\winmap.c $(INCL)\xwindow.h $(HACK_H) $(INCL)\dlb.h &
$(INCL)\winX.h $(INCL)\tile2x11.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\X11\winmap.c
$(O)winmenu.obj: ..\win\X11\winmenu.c $(HACK_H) $(INCL)\winX.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\X11\winmenu.c
$(O)winmesg.obj: ..\win\X11\winmesg.c $(INCL)\xwindow.h $(HACK_H) $(INCL)\winX.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\X11\winmesg.c
$(O)winmisc.obj: ..\win\X11\winmisc.c $(HACK_H) $(INCL)\func_tab.h &
$(INCL)\winX.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\X11\winmisc.c
$(O)winstat.obj: ..\win\X11\winstat.c $(HACK_H) $(INCL)\winX.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\X11\winstat.c
$(O)wintext.obj: ..\win\X11\wintext.c $(HACK_H) $(INCL)\winX.h $(INCL)\xwindow.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\X11\wintext.c
$(O)winval.obj: ..\win\X11\winval.c $(HACK_H) $(INCL)\winX.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\X11\winval.c
$(O)tile.obj: $(SRC)\tile.c $(HACK_H)
$(O)gnaskstr.obj: ..\win\gnome\gnaskstr.c ..\win\gnome\gnaskstr.h &
..\win\gnome\gnmain.h
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnaskstr.c
$(O)gnbind.obj: ..\win\gnome\gnbind.c ..\win\gnome\gnbind.h ..\win\gnome\gnmain.h &
..\win\gnome\gnaskstr.h ..\win\gnome\gnyesno.h
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnbind.c
$(O)gnglyph.obj: ..\win\gnome\gnglyph.c ..\win\gnome\gnglyph.h
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnglyph.c
$(O)gnmain.obj: ..\win\gnome\gnmain.c ..\win\gnome\gnmain.h ..\win\gnome\gnsignal.h &
..\win\gnome\gnbind.h ..\win\gnome\gnopts.h $(HACK_H) &
$(INCL)\date.h
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnmain.c
$(O)gnmap.obj: ..\win\gnome\gnmap.c ..\win\gnome\gnmap.h ..\win\gnome\gnglyph.h &
..\win\gnome\gnsignal.h $(HACK_H)
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnmap.c
$(O)gnmenu.obj: ..\win\gnome\gnmenu.c ..\win\gnome\gnmenu.h ..\win\gnome\gnmain.h &
..\win\gnome\gnbind.h
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnmenu.c
$(O)gnmesg.obj: ..\win\gnome\gnmesg.c ..\win\gnome\gnmesg.h ..\win\gnome\gnsignal.h
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnmesg.c
$(O)gnopts.obj: ..\win\gnome\gnopts.c ..\win\gnome\gnopts.h ..\win\gnome\gnglyph.h &
..\win\gnome\gnmain.h ..\win\gnome\gnmap.h $(HACK_H)
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnopts.c
$(O)gnplayer.obj: ..\win\gnome\gnplayer.c ..\win\gnome\gnplayer.h &
..\win\gnome\gnmain.h $(HACK_H)
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnplayer.c
$(O)gnsignal.obj: ..\win\gnome\gnsignal.c ..\win\gnome\gnsignal.h &
..\win\gnome\gnmain.h
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnsignal.c
$(O)gnstatus.obj: ..\win\gnome\gnstatus.c ..\win\gnome\gnstatus.h &
..\win\gnome\gnsignal.h ..\win\gnome\gn_xpms.h &
..\win\gnome\gnomeprv.h
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnstatus.c
$(O)gntext.obj: ..\win\gnome\gntext.c ..\win\gnome\gntext.h ..\win\gnome\gnmain.h &
..\win\gnome\gn_rip.h
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gntext.c
$(O)gnyesno.obj: ..\win\gnome\gnyesno.c ..\win\gnome\gnbind.h ..\win\gnome\gnyesno.h
$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnyesno.c
$(O)wingem.obj: ..\win\gem\wingem.c $(HACK_H) $(INCL)\func_tab.h $(INCL)\dlb.h &
$(INCL)\patchlevel.h $(INCL)\wingem.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\gem\wingem.c
$(O)wingem1.obj: ..\win\gem\wingem1.c $(INCL)\gem_rsc.h $(INCL)\load_img.h &
$(INCL)\wintype.h $(INCL)\wingem.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\gem\wingem1.c
$(O)load_img.obj: ..\win\gem\load_img.c $(INCL)\load_img.h
$(CC) $(CFLAGS) -Fo$^@ ..\win\gem\load_img.c
$(O)tile.obj: tile.c $(HACK_H)
$(O)qt_win.obj: ..\win\Qt\qt_win.cpp $(HACK_H) $(INCL)\func_tab.h &
$(INCL)\dlb.h $(INCL)\patchlevel.h $(INCL)\qt_win.h &
$(INCL)\qt_clust.h $(INCL)\qt_kde0.h &
$(INCL)\qt_xpms.h qt_win.moc qt_kde0.moc
$(CXX) $(CXXFLAGS) -c ..\win\Qt\qt_win.cpp
$(O)qt_clust.obj: ..\win\Qt\qt_clust.cpp $(INCL)\qt_clust.h
$(CXX) $(CXXFLAGS) -c ..\win\Qt\qt_clust.cpp
$(O)monstr.obj: $(SRC)\monstr.c $(CONFIG_H)
$(O)vis_tab.obj: $(SRC)\vis_tab.c $(CONFIG_H) $(INCL)\vis_tab.h
$(O)allmain.obj: allmain.c $(HACK_H)
$(O)alloc.obj: alloc.c $(CONFIG_H)
$(O)apply.obj: apply.c $(HACK_H) $(INCL)\edog.h
$(O)artifact.obj: artifact.c $(HACK_H) $(INCL)\artifact.h $(INCL)\artilist.h
$(O)attrib.obj: attrib.c $(HACK_H) $(INCL)\artifact.h
$(O)ball.obj: ball.c $(HACK_H)
$(O)bones.obj: bones.c $(HACK_H) $(INCL)\lev.h
$(O)botl.obj: botl.c $(HACK_H)
$(O)cmd.obj: cmd.c $(HACK_H) $(INCL)\func_tab.h
$(O)dbridge.obj: dbridge.c $(HACK_H)
$(O)decl.obj: decl.c $(HACK_H)
$(O)detect.obj: detect.c $(HACK_H) $(INCL)\artifact.h
$(O)dig.obj: dig.c $(HACK_H) $(INCL)\edog.h
$(O)display.obj: display.c $(HACK_H)
$(O)dlb.obj: dlb.c $(CONFIG_H) $(INCL)\dlb.h
$(O)do.obj: do.c $(HACK_H) $(INCL)\lev.h
$(O)do_name.obj: do_name.c $(HACK_H)
$(O)do_wear.obj: do_wear.c $(HACK_H)
$(O)dog.obj: dog.c $(HACK_H) $(INCL)\edog.h
$(O)dogmove.obj: dogmove.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\edog.h
$(O)dokick.obj: dokick.c $(HACK_H) $(INCL)\eshk.h
$(O)dothrow.obj: dothrow.c $(HACK_H)
$(O)drawing.obj: drawing.c $(HACK_H) $(INCL)\tcap.h
$(O)dungeon.obj: dungeon.c $(HACK_H) $(INCL)\dgn_file.h $(INCL)\dlb.h
$(O)eat.obj: eat.c $(HACK_H)
$(O)end.obj: end.c $(HACK_H) $(INCL)\eshk.h $(INCL)\dlb.h
$(O)engrave.obj: engrave.c $(HACK_H) $(INCL)\lev.h
$(O)exper.obj: exper.c $(HACK_H)
$(O)explode.obj: explode.c $(HACK_H)
$(O)extralev.obj: extralev.c $(HACK_H)
$(O)files.obj: files.c $(HACK_H) $(INCL)\dlb.h
$(O)fountain.obj: fountain.c $(HACK_H)
$(O)hack.obj: hack.c $(HACK_H)
$(O)hacklib.obj: hacklib.c $(HACK_H)
$(O)invent.obj: invent.c $(HACK_H) $(INCL)\artifact.h
$(O)light.obj: light.c $(HACK_H) $(INCL)\lev.h
$(O)lock.obj: lock.c $(HACK_H)
$(O)mail.obj: mail.c $(HACK_H) $(INCL)\mail.h
$(O)makemon.obj: makemon.c $(HACK_H) $(INCL)\epri.h $(INCL)\emin.h &
$(INCL)\edog.h
$(O)mapglyph.obj: mapglyph.c $(HACK_H)
$(O)mcastu.obj: mcastu.c $(HACK_H)
$(O)mhitm.obj: mhitm.c $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
$(O)mhitu.obj: mhitu.c $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
$(O)minion.obj: minion.c $(HACK_H) $(INCL)\emin.h $(INCL)\epri.h
$(O)mklev.obj: mklev.c $(HACK_H)
$(O)mkmap.obj: mkmap.c $(HACK_H) $(INCL)\sp_lev.h
$(O)mkmaze.obj: mkmaze.c $(HACK_H) $(INCL)\sp_lev.h $(INCL)\lev.h
$(O)mkobj.obj: mkobj.c $(HACK_H) $(INCL)\artifact.h
$(O)mkroom.obj: mkroom.c $(HACK_H)
$(O)mon.obj: mon.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\edog.h
$(O)mondata.obj: mondata.c $(HACK_H) $(INCL)\eshk.h $(INCL)\epri.h
$(O)monmove.obj: monmove.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\artifact.h
$(O)monst.obj: monst.c $(CONFIG_H) $(INCL)\permonst.h $(INCL)\align.h &
$(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\monsym.h &
$(INCL)\dungeon.h $(INCL)\eshk.h $(INCL)\vault.h &
$(INCL)\epri.h $(INCL)\color.h
$(O)mplayer.obj: mplayer.c $(HACK_H)
$(O)mthrowu.obj: mthrowu.c $(HACK_H)
$(O)muse.obj: muse.c $(HACK_H) $(INCL)\edog.h
$(O)music.obj: music.c $(HACK_H) #interp.c
$(O)o_init.obj: o_init.c $(HACK_H) $(INCL)\lev.h
$(O)objects.obj: objects.c $(CONFIG_H) $(INCL)\obj.h $(INCL)\objclass.h &
$(INCL)\prop.h $(INCL)\skills.h $(INCL)\color.h
$(O)objnam.obj: objnam.c $(HACK_H)
$(O)options.obj: options.c $(CONFIG_H) $(INCL)\objclass.h $(INCL)\flag.h &
$(HACK_H) $(INCL)\tcap.h
$(O)pager.obj: pager.c $(HACK_H) $(INCL)\dlb.h
$(O)pickup.obj: pickup.c $(HACK_H)
$(O)pline.obj: pline.c $(HACK_H) $(INCL)\epri.h $(INCL)\edog.h
$(O)polyself.obj: polyself.c $(HACK_H)
$(O)potion.obj: potion.c $(HACK_H)
$(O)pray.obj: pray.c $(HACK_H) $(INCL)\epri.h
$(O)priest.obj: priest.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\eshk.h &
$(INCL)\epri.h $(INCL)\emin.h
$(O)quest.obj: quest.c $(HACK_H) $(INCL)\qtext.h
$(O)questpgr.obj: questpgr.c $(HACK_H) $(INCL)\dlb.h $(INCL)\qtext.h
$(O)read.obj: read.c $(HACK_H)
$(O)rect.obj: rect.c $(HACK_H)
$(O)region.obj: region.c $(HACK_H) $(INCL)\lev.h
$(O)restore.obj: restore.c $(HACK_H) $(INCL)\lev.h $(INCL)\tcap.h
$(O)rip.obj: rip.c $(HACK_H)
$(O)rnd.obj: rnd.c $(HACK_H)
$(O)role.obj: role.c $(HACK_H)
$(O)rumors.obj: rumors.c $(HACK_H) $(INCL)\lev.h $(INCL)\dlb.h
$(O)save.obj: save.c $(HACK_H) $(INCL)\lev.h
$(O)shk.obj: shk.c $(HACK_H) $(INCL)\eshk.h
$(O)shknam.obj: shknam.c $(HACK_H) $(INCL)\eshk.h
$(O)sit.obj: sit.c $(HACK_H) $(INCL)\artifact.h
$(O)sounds.obj: sounds.c $(HACK_H) $(INCL)\edog.h
$(O)sp_lev.obj: sp_lev.c $(HACK_H) $(INCL)\dlb.h $(INCL)\sp_lev.h
$(O)spell.obj: spell.c $(HACK_H)
$(O)steal.obj: steal.c $(HACK_H)
$(O)steed.obj: steed.c $(HACK_H)
$(O)teleport.obj: teleport.c $(HACK_H)
$(O)timeout.obj: timeout.c $(HACK_H) $(INCL)\lev.h
$(O)topten.obj: topten.c $(HACK_H) $(INCL)\dlb.h $(INCL)\patchlevel.h
$(O)track.obj: track.c $(HACK_H)
$(O)trap.obj: trap.c $(HACK_H)
$(O)u_init.obj: u_init.c $(HACK_H)
$(O)uhitm.obj: uhitm.c $(HACK_H)
$(O)vault.obj: vault.c $(HACK_H) $(INCL)\vault.h
$(O)version.obj: version.c $(HACK_H) $(INCL)\date.h $(INCL)\patchlevel.h
$(O)vision.obj: vision.c $(HACK_H) $(INCL)\vis_tab.h
$(O)weapon.obj: weapon.c $(HACK_H)
$(O)were.obj: were.c $(HACK_H)
$(O)wield.obj: wield.c $(HACK_H)
$(O)windows.obj: windows.c $(HACK_H) $(INCL)\wingem.h $(INCL)\winGnome.h
$(O)wizard.obj: wizard.c $(HACK_H) $(INCL)\qtext.h
$(O)worm.obj: worm.c $(HACK_H) $(INCL)\lev.h
$(O)worn.obj: worn.c $(HACK_H)
$(O)write.obj: write.c $(HACK_H)
$(O)zap.obj: zap.c $(HACK_H)

# end of file

--CUT HERE--CUT HERE--CUT HERE--CUT HERE--CUT HERE--CUT HERE--CUT HERE--

--
--------------===============<[ Ray Chason ]>===============--------------
PGP public key at http://www.smart.net/~rchason/pubkey.asc
Delendae sunt RIAA, MPAA et Windoze

Michael Allison

unread,
Mar 11, 2003, 12:47:21 AM3/11/03
to
Ray Chason wrote

>It does take a few tweaks to the code, and of course a new
>Makefile. The big one is that a variable called "lock" conflicts
>with a function defined in the OpenWatcom headers. I renamed it to
>"lockfile."

That has come up with other compilers before. One way to
work around it rather than renaming anything is to
#define lock in the NetHack sources immediately prior to
the inclusion of the header file with the conflict, and
#undef it immediately afterwards:

#ifdef WATCOM
#define lock watcom_lock
#include <problem.h>
#undef lock
#endif

0 new messages