From 5049d23ce0d624448d52c992a061e7b9ee7e95d3 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 29 Nov 2018 20:59:03 -0500 Subject: [PATCH] make some progress on mingw build Still not quite there yet though. Focusing on tty (maybe curses) right now. The gui has had significant code deviation from prior gcc builds for windows and will take more work. --- sys/winnt/Makefile.gcc | 387 ++++++++++--------- sys/winnt/Makefile.msc | 687 ++++++++++++++++----------------- win/win32/dgnstuff-mingw32.mak | 93 +++++ win/win32/levstuff-mingw32.mak | 100 +++++ win/win32/tiles-mingw32.mak | 27 ++ 5 files changed, 763 insertions(+), 531 deletions(-) create mode 100644 win/win32/dgnstuff-mingw32.mak create mode 100644 win/win32/levstuff-mingw32.mak create mode 100644 win/win32/tiles-mingw32.mak diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index 70387b07a..e15e22c9c 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -206,6 +206,20 @@ endif #ZLIB = zlib.lib +# Have windows path styles available for use in commands +W_INCL =$(subst /,\, $(INCL)) +W_DAT =$(subst /,\, $(DAT)) +W_DOC =$(subst /,\, $(DOC)) +W_UTIL =$(subst /,\, $(UTIL)) +W_SRC =$(subst /,\, $(SRC)) +W_SSYS =$(subst /,\, $(SSYS)) +W_MSWSYS =$(subst /,\, $(MSWSYS)) +W_TTY =$(subst /,\, $(TTY)) +W_MSWIN =$(subst /,\, $(MSWIN)) +W_WCURSES =$(subst /,\, $(WCURSES)) +W_WSHR =$(subst /,\, $(WSHR)) +W_GAMEDIR =$(subst /,\, $(GAMEDIR)) + #========================================== #================ MACROS ================== #========================================== @@ -229,17 +243,17 @@ U = $(UTIL)/ MAKESRC = $(U)makedefs.c -SPLEVSRC = $(U)lev_yacc.c $(U)lev_$(LEX).c $(U)lev_main.c $(U)panic.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 +DGNCOMPSRC = $(U)dgn_yacc.c $(U)dgn_lex.c $(U)dgn_main.c MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o -SPLEVOBJS = $(O)lev_yacc.o $(O)lev_$(LEX).o $(O)lev_main.o \ +LEVCOMPOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ $(O)alloc.o $(O)decl.o $(O)drawing.o \ $(O)monst.o $(O)objects.o $(O)panic.o -DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_$(LEX).o $(O)dgn_main.o \ +DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_lex.o $(O)dgn_main.o \ $(O)alloc.o $(O)panic.o RECOVOBJS = $(O)recover.o @@ -645,11 +659,15 @@ DO_LEX = LEX_MSG # - Specify your yacc and lex programs (or work-alikes) here. #YACC = bison -y -YACC = byacc +#YACC = byacc #YACC = yacc +YACC= #LEX = lex -LEX = flex +#LEX = flex +LEX= +export YACC +export LEX # # - Specify your flex skeleton file (if needed). @@ -684,6 +702,8 @@ else NETHACKW_EXE = $(GAMEDIR)/NetHack.exe endif +SHELL=CMD.EXE + #========================================== #=============== TARGETS ================== #========================================== @@ -712,7 +732,7 @@ install: initialchk $(GAMEDIR)/NetHack.exe $(U)uudecode.exe $(O)winres.o \ install.tag: $(DAT)/data $(DAT)/rumors $(DAT)/dungeon \ - $(DAT)/oracles $(DAT)/quest.dat $(O)sp_lev.tag $(DLB) + $(DAT)/oracles $(DAT)/quest.dat sp_lev.tag $(DLB) ifeq "$(USE_DLB)" "Y" $(subst /,\,copy nhdat $(GAMEDIR)) $(subst /,\,copy $(DAT)/license $(GAMEDIR)) @@ -730,7 +750,7 @@ endif $(U)makedefs -c $(subst /,\,if not exist $(GAMEDIR)/defaults.nh copy fixed_defaults.nh $(GAMEDIR)/defaults.nh) $(subst /,\,if not exist $(GAMEDIR)/defaults.nh copy $(MSWSYS)/defaults.nh $(GAMEDIR)/defaults.nh) - $(subst /,\,if not exist $(GAMEDIR)/record. goto>$(GAMEDIR)/record.) + $(subst /,\,-if not exist $(GAMEDIR)/record. goto>$(GAMEDIR)/record.) # # $(subst /,\,echo install done > $@) @@ -941,8 +961,8 @@ $(O)uudecode.o: $(SSYS)/uudecode.c $(MSWSYS)/NetHack.ico : $(U)uudecode.exe $(MSWSYS)/nhico.uu $(subst /,\,$(U)uudecode.exe $(MSWSYS)/nhico.uu) - cp NetHack.ico $@ - rm NetHack.ico + copy NetHack.ico $@ + del NetHack.ico $(MSWIN)/NetHack.ico : $(MSWSYS)/NetHack.ico $(subst /,\,copy $< $@) @@ -989,105 +1009,55 @@ $(MSWIN)/splash.bmp: $(U)uudecode.exe $(MSWIN)/splash.uu LEVCFLAGS=$(cflags) -c -DWIN32 -D_WIN32 -I../include $(cdebug) -DDLB -$(U)levcomp.exe: $(SPLEVOBJS) - @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(SPLEVOBJS) +$(U)lev_yacc.c: $(U)lev_comp.y + mingw32-make -C ../util -f ../win/win32/levstuff-mingw32.mak $(U)lev_yacc.c + +$(U)lev_lex.c: $(HACK_H) $(U)lev_comp.l + mingw32-make -C ../util -f ../win/win32/levstuff-mingw32.mak $(U)lev_lex.c + +$(INCL)/lev_comp.h: + mingw32-make -C ../include -f ../win/win32/levstuff-mingw32.mak $(INCL)/lev_comp.h $(O)lev_yacc.o: $(HACK_H) $(SP_LEV_H) $(INCL)/lev_comp.h $(U)lev_yacc.c $(cc) $(LEVCFLAGS) -o$@ $(U)lev_yacc.c -$(O)lev_$(LEX).o: $(HACK_H) $(INCL)/lev_comp.h $(SP_LEV_H) \ - $(U)lev_$(LEX).c - $(cc) $(LEVCFLAGS) -o$@ $(U)lev_$(LEX).c +$(O)lev_lex.o: $(HACK_H) $(INCL)/lev_comp.h $(SP_LEV_H) $(U)lev_lex.c + $(cc) $(LEVCFLAGS) -o$@ $(U)lev_lex.c $(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H) $(cc) $(LEVCFLAGS) -o$@ $(U)lev_main.c -$(U)lev_yacc.c $(INCL)/lev_comp.h : $(U)lev_comp.y -ifeq "$(DO_YACC)" "YACC_ACT" - $(subst /,\,$(YACC) -d $(U)lev_comp.y) - $(subst /,\,copy $(YTABC) $(U)lev_yacc.c) - $(subst /,\,copy $(YTABH) $(INCL)/lev_comp.h) - $(subst /,\,@del $(YTABC)) - $(subst /,\,@del $(YTABH)) -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. - $(subst /,\,@copy $(SSYS)/lev_yacc.c $(U)lev_yacc.c >nul) - $(subst /,\,@copy $(SSYS)/lev_comp.h $(INCL)/lev_comp.h >nul) - $(subst /,\,echo.>>$(U)lev_yacc.c) - $(subst /,\,echo.>>$(INCL)/lev_comp.h) -endif - -$(U)lev_$(LEX).c: $(U)lev_comp.l -ifeq "$(DO_LEX)" "LEX_ACT" - $(subst /,\,$(LEX) $(FLEXSKEL) $(U)lev_comp.l) - $(subst /,\,copy $(LEXYYC) $@) - $(subst /,\,@del $(LEXYYC)) -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. - $(subst /,\,@copy $(SSYS)/lev_lex.c $@ >nul) - $(subst /,\,echo.>>$@) -endif +$(U)levcomp.exe: $(LEVCOMPOBJS) + @echo Linking $@... + @$(link) $(LFLAGSU) -o$@ $(LEVCOMPOBJS) #========================================== # Dungeon Compiler Stuff #========================================== +$(U)dgn_yacc.c: $(U)dgn_comp.y + mingw32-make -C ../util -f ../win/win32/dgnstuff-mingw32.mak $(U)dgn_yacc.c + +$(INCL)/dgn_comp.h: + mingw32-make -C ../include -f ../win/win32/dgnstuff-mingw32.mak $(INCL)/dgn_comp.h + +$(U)dgn_lex.c: $(U)dgn_comp.l + mingw32-make -C ../util -f ../win/win32/dgnstuff-mingw32.mak $(U)dgn_lex.c + +$(O)dgn_yacc.o: $(HACK_H) $(DGN_FILE_H) $(INCL)/dgn_comp.h $(U)dgn_yacc.c + $(cc) $(LEVCFLAGS) -o$@ $(U)dgn_yacc.c + +$(O)dgn_lex.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h \ + $(U)dgn_lex.c + $(cc) $(LEVCFLAGS) -o$@ $(U)dgn_lex.c + +$(O)dgn_main.o: $(HACK_H) $(U)dgn_main.c + $(cc) $(LEVCFLAGS) -o$@ $(U)dgn_main.c $(U)dgncomp.exe: $(DGNCOMPOBJS) + @echo Linking $@... @echo Linking $@... @$(link) $(LFLAGSU) -o$@ $(DGNCOMPOBJS) - -$(O)dgn_yacc.o: $(HACK_H) $(DGN_FILE_H) $(INCL)/dgn_comp.h $(U)dgn_yacc.c - $(cc) $(LEVCFLAGS) -o$@ $(U)dgn_yacc.c - -$(O)dgn_$(LEX).o: $(HACK_H) $(DGN_FILE_H) $(INCL)/dgn_comp.h \ - $(U)dgn_$(LEX).c - $(cc) $(LEVCFLAGS) -o$@ $(U)dgn_$(LEX).c - -$(O)dgn_main.o: $(HACK_H) $(U)dgn_main.c - $(cc) $(LEVCFLAGS) -o$@ $(U)dgn_main.c - -$(U)dgn_yacc.c $(INCL)/dgn_comp.h : $(U)dgn_comp.y -ifeq "$(DO_YACC)" "YACC_ACT" - $(subst /,\,$(YACC) -d $(U)dgn_comp.y) - $(subst /,\,copy $(YTABC) $(U)dgn_yacc.c) - $(subst /,\,copy $(YTABH) $(INCL)/dgn_comp.h) - $(subst /,\,@del $(YTABC)) - $(subst /,\,@del $(YTABH)) -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. - $(subst /,\,@copy $(SSYS)/dgn_yacc.c $(U)dgn_yacc.c >nul) - $(subst /,\,@copy $(SSYS)/dgn_comp.h $(INCL)/dgn_comp.h >nul) - $(subst /,\,echo.>>$(U)dgn_yacc.c) - $(subst /,\,echo.>>$(INCL)/dgn_comp.h) -endif - -$(U)dgn_$(LEX).c: $(U)dgn_comp.l -ifeq "$(DO_LEX)" "LEX_ACT" - $(subst /,\,$(LEX) $(FLEXSKEL) $(U)dgn_comp.l) - $(subst /,\,copy $(LEXYYC) $@) - $(subst /,\,@del $(LEXYYC)) -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. - $(subst /,\,@copy $(SSYS)/dgn_lex.c $@ >nul) - $(subst /,\,echo.>>$@) -endif - #================================================= # For a couple of devteam utilities #================================================= @@ -1220,11 +1190,11 @@ $(U)txt2ppm.exe: $(PPMWRITERS) $(TEXT_IO) $(TILEBMP16): $(TILEUTIL16) $(TILEFILES) - @echo Creating 16x16 binary tile files (this may take some time) + @echo Creating 16x16 binary tile files which may take some time $(subst /,\,@$(U)tile2bmp $(TILEBMP16)) #$(TILEBMP32): $(TILEUTIL32) $(TILEFILES32) -# @echo Creating 32x32 binary tile files (this may take some time) +# @echo Creating 32x32 binary tile files which may take some time # $(subst /,\,@$(U)til2bm32 $(TILEBMP32)) $(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO) @@ -1253,97 +1223,150 @@ $(O)pdcurses.a : $(PDCLIBOBJS) $(PDCOBJS) #========================================== spotless: clean - $(subst /,\,if exist initialchk del initialchk) - $(subst /,\,if exist $(INCL)/date.h del $(INCL)/date.h) - $(subst /,\,if exist $(INCL)/onames.h del $(INCL)/onames.h) - $(subst /,\,if exist $(INCL)/pm.h del $(INCL)/pm.h) - $(subst /,\,if exist $(INCL)/vis_tab.h del $(INCL)/vis_tab.h) - $(subst /,\,if exist $(SRC)/vis_tab.c del $(SRC)/vis_tab.c) - $(subst /,\,if exist $(SRC)/tile.c del $(SRC)/tile.c) - $(subst /,\,if exist $(U)*.lnk del $(U)*.lnk) - $(subst /,\,if exist $(U)*.map del $(U)*.map) - $(subst /,\,if exist $(DAT)/data del $(DAT)/data) - $(subst /,\,if exist $(DAT)/rumors del $(DAT)/rumors) - $(subst /,\,if exist $(DAT)/???-fil?.lev del $(DAT)/???-fil?.lev) - $(subst /,\,if exist $(DAT)/???-goal.lev del $(DAT)/???-goal.lev) - $(subst /,\,if exist $(DAT)/???-loca.lev del $(DAT)/???-loca.lev) - $(subst /,\,if exist $(DAT)/???-strt.lev del $(DAT)/???-strt.lev) - $(subst /,\,if exist $(DAT)/air.lev del $(DAT)/air.lev) - $(subst /,\,if exist $(DAT)/asmodeus.lev del $(DAT)/asmodeus.lev) - $(subst /,\,if exist $(DAT)/astral.lev del $(DAT)/astral.lev) - $(subst /,\,if exist $(DAT)/baalz.lev del $(DAT)/baalz.lev) - $(subst /,\,if exist $(DAT)/bigrm-*.lev del $(DAT)/bigrm-*.lev) - $(subst /,\,if exist $(DAT)/castle.lev del $(DAT)/castle.lev) - $(subst /,\,if exist $(DAT)/data del $(DAT)/data) - $(subst /,\,if exist $(DAT)/dungeon del $(DAT)/dungeon) - $(subst /,\,if exist $(DAT)/dungeon.pdf del $(DAT)/dungeon.pdf) - $(subst /,\,if exist $(DAT)/earth.lev del $(DAT)/earth.lev) - $(subst /,\,if exist $(DAT)/fakewiz?.lev del $(DAT)/fakewiz?.lev) - $(subst /,\,if exist $(DAT)/fire.lev del $(DAT)/fire.lev) - $(subst /,\,if exist $(DAT)/juiblex.lev del $(DAT)/juiblex.lev) - $(subst /,\,if exist $(DAT)/knox.lev del $(DAT)/knox.lev) - $(subst /,\,if exist $(DAT)/medusa-?.lev del $(DAT)/medusa-?.lev) - $(subst /,\,if exist $(DAT)/mine*.lev del $(DAT)/mine*.lev) - $(subst /,\,if exist $(DAT)/options del $(DAT)/options) - $(subst /,\,if exist $(DAT)/ttyoptions del $(DAT)/ttyoptions) - $(subst /,\,if exist $(DAT)/guioptions del $(DAT)/guioptions) - $(subst /,\,if exist $(DAT)/oracle.lev del $(DAT)/oracle.lev) - $(subst /,\,if exist $(DAT)/oracles del $(DAT)/oracles) - $(subst /,\,if exist $(DAT)/orcus.lev del $(DAT)/orcus.lev) - $(subst /,\,if exist $(DAT)/rumors del $(DAT)/rumors) - $(subst /,\,if exist $(DAT)/quest.dat del $(DAT)/quest.dat) - $(subst /,\,if exist $(DAT)/sanctum.lev del $(DAT)/sanctum.lev) - $(subst /,\,if exist $(DAT)/soko?-?.lev del $(DAT)/soko?-?.lev) - $(subst /,\,if exist $(DAT)/tower?.lev del $(DAT)/tower?.lev) - $(subst /,\,if exist $(DAT)/valley.lev del $(DAT)/valley.lev) - $(subst /,\,if exist $(DAT)/water.lev del $(DAT)/water.lev) - $(subst /,\,if exist $(DAT)/wizard?.lev del $(DAT)/wizard?.lev) - $(subst /,\,if exist sp_lev.tag del sp_lev.tag) - $(subst /,\,if exist $(SRC)/vis_tab.c del $(SRC)/vis_tab.c) - $(subst /,\,if exist $(U)recover.exe del $(U)recover.exe) - $(subst /,\,if exist $(DAT)/dlb.lst del $(DAT)/dlb.lst) - $(subst /,\,if exist nhdat. del nhdat.) - $(subst /,\,if exist $(QT4)/*.moc del $(QT4)/*.moc) - $(subst /,\,if exist $(DAT)/bogusmon del $(DAT)/bogusmon) - $(subst /,\,if exist $(DAT)/engrave del $(DAT)/engrave) - $(subst /,\,if exist $(DAT)/epitaph del $(DAT)/epitaph) - $(subst /,\,if exist $(DAT)/porthelp del $(DAT)/porthelp) - $(subst /,\,if exist $(INCL)/dgn_comp.h del $(INCL)/dgn_comp.h) - $(subst /,\,if exist $(INCL)/lev_comp.h del $(INCL)/lev_comp.h) - $(subst /,\,if exist $(MSWSYS)/NetHack.ico del $(MSWSYS)/NetHack.ico) - $(subst /,\,if exist $(U)dgn_flex.c del $(U)dgn_flex.c) - $(subst /,\,if exist $(U)dgn_yacc.c del $(U)dgn_yacc.c) - $(subst /,\,if exist $(U)dlb_main.exe del $(U)dlb_main.exe) - $(subst /,\,if exist $(U)lev_flex.c del $(U)lev_flex.c) - $(subst /,\,if exist $(U)lev_yacc.c del $(U)lev_yacc.c) - $(subst /,\,if exist $(U)tile2bmp.exe del $(U)tile2bmp.exe) - $(subst /,\,if exist $(U)tilemap.exe del $(U)tilemap.exe) - $(subst /,\,if exist $(U)uudecode.exe del $(U)uudecode.exe) - $(subst /,\,if exist $(MSWIN)/NetHack.ico del $(MSWIN)/NetHack.ico) - $(subst /,\,if exist $(MSWIN)/mnsel.bmp del $(MSWIN)/mnsel.bmp) - $(subst /,\,if exist $(MSWIN)/mnselcnt.bmp del $(MSWIN)/mnselcnt.bmp) - $(subst /,\,if exist $(MSWIN)/mnunsel.bmp del $(MSWIN)/mnunsel.bmp) - $(subst /,\,if exist $(MSWIN)/petmark.bmp del $(MSWIN)/petmark.bmp) - $(subst /,\,if exist $(MSWIN)/pilemark.bmp del $(MSWIN)/pilemark.bmp) - $(subst /,\,if exist $(MSWIN)/rip.bmp del $(MSWIN)/rip.bmp) - $(subst /,\,if exist $(MSWIN)/splash.bmp del $(MSWIN)/splash.bmp) + if exist initialchk del initialchk ifneq "$(OBJ)" "" - test -d $(OBJ) && rmdir $(OBJ) /S /Q + if exist $(W_OBJ)\* rmdir $(W_OBJ) /s /Q + if exist $(W_GAMEDIR))\nhdefkey.dll del $(W_GAMEDIR))\nhdefkey.dll + if exist $(W_GAMEDIR))\nh340key.dll del $(W_GAMEDIR))\nh340key.dll + if exist $(W_GAMEDIR))\nhraykey.dll del $(W_GAMEDIR))\nhraykey.dll + if exist $(W_GAMEDIR))\NetHack.exe del $(W_GAMEDIR))\NetHack.exe + if exist $(W_GAMEDIR))\NetHack.pdb del $(W_GAMEDIR))\NetHack.pdb + if exist $(W_GAMEDIR))\nhdat del $(W_GAMEDIR))\nhdat endif + if exist $(W_INCL)\date.h del $(W_INCL)\date.h + if exist $(W_INCL)\onames.h del $(W_INCL)\onames.h + if exist $(W_INCL)\pm.h del $(W_INCL)\pm.h + if exist $(W_INCL)\vis_tab.h del $(W_INCL)\vis_tab.h + if exist $(W_SRC)\vis_tab.c del $(W_SRC)\vis_tab.c + if exist $(W_SRC)\tile.c del $(W_SRC)\tile.c + if exist $(W_UTIL)\*.lnk del $(W_UTIL)\*.lnk + if exist $(W_UTIL)\*.map del $(W_UTIL)\*.map + if exist $(W_DAT)\data del $(W_DAT)\data + if exist $(W_DAT)\rumors del $(W_DAT)\rumors + if exist $(W_DAT)\engrave del $(W_DAT)\engrave + if exist $(W_DAT)\epitaph del $(W_DAT)\epitaph + if exist $(W_DAT)\bogusmon del $(W_DAT)\bogusmon + if exist $(W_DAT)\???-fil?.lev del $(W_DAT)\???-fil?.lev + if exist $(W_DAT)\???-goal.lev del $(W_DAT)\???-goal.lev + if exist $(W_DAT)\???-loca.lev del $(W_DAT)\???-loca.lev + if exist $(W_DAT)\???-strt.lev del $(W_DAT)\???-strt.lev + if exist $(W_DAT)\air.lev del $(W_DAT)\air.lev + if exist $(W_DAT)\asmodeus.lev del $(W_DAT)\asmodeus.lev + if exist $(W_DAT)\astral.lev del $(W_DAT)\astral.lev + if exist $(W_DAT)\baalz.lev del $(W_DAT)\baalz.lev + if exist $(W_DAT)\bigrm-*.lev del $(W_DAT)\bigrm-*.lev + if exist $(W_DAT)\castle.lev del $(W_DAT)\castle.lev + if exist $(W_DAT)\data del $(W_DAT)\data + if exist $(W_DAT)\dungeon del $(W_DAT)\dungeon + if exist $(W_DAT)\dungeon.pdf del $(W_DAT)\dungeon.pdf + if exist $(W_DAT)\earth.lev del $(W_DAT)\earth.lev + if exist $(W_DAT)\fakewiz?.lev del $(W_DAT)\fakewiz?.lev + if exist $(W_DAT)\fire.lev del $(W_DAT)\fire.lev + if exist $(W_DAT)\juiblex.lev del $(W_DAT)\juiblex.lev + if exist $(W_DAT)\knox.lev del $(W_DAT)\knox.lev + if exist $(W_DAT)\medusa-?.lev del $(W_DAT)\medusa-?.lev + if exist $(W_DAT)\mine*.lev del $(W_DAT)\mine*.lev + if exist $(W_DAT)\options del $(W_DAT)\options + if exist $(W_DAT)\ttyoptions del $(W_DAT)\ttyoptions + if exist $(W_DAT)\guioptions del $(W_DAT)\guioptions + if exist $(W_DAT)\oracle.lev del $(W_DAT)\oracle.lev + if exist $(W_DAT)\oracles del $(W_DAT)\oracles + if exist $(W_DAT)\orcus.lev del $(W_DAT)\orcus.lev + if exist $(W_DAT)\rumors del $(W_DAT)\rumors + if exist $(W_DAT)\quest.dat del $(W_DAT)\quest.dat + if exist $(W_DAT)\sanctum.lev del $(W_DAT)\sanctum.lev + if exist $(W_DAT)\soko?-?.lev del $(W_DAT)\soko?-?.lev + if exist $(W_DAT)\tower?.lev del $(W_DAT)\tower?.lev + if exist $(W_DAT)\valley.lev del $(W_DAT)\valley.lev + if exist $(W_DAT)\water.lev del $(W_DAT)\water.lev + if exist $(W_DAT)\wizard?.lev del $(W_DAT)\wizard?.lev + if exist $(W_DAT)\dlb.lst del $(W_DAT)\dlb.lst + if exist $(W_DAT)\porthelp del $(W_DAT)\porthelp + if exist $(W_OBJ)\sp_lev.tag del $(W_OBJ)\sp_lev.tag + if exist $(W_SRC)\vis_tab.c del $(W_SRC)\vis_tab.c + if exist nhdat. del nhdat. + if exist $(W_OBJ)\obj.tag del $(W_OBJ)\obj.tag + if exist $(W_OBJ)\gamedir.tag del $(W_OBJ)\gamedir.tag + if exist $(W_OBJ)\nh*key.lib del $(W_OBJ)\nh*key.lib + if exist $(W_OBJ)\nh*key.exp del $(W_OBJ)\nh*key.exp + if exist $(W_MSWIN)\mnsel.bmp del $(W_MSWIN)\mnsel.bmp + if exist $(W_MSWIN)\mnselcnt.bmp del $(W_MSWIN)\mnselcnt.bmp + if exist $(W_MSWIN)\mnunsel.bmp del $(W_MSWIN)\mnunsel.bmp + if exist $(W_MSWIN)\petmark.bmp del $(W_MSWIN)\petmark.bmp + if exist $(W_MSWIN)\pilemark.bmp del $(W_MSWIN)\pilemark.bmp + if exist $(W_MSWIN)\rip.bmp del $(W_MSWIN)\rip.bmp + if exist $(W_MSWIN)\splash.bmp del $(W_MSWIN)\splash.bmp + if exist $(W_MSWIN)\nethack.ico del $(W_MSWIN)\nethack.ico + if exist $(W_MSWSYS)\nethack.ico del $(W_MSWSYS)\nethack.ico + if exist $(W_UTIL)\recover.exe del $(W_UTIL)\recover.exe + if exist $(W_UTIL)\tile2bmp.exe del $(W_UTIL)\tile2bmp.exe + if exist $(W_UTIL)\tilemap.exe del $(W_UTIL)\tilemap.exe + if exist $(W_UTIL)\uudecode.exe del $(W_UTIL)\uudecode.exe + if exist $(W_UTIL)\dlb_main.exe del $(W_UTIL)\dlb_main.exe ifeq "$(ADD_CURSES)" "Y" - if exist $(O)pdcurses.lib del $(O)pdcurses.lib + if exist $(W_OBJ)\pdcurses.lib del $(W_OBJ)\pdcurses.lib endif clean: - -test -f install.tag && rm install.tag - -test -f utility.tag && rm utility.tag - -test -f $(U)makedefs.exe && rm $(U)makedefs.exe - -test -f $(U)levcomp.exe && rm $(U)levcomp.exe - -test -f $(U)dgncomp.exe && rm $(U)dgncomp.exe - -rm $(SRC)/*.lnk - -rm $(SRC)/*.map - -test -f $(TILEBMP16) && rm $(TILEBMP16) - -test -f $(TILEBMP32) && rm $(TILEBMP32) - + if exist $(W_OBJ)\*.o del $(W_OBJ)\*.o + if exist $(W_OBJ)\utility.tag del $(W_OBJ)\utility.tag + if exist $(W_UTIL)\makedefs.exe del $(W_UTIL)\makedefs.exe + if exist $(W_UTIL)\levcomp.exe del $(W_UTIL)\levcomp.exe + if exist $(W_UTIL)\dgncomp.exe del $(W_UTIL)\dgncomp.exe + if exist $(W_SRC)\*.lnk del $(W_SRC)\*.lnk + if exist $(W_SRC)\*.map del $(W_SRC)\*.map + if exist $(W_OBJ)\install.tag del $(W_OBJ)\install.tag + if exist $(W_OBJ)\console.res del $(W_OBJ)\console.res + if exist $(W_OBJ)\dgncomp.MAP del $(W_OBJ)\dgncomp.MAP + if exist $(W_OBJ)\dgncomp.PDB del $(W_OBJ)\dgncomp.PDB + if exist $(W_OBJ)\dlb_main.MAP del $(W_OBJ)\dlb_main.MAP + if exist $(W_OBJ)\dlb_main.PDB del $(W_OBJ)\dlb_main.PDB + if exist $(W_OBJ)\gamedir.tag del $(W_OBJ)\gamedir.tag + if exist $(W_OBJ)\levcomp.MAP del $(W_OBJ)\levcomp.MAP + if exist $(W_OBJ)\levcomp.PDB del $(W_OBJ)\levcomp.PDB + if exist $(W_OBJ)\makedefs.MAP del $(W_OBJ)\makedefs.MAP + if exist $(W_OBJ)\makedefs.PDB del $(W_OBJ)\makedefs.PDB + if exist $(W_OBJ)\NetHack.MAP del $(W_OBJ)\NetHack.MAP + if exist $(W_OBJ)\nh340key.def del $(W_OBJ)\nh340key.def + if exist $(W_OBJ)\nh340key.exp del $(W_OBJ)\nh340key.exp + if exist $(W_OBJ)\nh340key.lib del $(W_OBJ)\nh340key.lib + if exist $(W_OBJ)\nh340key.map del $(W_OBJ)\nh340key.map + if exist $(W_OBJ)\nh340key.PDB del $(W_OBJ)\nh340key.PDB + if exist $(W_OBJ)\nhdefkey.def del $(W_OBJ)\nhdefkey.def + if exist $(W_OBJ)\nhdefkey.exp del $(W_OBJ)\nhdefkey.exp + if exist $(W_OBJ)\nhdefkey.lib del $(W_OBJ)\nhdefkey.lib + if exist $(W_OBJ)\nhdefkey.map del $(W_OBJ)\nhdefkey.map + if exist $(W_OBJ)\nhdefkey.PDB del $(W_OBJ)\nhdefkey.PDB + if exist $(W_OBJ)\nhraykey.def del $(W_OBJ)\nhraykey.def + if exist $(W_OBJ)\nhraykey.exp del $(W_OBJ)\nhraykey.exp + if exist $(W_OBJ)\nhraykey.lib del $(W_OBJ)\nhraykey.lib + if exist $(W_OBJ)\nhraykey.map del $(W_OBJ)\nhraykey.map + if exist $(W_OBJ)\nhraykey.PDB del $(W_OBJ)\nhraykey.PDB + if exist $(W_OBJ)\envchk.tag del $(W_OBJ)\envchk.tag + if exist $(W_OBJ)\obj.tag del $(W_OBJ)\obj.tag + if exist $(W_OBJ)\sp_lev.tag del $(W_OBJ)\sp_lev.tag + if exist $(W_OBJ)\uudecode.MAP del $(W_OBJ)\uudecode.MAP + if exist $(W_OBJ)\uudecode.PDB del $(W_OBJ)\uudecode.PDB + rem + rem defer to the steps in ../win/win32/levstuff-mingw32.mak + rem + mingw32-make -f ../win/win32/levstuff-mingw32.mak clean + rem + rem defer to the steps in ../win/win32/dgnstuff-mingw32.mak + mingw32-make -f ../win/win32/dgnstuff-mingw32.mak clean + $(subst /,\,if exist $(TILEBMP16) del $(TILEBMP16)) + $(subst /,\,if exist $(TILEBMP32) del $(TILEBMP32)) + +#clean: +# -test -f install.tag && del install.tag +# -test -f utility.tag && del utility.tag +# -test -f $(U)makedefs.exe && del $(U)makedefs.exe +# -test -f $(U)levcomp.exe && del $(U)levcomp.exe +# -test -f $(U)dgncomp.exe && del $(U)dgncomp.exe +# -del $(SRC)/*.lnk +# -del $(SRC)/*.map +# -test -f $(TILEBMP16) && del $(TILEBMP16) +# -test -f $(TILEBMP32) && del $(TILEBMP32) +# #=================================================================== # OTHER DEPENDENCIES #=================================================================== @@ -1406,10 +1429,10 @@ endif ifeq "$(WANT_WIN_QT4)" "Y" # Qt dependencies -$(GAMEDIR)/Qt5Core.dll : $(QT4_DIRECTORY)/bin/Qt5Core.dll +$(GAMEDIR))/Qt5Core.dll : $(QT4_DIRECTORY)/bin/Qt5Core.dll $(subst /,\,@copy $< $@ >nul) -$(GAMEDIR)/Qt5Gui.dll : $(QT4_DIRECTORY)/bin/Qt5Gui.dll +$(GAMEDIR))/Qt5Gui.dll : $(QT4_DIRECTORY)/bin/Qt5Gui.dll $(subst /,\,@copy $< $@ >nul) $(GAMEDIR)/Qt5Widgets.dll : $(QT4_DIRECTORY)/bin/Qt5Widgets.dll diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index f529c6940..926eed8ad 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -71,8 +71,7 @@ DEBUGINFO = Y # # You'll have to set PDCURSES_H to the correct location of the # PDCurses header (.h) files and PDCURSES_C to the location -# of your PDCurses C files which must already be resident on -# your machine. +# of your PDCurses C files. # #ADD_CURSES=Y #PDCURSES_TOP=..\..\pdcurses @@ -90,9 +89,13 @@ DEBUGINFO = Y # Nothing below here should have to be changed.# # # ################################################ + # #============================================================================== +# Set the gamedir according to your preference. +# If not present prior to compilation it gets created. + # # Source directories. Makedefs hardcodes these, don't change them. # @@ -115,6 +118,15 @@ WSHR = ..\win\share # Tile support files OBJ = o +cc=cl +link=link +rc=Rc + +# +#========================================== +# Exe File Info. +#========================================== + # # # Optional high-quality BSD random number generation routines @@ -147,214 +159,12 @@ DLBFLG = #ZLIB = zlib.lib -#========================================== -#================ MACROS ================== -#========================================== -# This section creates shorthand macros for many objects -# referenced later on in the Makefile. -# -# -# Shorten up the location for some files -# - -O = $(OBJ)^\ - -U = $(UTIL)^\ - -# -# Utility Objects. -# - -MAKESRC = $(U)makedefs.c - -MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o - -LEVCOMPOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ - $(O)alloc.o $(O)decl.o $(O)drawing.o $(O)monst.o $(O)objects.o $(O)panic.o - -DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_lex.o $(O)dgn_main.o \ - $(O)alloc.o $(O)panic.o - -RECOVOBJS = $(O)recover.o - -TILEFILES = $(WSHR)\monsters.txt $(WSHR)\objects.txt $(WSHR)\other.txt - -# -# These are not invoked during a normal game build in 3.4+ -# -TEXT_IO = $(O)tiletext.o $(O)tiletxt.o $(O)drawing.o \ - $(O)decl.o $(O)monst.o $(O)objects.o - -TEXT_IO32 = $(O)tilete32.o $(O)tiletx32.o $(O)drawing.o \ - $(O)decl.o $(O)monst.o $(O)objects.o - -GIFREADERS = $(O)gifread.o $(O)alloc.o $(O)panic.o -GIFREADERS32 = $(O)gifrd32.o $(O)alloc.o $(O)panic.o - -PPMWRITERS = $(O)ppmwrite.o $(O)alloc.o $(O)panic.o - -# -# Object files for the game itself. -# - -VOBJ01 = $(O)allmain.o $(O)alloc.o $(O)apply.o $(O)artifact.o -VOBJ02 = $(O)attrib.o $(O)ball.o $(O)bones.o $(O)botl.o -VOBJ03 = $(O)cmd.o $(O)dbridge.o $(O)decl.o $(O)detect.o -VOBJ04 = $(O)dig.o $(O)display.o $(O)do.o $(O)do_name.o -VOBJ05 = $(O)do_wear.o $(O)dog.o $(O)dogmove.o $(O)dokick.o -VOBJ06 = $(O)dothrow.o $(O)drawing.o $(O)dungeon.o $(O)eat.o -VOBJ07 = $(O)end.o $(O)engrave.o $(O)exper.o $(O)explode.o -VOBJ08 = $(O)extralev.o $(O)files.o $(O)fountain.o $(O)hack.o -VOBJ09 = $(O)hacklib.o $(O)invent.o $(O)light.o $(O)lock.o -VOBJ10 = $(O)mail.o $(O)pcmain.o $(O)makemon.o $(O)mapglyph.o -VOBJ11 = $(O)mcastu.o $(O)mhitm.o $(O)mhitu.o $(O)minion.o -VOBJ12 = $(O)mklev.o $(O)mkmap.o $(O)mkmaze.o $(O)mkobj.o -VOBJ13 = $(O)mkroom.o $(O)mon.o $(O)mondata.o $(O)monmove.o -VOBJ14 = $(O)monst.o $(O)mplayer.o $(O)mthrowu.o $(O)muse.o -VOBJ15 = $(O)music.o $(O)o_init.o $(O)objects.o $(O)objnam.o -VOBJ16 = $(O)options.o $(O)pager.o $(O)pickup.o $(O)pline.o -VOBJ17 = $(O)polyself.o $(O)potion.o $(O)pray.o $(O)priest.o -VOBJ18 = $(O)quest.o $(O)questpgr.o $(RANDOM) $(O)read.o -VOBJ19 = $(O)rect.o $(O)region.o $(O)restore.o $(O)rip.o -VOBJ20 = $(O)rnd.o $(O)role.o $(O)rumors.o $(O)save.o -VOBJ21 = $(O)shk.o $(O)shknam.o $(O)sit.o $(O)sounds.o -VOBJ22 = $(O)sp_lev.o $(O)spell.o $(O)steal.o $(O)steed.o -VOBJ23 = $(O)sys.o $(O)teleport.o $(O)timeout.o $(O)topten.o -VOBJ24 = $(O)track.o $(O)trap.o $(O)u_init.o $(O)uhitm.o -VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o -VOBJ26 = $(O)were.o $(O)wield.o $(O)windows.o $(O)wizard.o -VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o -VOBJ28 = $(O)win10.o - -DLBOBJ = $(O)dlb.o - -REGEX = $(O)cppregex.o - -TTYOBJ = $(O)topl.o $(O)getline.o $(O)wintty.o - -!IFNDEF ADD_CURSES -CURSESOBJ= -!ELSE -CURSESOBJ= $(O)cursdial.o $(O)cursinit.o $(O)cursinvt.o $(O)cursmain.o \ - $(O)cursmesg.o $(O)cursmisc.o $(O)cursstat.o $(O)curswins.o -!ENDIF - -SOBJ = $(O)winnt.o $(O)pcsys.o $(O)pcunix.o \ - $(SOUND) $(O)nhlan.o - -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) $(VOBJ28) $(VOBJ29) $(REGEX) \ - $(CURSESOBJ) - -GUIOBJ = $(O)mhaskyn.o $(O)mhdlg.o \ - $(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \ - $(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o $(O)mhsplash.o \ - $(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o - -GUIHDR = $(MSWIN)\mhaskyn.h $(MSWIN)\mhdlg.h $(MSWIN)\mhfont.h \ - $(MSWIN)\mhinput.h $(MSWIN)\mhmain.h $(MSWIN)\mhmap.h $(MSWIN)\mhmenu.h \ - $(MSWIN)\mhmsg.h $(MSWIN)\mhmsgwnd.h $(MSWIN)\mhrip.h $(MSWIN)\mhstatus.h \ - $(MSWIN)\mhtext.h $(MSWIN)\resource.h $(MSWIN)\winMS.h - -COMCTRL = comctl32.lib - -KEYDLLS = $(GAMEDIR)\nhdefkey.dll $(GAMEDIR)\nh340key.dll \ - $(GAMEDIR)\nhraykey.dll - -TILEUTIL16 = $(UTIL)\tile2bmp.exe -TILEBMP16 = $(SRC)\tiles.bmp - -TILEUTIL32 = $(UTIL)\til2bm32.exe -TILEBMP32 = $(SRC)\tiles32.bmp - -SOUND = $(OBJ)\ntsound.o - -VVOBJ = $(O)version.o - -ALLOBJ = $(SOBJ) $(DLBOBJ) $(WOBJ) $(OBJS) $(VVOBJ) - -OPTIONS_FILE = $(DAT)\options - -!IF "$(ADD_CURSES)" == "Y" -#========================================== -# PDCurses build macros -#========================================== -PDCURSES_CURSES_H = $(PDCURSES_TOP)\curses.h -PDCURSES_CURSPRIV_H = $(PDCURSES_TOP)\curspriv.h -PDCURSES_HEADERS = $(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) -PDCSRC = $(PDCURSES_TOP)\pdcurses -PDCWINCON = $(PDCURSES_TOP)\wincon -PDCLIBOBJS = $(O)addch.o $(O)addchstr.o $(O)addstr.o $(O)attr.o $(O)beep.o \ - $(O)bkgd.o $(O)border.o $(O)clear.o $(O)color.o $(O)delch.o $(O)deleteln.o \ - $(O)deprec.o $(O)getch.o $(O)getstr.o $(O)getyx.o $(O)inch.o $(O)inchstr.o \ - $(O)initscr.o $(O)inopts.o $(O)insch.o $(O)insstr.o $(O)instr.o $(O)kernel.o \ - $(O)keyname.o $(O)mouse.o $(O)move.o $(O)outopts.o $(O)overlay.o $(O)pad.o \ - $(O)panel.o $(O)printw.o $(O)refresh.o $(O)scanw.o $(O)scr_dump.o $(O)scroll.o \ - $(O)slk.o $(O)termattr.o $(O)terminfo.o $(O)touch.o $(O)util.o $(O)window.o \ - $(O)debug.o - -PDCOBJS = $(O)pdcclip.o $(O)pdcdisp.o $(O)pdcgetsc.o $(O)pdckbd.o $(O)pdcscrn.o \ - $(O)pdcsetsc.o $(O)pdcutil.o - -PDCLIB = $(O)pdcurses.lib - -PDCINCL = /I$(PDCURSES_TOP) /I$(PDCSRC) /I$(PDCWINCON) - -!ELSE -PDCLIB = -!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 - -HACK_H = $(INCL)\hack.h $(CONFIG_H) $(INCL)\align.h $(INCL)\context.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)\lint.h \ - $(INCL)\mextra.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)\botl.h \ - $(INCL)\wintty.h $(INCL)\sys.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 - #========================================== #========================================== # Setting up the compiler and linker #========================================== #========================================== -cc=cl -link=link -rc=Rc - # Before we get started, this section is used to determine the version of # Visual Studio we are using. We set VSVER to 0000 to flag any version that # is too old or untested. @@ -436,6 +246,204 @@ CL_RECENT=-sdl ! ENDIF !ENDIF + +#========================================== +#================ MACROS ================== +#========================================== +# This section creates shorthand macros for many objects +# referenced later on in the Makefile. +# +# +# Shorten up the location for some files +# + +O = $(OBJ)^\ + +U = $(UTIL)^\ + +# +# Utility Objects. +# + +MAKESRC = $(U)makedefs.c + +MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o + +LEVCOMPOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ + $(O)alloc.o $(O)decl.o $(O)drawing.o $(O)monst.o $(O)objects.o $(O)panic.o + +DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_lex.o $(O)dgn_main.o \ + $(O)alloc.o $(O)panic.o + +RECOVOBJS = $(O)recover.o + +TILEFILES = $(WSHR)\monsters.txt $(WSHR)\objects.txt $(WSHR)\other.txt + +# +# These are not invoked during a normal game build in 3.4 +# +TEXT_IO = $(O)tiletext.o $(O)tiletxt.o $(O)drawing.o \ + $(O)decl.o $(O)monst.o $(O)objects.o + +TEXT_IO32 = $(O)tilete32.o $(O)tiletx32.o $(O)drawing.o \ + $(O)decl.o $(O)monst.o $(O)objects.o + +GIFREADERS = $(O)gifread.o $(O)alloc.o $(O)panic.o +GIFREADERS32 = $(O)gifrd32.o $(O)alloc.o $(O)panic.o + +PPMWRITERS = $(O)ppmwrite.o $(O)alloc.o $(O)panic.o + +# +# Object files for the game itself. +# + +VOBJ01 = $(O)allmain.o $(O)alloc.o $(O)apply.o $(O)artifact.o +VOBJ02 = $(O)attrib.o $(O)ball.o $(O)bones.o $(O)botl.o +VOBJ03 = $(O)cmd.o $(O)dbridge.o $(O)decl.o $(O)detect.o +VOBJ04 = $(O)dig.o $(O)display.o $(O)do.o $(O)do_name.o +VOBJ05 = $(O)do_wear.o $(O)dog.o $(O)dogmove.o $(O)dokick.o +VOBJ06 = $(O)dothrow.o $(O)drawing.o $(O)dungeon.o $(O)eat.o +VOBJ07 = $(O)end.o $(O)engrave.o $(O)exper.o $(O)explode.o +VOBJ08 = $(O)extralev.o $(O)files.o $(O)fountain.o $(O)hack.o +VOBJ09 = $(O)hacklib.o $(O)invent.o $(O)light.o $(O)lock.o +VOBJ10 = $(O)mail.o $(O)pcmain.o $(O)makemon.o $(O)mapglyph.o $(O)mcastu.o +VOBJ11 = $(O)mhitm.o $(O)mhitu.o $(O)minion.o $(O)mklev.o +VOBJ12 = $(O)mkmap.o $(O)mkmaze.o $(O)mkobj.o $(O)mkroom.o +VOBJ13 = $(O)mon.o $(O)mondata.o $(O)monmove.o $(O)monst.o +VOBJ14 = $(O)mplayer.o $(O)mthrowu.o $(O)muse.o +VOBJ15 = $(O)music.o $(O)o_init.o $(O)objects.o $(O)objnam.o +VOBJ16 = $(O)options.o $(O)pager.o $(O)pickup.o $(O)pline.o +VOBJ17 = $(O)polyself.o $(O)potion.o $(O)pray.o $(O)priest.o +VOBJ18 = $(O)quest.o $(O)questpgr.o $(RANDOM) $(O)read.o +VOBJ19 = $(O)rect.o $(O)region.o $(O)restore.o $(O)rip.o +VOBJ20 = $(O)rnd.o $(O)role.o $(O)rumors.o $(O)save.o +VOBJ21 = $(O)shk.o $(O)shknam.o $(O)sit.o $(O)sounds.o +VOBJ22 = $(O)sp_lev.o $(O)spell.o $(O)steal.o $(O)steed.o +VOBJ23 = $(O)sys.o $(O)teleport.o $(O)timeout.o $(O)topten.o +VOBJ24 = $(O)track.o $(O)trap.o $(O)u_init.o $(O)uhitm.o +VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o +VOBJ26 = $(O)were.o $(O)wield.o $(O)windows.o $(O)wizard.o +VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o +VOBJ28 = $(O)win10.o + +DLBOBJ = $(O)dlb.o + +REGEX = $(O)cppregex.o + +TTYOBJ = $(O)topl.o $(O)getline.o $(O)wintty.o + +!IFNDEF ADD_CURSES +CURSESOBJ= +!ELSE +CURSESOBJ= $(O)cursdial.o $(O)cursinit.o $(O)cursinvt.o $(O)cursmain.o \ + $(O)cursmesg.o $(O)cursmisc.o $(O)cursstat.o $(O)curswins.o +!ENDIF + +SOBJ = $(O)winnt.o $(O)pcsys.o $(O)pcunix.o \ + $(SOUND) $(O)nhlan.o + +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) $(VOBJ28) $(VOBJ29) $(REGEX) \ + $(CURSESOBJ) + +GUIOBJ = $(O)mhaskyn.o $(O)mhdlg.o \ + $(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \ + $(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o $(O)mhsplash.o \ + $(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o + +GUIHDR = $(MSWIN)\mhaskyn.h $(MSWIN)\mhdlg.h $(MSWIN)\mhfont.h \ + $(MSWIN)\mhinput.h $(MSWIN)\mhmain.h $(MSWIN)\mhmap.h $(MSWIN)\mhmenu.h \ + $(MSWIN)\mhmsg.h $(MSWIN)\mhmsgwnd.h $(MSWIN)\mhrip.h $(MSWIN)\mhstatus.h \ + $(MSWIN)\mhtext.h $(MSWIN)\resource.h $(MSWIN)\winMS.h + +COMCTRL = comctl32.lib + +KEYDLLS = $(GAMEDIR)\nhdefkey.dll $(GAMEDIR)\nh340key.dll $(GAMEDIR)\nhraykey.dll + +TILEUTIL16 = $(UTIL)\tile2bmp.exe +TILEBMP16 = $(SRC)\tiles.bmp + +TILEUTIL32 = $(UTIL)\til2bm32.exe +TILEBMP32 = $(SRC)\tiles32.bmp + +SOUND = $(OBJ)\ntsound.o + +VVOBJ = $(O)version.o + +ALLOBJ = $(SOBJ) $(DLBOBJ) $(WOBJ) $(OBJS) $(VVOBJ) + +OPTIONS_FILE = $(DAT)\options + +!IF "$(ADD_CURSES)" == "Y" +#========================================== +# PDCurses build macros +#========================================== +PDCURSES_CURSES_H = $(PDCURSES_TOP)\curses.h +PDCURSES_CURSPRIV_H = $(PDCURSES_TOP)\curspriv.h +PDCURSES_HEADERS = $(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PDCSRC = $(PDCURSES_TOP)\pdcurses +PDCWINCON = $(PDCURSES_TOP)\wincon +PDCLIBOBJS = $(O)addch.o $(O)addchstr.o $(O)addstr.o $(O)attr.o $(O)beep.o \ + $(O)bkgd.o $(O)border.o $(O)clear.o $(O)color.o $(O)delch.o $(O)deleteln.o \ + $(O)deprec.o $(O)getch.o $(O)getstr.o $(O)getyx.o $(O)inch.o $(O)inchstr.o \ + $(O)initscr.o $(O)inopts.o $(O)insch.o $(O)insstr.o $(O)instr.o $(O)kernel.o \ + $(O)keyname.o $(O)mouse.o $(O)move.o $(O)outopts.o $(O)overlay.o $(O)pad.o \ + $(O)panel.o $(O)printw.o $(O)refresh.o $(O)scanw.o $(O)scr_dump.o $(O)scroll.o \ + $(O)slk.o $(O)termattr.o $(O)terminfo.o $(O)touch.o $(O)util.o $(O)window.o \ + $(O)debug.o + +PDCOBJS = $(O)pdcclip.o $(O)pdcdisp.o $(O)pdcgetsc.o $(O)pdckbd.o $(O)pdcscrn.o \ + $(O)pdcsetsc.o $(O)pdcutil.o + +PDCLIB = $(O)\pdcurses.lib + +PDCINCL = /I$(PDCURSES_TOP) /I$(PDCSRC) /I$(PDCWINCON) + +!ELSE +PDCLIB = +!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 + +HACK_H = $(INCL)\hack.h $(CONFIG_H) $(INCL)\align.h $(INCL)\context.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)\lint.h \ + $(INCL)\mextra.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)\botl.h \ + $(INCL)\wintty.h $(INCL)\sys.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 + #========================================== # More compiler setup post-macros #========================================== @@ -444,23 +452,12 @@ CL_RECENT=-sdl !IF "$(ADD_CURSES)" == "Y" #CURSESDEF=-D"PDC_DLL_BUILD" -D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" -CURSESINCL=..\win\curses !ELSE CURSDEF= CURSESLIB= CURSESINCL= !ENDIF -!IFNDEF ADD_CURSES -INCLDIR= /I..\include /I..\sys\winnt -!ELSE -INCLDIR= /I..\include /I..\sys\winnt /I$(CURSESINCL) -!ENDIF - -#=========================================== -#---- start of Visual Studio Specific macros -#=========================================== - ccommon= -c -nologo -D"_CONSOLE" -D"_CRT_NONSTDC_NO_DEPRECATE" -D"_CRT_SECURE_NO_DEPRECATE" \ -D"_LIB" -D"_SCL_SECURE_NO_DEPRECATE" -D"_VC80_UPGRADE=0x0600" -D"DLB" -D"_MBCS" \ -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D"NDEBUG" -D"YY_NO_UNISTD_H" $(CURSESDEF) \ @@ -530,6 +527,12 @@ conlibs = $(baselibs) guilibs = $(winlibs) # +!IFNDEF ADD_CURSES +INCLDIR= /I..\include /I..\sys\winnt +!ELSE +INCLDIR= /I..\include /I..\sys\winnt /I$(CURSESINCL) +!ENDIF + #========================================== # Util builds #========================================== @@ -549,10 +552,6 @@ DLB = nhdat DLB = ! ENDIF -#========================================== -#---- end of Visual Studio Specific macros -#========================================== - #========================================== #================ RULES ================== #========================================== @@ -631,6 +630,9 @@ DLB = {$(WCURSES)}.c{$(OBJ)}.o: @$(cc) $(PDCINCL) $(cflagsBuild) -Fo$@ $< +#{$(WCURSES)}.txt{$(DAT)}.txt: +# @copy $< $@ + #========================================== # Rules for files in PDCurses #========================================== @@ -663,11 +665,11 @@ default : install all : install -install: envchk.tag utility.tag $(GAMEDIR)\NetHack.exe $(GAMEDIR)\NetHackW.exe install.tag +install: $(O)envchk.tag $(O)obj.tag $(O)utility.tag $(GAMEDIR)\NetHack.exe $(GAMEDIR)\NetHackW.exe $(O)install.tag @echo Done. -install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \ - $(DAT)\oracles $(DAT)\quest.dat sp_lev.tag $(DLB) +$(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) @@ -682,12 +684,10 @@ install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \ if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR) if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt - $(U)makedefs -c - -if not exist $(GAMEDIR)\defaults.nh copy fixed_defaults.nh $(GAMEDIR)\defaults.nh - -if not exist $(GAMEDIR)\defaults.nh copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh - -if not exist $(GAMEDIR)\record. goto>$(GAMEDIR)\record. @if exist $(GAMEDIR)\NetHack.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHack.PDB to conserve space @if exist $(GAMEDIR)\NetHackW.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHackW.PDB to conserve space + -if not exist $(GAMEDIR)\defaults.nh copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh + -if not exist $(GAMEDIR)\record. goto>$(GAMEDIR)\record. echo install done > $@ # copy $(MSWSYS)\winnt.hlp $(GAMEDIR) @@ -696,7 +696,7 @@ recover: $(U)recover.exe if exist $(U)recover.exe copy $(U)recover.exe $(GAMEDIR) if exist $(DOC)\recover.txt copy $(DOC)\recover.txt $(GAMEDIR)\recover.txt -sp_lev.tag: utility.tag $(DAT)\bigroom.des $(DAT)\castle.des \ +$(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 \ @@ -730,9 +730,9 @@ sp_lev.tag: utility.tag $(DAT)\bigroom.des $(DAT)\castle.des \ $(U)levcomp valkyrie.des $(U)levcomp wizard.des cd $(SRC) - echo sp_levs done > sp_lev.tag + echo sp_levs done > $(O)sp_lev.tag -utility.tag: $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h \ +$(O)utility.tag: $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h \ $(SRC)\vis_tab.c \ $(U)levcomp.exe $(INCL)\vis_tab.h \ $(U)dgncomp.exe $(TILEUTIL16) @@ -752,10 +752,10 @@ $(O)console.res: $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico @$(rc) -r -fo$@ -i$(MSWSYS) -dNDEBUG $(MSWSYS)\console.rc -#========================================================================== +#========================================== # The game targets. -#========================================================================== -#[VS-start] Visual C +#========================================== + # 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 @@ -777,8 +777,6 @@ $(O)console.res: $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico # with ^ as we have done below. Every occurence # of a in $(ALLOBJ) is replaced by # <+>. -#[VS-end] -#========================================================================== GAMEOBJ=$(ALLOBJ:^ =^ ) @@ -798,7 +796,7 @@ GAMEOBJ=$(GAMEOBJ:^ =^ # objs: $(GAMEOBJ) $(TTYOBJ) $(O)tile.o $(O)guistub.o -$(GAMEDIR)\NetHack.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistub.o \ +$(GAMEDIR)\NetHack.exe : $(O)gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistub.o \ $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)console.res $(KEYDLLS) @if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR) @echo Linking $(@:\=/) @@ -811,7 +809,7 @@ $(GAMEDIR)\NetHack.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistu $(O)guistub.o $(O)console.res << - @if exist install.tag del install.tag + @if exist $(O)install.tag del $(O)install.tag # NetHackW # full tty linkage libs: @@ -821,8 +819,8 @@ $(GAMEDIR)\NetHack.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistu # libs: $(LIBS) $(guilibs) $(COMCTRL) # objs: $(GAMEOBJ) $(GUIOBJ) $(O)tile.o $(O)ttystub.o -$(GAMEDIR)\NetHackW.exe : gamedir.tag $(O)tile.o $(O)ttystub.o \ - $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)winhack.res gamedir.tag $(KEYDLLS) +$(GAMEDIR)\NetHackW.exe : $(O)gamedir.tag $(O)tile.o $(O)ttystub.o \ + $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)winhack.res $(O)gamedir.tag $(KEYDLLS) @if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR) @echo Linking $(@:\=/) $(link) $(lflagsBuild) $(guilflags) /STACK:2048 /PDB:$(GAMEDIR)\$(@B).PDB \ @@ -833,11 +831,9 @@ $(GAMEDIR)\NetHackW.exe : gamedir.tag $(O)tile.o $(O)ttystub.o \ $(O)ttystub.o $(O)winhack.res << - @echo Adding manifest - mt.exe -manifest $(MSWIN)\NetHackW.exe.manifest -outputresource:$(GAMEDIR)\NetHackW.exe;1 - @if exist install.tag del install.tag + @if exist $(O)install.tag del $(O)install.tag -gamedir.tag: +$(O)gamedir.tag: @if not exist $(GAMEDIR)\*.* echo creating directory $(GAMEDIR:\=/) @if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR) @echo directory created > $@ @@ -855,7 +851,7 @@ $(O)nhdefkey.def: @echo KeyHandlerName >>$@ ! ENDIF -$(GAMEDIR)\nhdefkey.dll : $(O)$(@B).o gamedir.tag $(O)$(@B).def +$(GAMEDIR)\nhdefkey.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def @echo Linking $(@:\=/) @$(link) $(ldebug) /RELEASE /DLL user32.lib \ /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).map" /DEF:$(O)$(@B).def \ @@ -874,7 +870,7 @@ $(O)nh340key.def: @echo KeyHandlerName >>$@ ! ENDIF -$(GAMEDIR)\nh340key.dll : $(O)$(@B).o gamedir.tag $(O)$(@B).def +$(GAMEDIR)\nh340key.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def @echo Linking $(@:\=/) @$(link) $(ldebug) /RELEASE /NOLOGO /DLL user32.lib \ /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).map" /DEF:$(O)$(@B).def \ @@ -893,20 +889,26 @@ $(O)nhraykey.def: @echo KeyHandlerName >>$@ ! ENDIF -$(GAMEDIR)\nhraykey.dll : $(O)$(@B).o gamedir.tag $(O)$(@B).def +$(GAMEDIR)\nhraykey.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def @echo Linking $(@:\=/) @$(link) $(ldebug) /RELEASE /NOLOGO /DLL user32.lib \ /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).map" /DEF:$(O)$(@B).def \ /IMPLIB:$(O)$(@B).lib -out:$@ $(O)$(@B).o - -#========================================== -#=========== SECONDARY TARGETS ============ -#========================================== +# +# Secondary Targets. +# #========================================== # Makedefs Stuff #========================================== +$(U)nhsizes.exe: $(O)nhsizes.o + @echo Linking $(@:\=/) + $(link) $(lflagsBuild) -out:$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o + +$(O)nhsizes.o: $(CONFIG_H) nhsizes.c + @$(cc) $(cflagsBuild) -Fo$@ nhsizes.c + $(U)makedefs.exe: $(MAKEOBJS) @echo Linking $(@:\=/) @$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(MAKEOBJS) @@ -938,33 +940,6 @@ $(INCL)\vis_tab.h: $(U)makedefs.exe $(SRC)\vis_tab.c: $(U)makedefs.exe $(U)makedefs -z -$(DAT)\data: utility.tag $(DATABASE) - $(U)makedefs -d - -$(DAT)\rumors: utility.tag $(DAT)\rumors.tru $(DAT)\rumors.fal - $(U)makedefs -r - -$(DAT)\quest.dat: utility.tag $(DAT)\quest.txt - $(U)makedefs -q - -$(DAT)\oracles: utility.tag $(DAT)\oracles.txt - $(U)makedefs -h - -$(DAT)\engrave: $(DAT)\engrave.txt $(U)makedefs.exe - $(U)makedefs -s - -$(DAT)\epitaph: $(DAT)\epitaph.txt $(U)makedefs.exe - $(U)makedefs -s - -$(DAT)\bogusmon: $(DAT)\bogusmon.txt $(U)makedefs.exe - $(U)makedefs -s - -$(DAT)\dungeon: utility.tag $(DAT)\dungeon.def - $(U)makedefs -e - cd $(DAT) - $(U)dgncomp dungeon.pdf - cd $(SRC) - #========================================== # uudecode utility and uuencoded targets #========================================== @@ -1085,28 +1060,43 @@ $(U)dgncomp.exe: $(DGNCOMPOBJS) ) << -#================================================= -# For a couple of devteam utilities -#================================================= - -$(U)nhsizes.exe: $(O)nhsizes.o - @echo Linking $(@:\=/) - $(link) $(lflagsBuild) -out:$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o - -$(U)nhsizes2.exe: $(O)nhsizes2.o - @echo Linking $(@:\=/) - $(link) $(lflagsBuild) -out:$@ $(O)nhsizes2.o $(O)panic.o $(O)alloc.o - -$(O)nhsizes.o: $(CONFIG_H) nhsizes.c - @$(cc) $(cflagsBuild) -Fo$@ nhsizes.c - -$(O)nhsizes2.o: $(CONFIG_H) nhsizes2.c - @$(cc) $(cflagsBuild) -Fo$@ nhsizes2.c - #================================================= # 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. +#========================================== + +$(O)envchk.tag: $(O)obj.tag +! IF "$(TARGET_CPU)"=="x64" + @echo Windows x64 64-bit target build +! ELSE + @echo Windows x86 32-bit target build +! ENDIF +!IFDEF TTYOBJ + @echo tty window support included +! IF "$(ADD_CURSES)"=="Y" + @echo curses window support also included +! ENDIF +!ENDIF +! IF "$(CL)"!="" +# @echo Warning, the CL Environment variable is defined: +# @echo CL=$(CL) +! ENDIF + echo envchk >$@ + +#========================================== +#=========== SECONDARY TARGETS ============ +#========================================== + #========================================== # DLB utility and nhdat file creation #========================================== @@ -1132,7 +1122,7 @@ $(DAT)\porthelp: $(MSWSYS)\porthelp nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \ $(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp $(DAT)\keyhelp \ $(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon $(DAT)\porthelp \ - $(DAT)\license $(DAT)\engrave $(DAT)\epitaph $(DAT)\bogusmon $(DAT)\tribute sp_lev.tag + $(DAT)\license $(DAT)\engrave $(DAT)\epitaph $(DAT)\bogusmon $(DAT)\tribute $(O)sp_lev.tag cd $(DAT) echo data >dlb.lst echo oracles >>dlb.lst @@ -1268,41 +1258,12 @@ $(O)til2bm32.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(MSWSYS)\win32api.h @$(cc) $(cflagsBuild) -I$(WSHR) /DPACKED_FILE /DTILE_X=32 /DTILE_Y=32 /Fo$@ $(WSHR)\tile2bmp.c #========================================== -# PDCurses Library +# PDCurses #========================================== -$(O)pdcurses.lib : $(PDCLIBOBJS) $(PDCOBJS) +$(O)\pdcurses.lib : $(PDCLIBOBJS) $(PDCOBJS) lib -nologo /out:$@ $(PDCLIBOBJS) $(PDCOBJS) -#========================================== -# Notify of any CL environment variables -# in effect since they change the compiler -# options. -#========================================== - -envchk.tag: obj.tag -! IF "$(TARGET_CPU)"=="x64" - @echo Windows x64 64-bit target build -! ELSE - @echo Windows x86 32-bit target build -! ENDIF -!IFDEF TTYOBJ - @echo tty window support included -! IF "$(ADD_CURSES)"=="Y" - @echo curses window support also included -! ENDIF -!ENDIF -! IF "$(CL)"!="" -# @echo Warning, the CL Environment variable is defined: -# @echo CL=$(CL) -! ENDIF - -obj.tag: - echo envchk >$@ - @if not exist $(OBJ)\*.* echo creating directory $(OBJ:\=/) - @if not exist $(OBJ)\*.* mkdir $(OBJ) - @echo directory created >$@ - #========================================== # Housekeeping #========================================== @@ -1366,10 +1327,11 @@ spotless: clean if exist $(DAT)\wizard?.lev del $(DAT)\wizard?.lev if exist $(DAT)\dlb.lst del $(DAT)\dlb.lst if exist $(DAT)\porthelp del $(DAT)\porthelp - if exist sp_lev.tag del sp_lev.tag + if exist $(O)sp_lev.tag del $(O)sp_lev.tag if exist $(SRC)\vis_tab.c del $(SRC)\vis_tab.c if exist nhdat. del nhdat. - if exist gamedir.tag del gamedir.tag + if exist $(O)obj.tag del $(O)obj.tag + if exist $(O)gamedir.tag del $(O)gamedir.tag if exist $(O)nh*key.lib del $(O)nh*key.lib if exist $(O)nh*key.exp del $(O)nh*key.exp if exist $(MSWIN)\mnsel.bmp del $(MSWIN)\mnsel.bmp @@ -1391,20 +1353,19 @@ spotless: clean !ENDIF clean: if exist $(O)*.o del $(O)*.o - if exist utility.tag del utility.tag + if exist $(O)utility.tag del $(O)utility.tag if exist $(U)makedefs.exe del $(U)makedefs.exe if exist $(U)levcomp.exe del $(U)levcomp.exe if exist $(U)dgncomp.exe del $(U)dgncomp.exe if exist $(SRC)\*.lnk del $(SRC)\*.lnk if exist $(SRC)\*.map del $(SRC)\*.map - if exist $(SRC)\fixed_defaults.nh del $(SRC)\fixed_defaults.nh - if exist install.tag del install.tag + if exist $(O)install.tag del $(O)install.tag if exist $(O)console.res del $(O)console.res if exist $(O)dgncomp.MAP del $(O)dgncomp.MAP if exist $(O)dgncomp.PDB del $(O)dgncomp.PDB if exist $(O)dlb_main.MAP del $(O)dlb_main.MAP if exist $(O)dlb_main.PDB del $(O)dlb_main.PDB - if exist gamedir.tag del gamedir.tag + if exist $(O)gamedir.tag del $(O)gamedir.tag if exist $(O)levcomp.MAP del $(O)levcomp.MAP if exist $(O)levcomp.PDB del $(O)levcomp.PDB if exist $(O)makedefs.MAP del $(O)makedefs.MAP @@ -1425,8 +1386,9 @@ clean: if exist $(O)nhraykey.lib del $(O)nhraykey.lib if exist $(O)nhraykey.map del $(O)nhraykey.map if exist $(O)nhraykey.PDB del $(O)nhraykey.PDB - if exist envchk.tag del envchk.tag - if exist sp_lev.tag del sp_lev.tag + if exist $(O)envchk.tag del $(O)envchk.tag + if exist $(O)obj.tag del $(O)obj.tag + if exist $(O)sp_lev.tag del $(O)sp_lev.tag if exist $(O)uudecode.MAP del $(O)uudecode.MAP if exist $(O)uudecode.PDB del $(O)uudecode.PDB rem @@ -1444,6 +1406,37 @@ clean: # 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)\engrave: $(DAT)\engrave.txt $(U)makedefs.exe + $(U)makedefs -s + +$(DAT)\epitaph: $(DAT)\epitaph.txt $(U)makedefs.exe + $(U)makedefs -s + +$(DAT)\bogusmon: $(DAT)\bogusmon.txt $(U)makedefs.exe + $(U)makedefs -s + +$(DAT)\dungeon: $(O)utility.tag $(DAT)\dungeon.def + $(U)makedefs -e + cd $(DAT) + $(U)dgncomp dungeon.pdf + cd $(SRC) + # # NT dependencies # @@ -1475,8 +1468,6 @@ $(O)winhack.o: $(HACK_H) $(MSWIN)\winhack.c $(O)ttystub.o: $(HACK_H) $(MSWSYS)\stubs.c @$(cc) $(cflagsBuild) -DTTYSTUB -Fo$@ $(MSWSYS)\stubs.c -$(O)tile.o: $(SRC)\tile.c $(HACK_H) - # # util dependencies # @@ -1490,21 +1481,18 @@ $(O)panic.o: $(U)panic.c $(CONFIG_H) (O)cppregex.o: $(O)cppregex.cpp $(HACK_H) @$(CC) $(cflagsBuild) -Fo$@ ..\sys\share\cppregex.cpp -# -# Other dependencies needed by some ports + # - # curses window port dependencies - -$(O)cursdial.o: $(WCURSES)\cursdial.c $(WCURSES)\cursdial.h $(INCL)\wincurs.h -$(O)cursinit.c: $(WCURSES)\cursinit.c $(WCURSES)\cursinit.h $(INCL)\wincurs.h -$(O)cursinvt.c: $(WCURSES)\cursinvt.c $(WCURSES)\cursinvt.h $(INCL)\wincurs.h -$(O)cursmain.c: $(WCURSES)\cursmain.c $(WCURSES)\cursmain.h $(INCL)\wincurs.h -$(O)cursmesg.c: $(WCURSES)\cursmesg.c $(WCURSES)\cursmesg.h $(INCL)\wincurs.h -$(O)cursmisc.c: $(WCURSES)\cursmisc.c $(WCURSES)\cursmisc.h $(INCL)\wincurs.h -$(O)cursstat.c: $(WCURSES)\cursstat.c $(WCURSES)\cursstat.h $(INCL)\wincurs.h -$(O)curswins.c: $(WCURSES)\curswins.c $(WCURSES)\curswins.h $(INCL)\wincurs.h - +# +$(O)\cursdial.o: $(WCURSES)\cursdial.c $(WCURSES)\cursdial.h $(INCL)\wincurs.h +$(O)\cursinit.c: $(WCURSES)\cursinit.c $(WCURSES)\cursinit.h $(INCL)\wincurs.h +$(O)\cursinvt.c: $(WCURSES)\cursinvt.c $(WCURSES)\cursinvt.h $(INCL)\wincurs.h +$(O)\cursmain.c: $(WCURSES)\cursmain.c $(WCURSES)\cursmain.h $(INCL)\wincurs.h +$(O)\cursmesg.c: $(WCURSES)\cursmesg.c $(WCURSES)\cursmesg.h $(INCL)\wincurs.h +$(O)\cursmisc.c: $(WCURSES)\cursmisc.c $(WCURSES)\cursmisc.h $(INCL)\wincurs.h +$(O)\cursstat.c: $(WCURSES)\cursstat.c $(WCURSES)\cursstat.h $(INCL)\wincurs.h +$(O)\curswins.c: $(WCURSES)\curswins.c $(WCURSES)\curswins.h $(INCL)\wincurs.h # # The rest are stolen from sys/unix/Makefile.src, # with the following changes: @@ -1577,6 +1565,7 @@ $(O)wintext.o: ..\win\X11\wintext.c $(HACK_H) $(INCL)\winX.h $(INCL)\xwindow.h @$(CC) $(cflagsBuild) -Fo$@ ..\win\X11\wintext.c $(O)winval.o: ..\win\X11\winval.c $(HACK_H) $(INCL)\winX.h @$(CC) $(cflagsBuild) -Fo$@ ..\win\X11\winval.c +$(O)tile.o: $(SRC)\tile.c $(HACK_H) $(O)gnaskstr.o: ..\win\gnome\gnaskstr.c ..\win\gnome\gnaskstr.h \ ..\win\gnome\gnmain.h @$(CC) $(cflagsBuild) $(GNOMEINC) -Fo$@ ..\win\gnome\gnaskstr.c diff --git a/win/win32/dgnstuff-mingw32.mak b/win/win32/dgnstuff-mingw32.mak new file mode 100644 index 000000000..d81c95795 --- /dev/null +++ b/win/win32/dgnstuff-mingw32.mak @@ -0,0 +1,93 @@ +# $NHDT-Date: 1524689255 2018/04/25 20:47:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.12 $ +# Copyright (c) 2018 by Michael Allison +# NetHack may be freely redistributed. See license for details. + +# Set all of these or none of them. +# +# bison and flex are the ones found in GnuWin32, which +# is probably the easiest set of these tools to find +# on Windows. +# +#YACC = bison.exe -y +#LEX = flex.exe +#YTABC = y.tab.c +#YTABH = y.tab.h +#LEXYYC = lex.yy.c +SHELL=cmd.exe + +default: all + +all: tools ../util/dgn_yacc.c ../util/dgn_lex.c + +rebuild: clean all + +clean: + -del ..\util\dgn_lex.c + -del ..\util\dgn_yacc.c + -del ..\include\dgn_comp.h + +tools: +ifneq "$(YACC)" "" + @echo Yacc-alike set to $(YACC) + @echo YTABC set to $(YTABC) + @echo YTABH set to $(YTABH) +endif + +ifneq "$(LEX)" "" + @echo Lex-alike set to $(LEX) + @echo LEXYYC set to $(LEXYYC) +endif + +#========================================== +# Dungeon Compiler Stuff +#========================================== + +../include/dgn_comp.h : ../util/dgn_comp.y +ifeq "$(YACC)" "" + @echo Using pre-built dgn_comp.h + chdir ..\include + copy /y ..\sys\share\dgn_comp.h + copy /b dgn_comp.h+,, + chdir ..\src +else + chdir ..\util + $(YACC) -d dgn_comp.y + copy $(YTABC) $@ + copy $(YTABH) ..\include\dgn_comp.h + @del $(YTABC) + @del $(YTABH) + chdir ..\build +endif + +../util/dgn_yacc.c : ../util/dgn_comp.y +ifeq "$(YACC)" "" + @echo Using pre-built dgn_yacc.c + chdir ..\util + copy /y ..\sys\share\dgn_yacc.c + copy /b dgn_yacc.c+,, + chdir ..\src +else + chdir ..\util + $(YACC) -d dgn_comp.y + copy $(YTABC) $@ + copy $(YTABH) ..\include\dgn_comp.h + @del $(YTABC) + @del $(YTABH) + chdir ..\build +endif + +../util/dgn_lex.c: ../util/dgn_comp.l +ifeq "$(LEX)" "" + @echo Using pre-built dgn_lex.c + chdir ..\util + copy /y ..\sys\share\dgn_lex.c + copy /b dgn_lex.c+,, + chdir ..\src +else + chdir ..\util + $(LEX) dgn_comp.l + copy $(LEXYYC) $@ + @del $(LEXYYC) + chdir ..\build +endif + diff --git a/win/win32/levstuff-mingw32.mak b/win/win32/levstuff-mingw32.mak new file mode 100644 index 000000000..524755c1f --- /dev/null +++ b/win/win32/levstuff-mingw32.mak @@ -0,0 +1,100 @@ +# $NHDT-Date: 1524689255 2018/04/25 20:47:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.12 $ +# Copyright (c) 2018 by Michael Allison +# NetHack may be freely redistributed. See license for details. + +# Set all of these or none of them. +# +# bison and flex are the ones found in GnuWin32, which +# is probably the easiest set of these tools to find +# on Windows. +# +#YACC = bison.exe -y +#LEX = flex.exe +#YTABC = y.tab.c +#YTABH = y.tab.h +#LEXYYC = lex.yy.c +SHELL = cmd.exe + +default: all + +all: tools ../util/lev_yacc.c ../util/lev_lex.c + +rebuild: clean all + +clean: + -del ..\util\lev_lex.c + -del ..\util\lev_yacc.c + -del ..\include\lev_comp.h + +tools: +ifneq "$(YACC)" "" + @echo Yacc-alike set to "$(YACC)" + @echo YTABC set to $(YTABC) + @echo YTABH set to $(YTABH) +endif + +ifneq "$(LEX)" "" + @echo Lex-alike set to "$(LEX)" + @echo LEXYYC set to $(LEXYYC) +endif + +#========================================== +# Level Compiler Stuff +#========================================== + +../include/lev_comp.h: ../util/lev_comp.y + @echo Yacc-alike set to "$(YACC)" +ifeq "$(YACC)" "" + @echo Using pre-built lev_comp.h + chdir ..\include + copy /y ..\sys\share\lev_comp.h + copy /b lev_comp.h+,, + chdir ..\src +else + @echo Generating lev_yacc.c and lev_comp.h + chdir ..\util + $(YACC) -d lev_comp.y + copy $(YTABC) $@ + copy $(YTABH) ..\include\lev_comp.h + @del $(YTABC) + @del $(YTABH) + chdir ..\src +endif + +../util/lev_yacc.c: ../util/lev_comp.y + @echo Yacc-alike set to "$(YACC)" +ifeq "$(YACC)" "" + @echo Using pre-built lev_yacc.c + chdir ..\util + copy /y ..\sys\share\lev_yacc.c + copy /b lev_yacc.c+,, + chdir ..\src +else + @echo Generating lev_yacc.c and lev_comp.h + chdir ..\util + $(YACC) -d lev_comp.y + copy $(YTABC) $@ + copy $(YTABH) ..\include\lev_comp.h + @del $(YTABC) + @del $(YTABH) + chdir ..\src +endif + +../util/lev_lex.c: ../util/lev_comp.l + @echo Lex-alike set to "$(LEX)" +ifeq "$(LEX)" "" + @echo Using pre-built lev_lex.c + chdir ..\util + copy /y ..\sys\share\lev_lex.c + copy /b lev_lex.c+,, + chdir ..\src +else + @echo Generating lev_lex.c + chdir ..\util + $(LEX) lev_comp.l + copy $(LEXYYC) $@ + @del $(LEXYYC) + chdir ..\src +endif + + diff --git a/win/win32/tiles-mingw32.mak b/win/win32/tiles-mingw32.mak new file mode 100644 index 000000000..115bb9d52 --- /dev/null +++ b/win/win32/tiles-mingw32.mak @@ -0,0 +1,27 @@ +#$NHDT-Date: 1524689255 2018/04/25 20:47:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.4 $ +# Copyright (c) 2002 by Michael Allison +# NetHack may be freely redistributed. See license for details. + +SHELL=cmd.exe + +default: all + +all: ../win/win32/tiles.bmp + +clean: + -del ..\src\win\win32\tiles.bmp + -del ..\win\win32\tiles.bmp + +#========================================== +# Building the tiles file tile.bmp +#========================================== + +../src/tiles.bmp : ../win/share/monsters.txt ../win/share/objects.txt \ + ../win/share/other.txt + chdir ..\src + ..\util\tile2bmp.exe tiles.bmp + chdir ..\build + +..\win\win32\tiles.bmp: ..\src\tiles.bmp + @copy ..\src\tiles.bmp ..\win\win32\tiles.bmp +