From 8d1aa429ca73213b37e846f9874f342d3ce88a75 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 28 Nov 2018 20:39:09 -0500 Subject: [PATCH 01/14] catch up on some fixes36.2 entries --- doc/fixes36.2 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index b840669b2..aec56b39d 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -263,6 +263,8 @@ windows-gui: In nethackw, there could be conflicts between menu accelerators and an extra choice accelerator to fix H7132. windows-gui: recognize new BL_RESET in status_update; no change in behavior yet windows-gui: align hpbar behavior at zero hit points with tty behavior +windows-gui: add support for status_hilites for the player condition field + such as stone, slime, strngl, blind, deaf, stun, conf, etc. windows-tty: Specify both width and height when creating font for width testing windows-tty: To counter lag problems that were occuring with the Win32 console port, implement a console back buffer to reduce the number of calls @@ -281,9 +283,14 @@ windows-tty: augment codepage850-to-Unicode mappings that are not displayable with codepage437-to-Unicode mappings that are, to help ensure that rogue-level characters in the status line match their appearance on the map +windows-tty: add support for mouse_support:0 (disabled), mouse_support:1 + (fully-functional including disabling QuickEdit on Windows console + because QuickEdit intercepts the mouse clicks so NetHack never sees + them), or mouse_support:2 (NetHack support on but QuickEdit left as is) windows: Added ntassert() mechanism for Windows based port use windows: heed OPTIONS=symset:default in config file if it is present -windows: add curses window port +windows: add curses window port which can co-exist with tty in exe and be + selectable in user config file via OPTIONS=windowtype:curses tty: significant optimizations for performance and per field rendering tty: use WC2_FLUSH_STATUS to buffer changes until BL_FLUSH is received tty: support BL_RESET in status_update to force an update to all status fields From 234bf7b1b6b55d6d4682678d8afdc38e69d349e8 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 28 Nov 2018 17:43:53 -0800 Subject: [PATCH 02/14] fix #H7618 - gas cloud affects underwater monsters Stinking cloud placed near water or poison gas breathed across it would affect and potentially kill underwater monsters. Most swimmers are on the surface and should be affected, but eels and other fish shouldn't be. This also changes minliquid() to not treat flying and levitating as ways to survive water when on the Plane of Water. I think goodpos() needs to be taught about that Plane (where many ways of existing at a water location don't apply). This doesn't do that. --- doc/fixes36.2 | 1 + src/mon.c | 13 +++++++++---- src/region.c | 15 +++++++++++++-- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index aec56b39d..134a4e456 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -225,6 +225,7 @@ scattering of objects might leave source location with wrong thing displayed for configurations with 'long int' larger than 'int', lev_comp wrote some garbage into the *.lev files, but nethack seemed unaffected by that (at least on little-endian hardare) and loaded the levels successfully +stinking cloud placed near water could kill underwater creatures Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/mon.c b/src/mon.c index 126f64f7b..a22db1a1a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mon.c $NHDT-Date: 1543100460 2018/11/24 23:01:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.271 $ */ +/* NetHack 3.6 mon.c $NHDT-Date: 1543455827 2018/11/29 01:43:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.272 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -483,13 +483,18 @@ register struct monst *mtmp; /* [what about ceiling clingers?] */ inpool = (is_pool(mtmp->mx, mtmp->my) - && !(is_flyer(mtmp->data) || is_floater(mtmp->data))); + && (!(is_flyer(mtmp->data) || is_floater(mtmp->data)) + /* there's no "above the surface" on the plane of water */ + || Is_waterlevel(&u.uz))); inlava = (is_lava(mtmp->mx, mtmp->my) && !(is_flyer(mtmp->data) || is_floater(mtmp->data))); infountain = IS_FOUNTAIN(levl[mtmp->mx][mtmp->my].typ); - /* Flying and levitation keeps our steed out of the liquid */ - /* (but not water-walking or swimming) */ + /* Flying and levitation keeps our steed out of the liquid + (but not water-walking or swimming; note: if hero is in a + water location on the Plane of Water, flight and levitating + are blocked so this (Flying || Levitation) test fails there + and steed will be subject to water effects, as intended) */ if (mtmp == u.usteed && (Flying || Levitation)) return 0; diff --git a/src/region.c b/src/region.c index 526eae801..ad94426fa 100644 --- a/src/region.c +++ b/src/region.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 region.c $NHDT-Date: 1542765361 2018/11/21 01:56:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.42 $ */ +/* NetHack 3.6 region.c $NHDT-Date: 1543455828 2018/11/29 01:43:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.43 $ */ /* Copyright (c) 1996 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -947,10 +947,16 @@ genericptr_t p2; struct monst *mtmp; int dam; + /* + * Gas clouds can't be targetted at water locations, but they can + * start next to water and spread over it. + */ + reg = (NhRegion *) p1; dam = reg->arg.a_int; if (p2 == (genericptr_t) 0) { /* This means *YOU* Bozo! */ - if (u.uinvulnerable || nonliving(youmonst.data) || Breathless) + if (u.uinvulnerable || nonliving(youmonst.data) || Breathless + || Underwater) return FALSE; if (!Blind) { Your("%s sting.", makeplural(body_part(EYE))); @@ -973,6 +979,11 @@ genericptr_t p2; adult green dragon is not affected by gas cloud, baby one is */ if (!(nonliving(mtmp->data) || is_vampshifter(mtmp)) && !breathless(mtmp->data) + /* not is_swimmer(); assume that non-fish are swimming on + the surface and breathing the air above it periodically + unless located at water spot on plane of water */ + && !((mtmp->data->mlet == S_EEL || Is_waterlevel(&u.uz)) + && is_pool(mtmp->mx, mtmp->my)) /* exclude monsters with poison gas breath attack: adult green dragon and Chromatic Dragon (and iron golem, but nonliving() and breathless() tests also catch that) */ From 3db1e42dc82eb32be523fb6aec7aa5f8aa5cbd91 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 28 Nov 2018 21:46:52 -0500 Subject: [PATCH 03/14] dungeoneers update - Karl Garrison --- dat/history | 82 +++++++++++++++++++++++------------------------ doc/Guidebook.mn | 81 +++++++++++++++++++++++----------------------- doc/Guidebook.tex | 81 +++++++++++++++++++++++----------------------- 3 files changed, 123 insertions(+), 121 deletions(-) diff --git a/dat/history b/dat/history index dd6c0304d..02516a4d6 100644 --- a/dat/history +++ b/dat/history @@ -229,44 +229,44 @@ particularly intriguing modification to help out with the game. The gods of the dungeon sometimes make note of the names of the worst of these miscreants in this, the list of Dungeoneers: - Adam Aronow J. Ali Harlow Mikko Juola - Alex Kompel Janet Walz Nathan Eady - Alex Smith Janne Salmijarvi Norm Meluch - Andreas Dorn Jean-Christophe Collet Olaf Seibert - Andy Church Jeff Bailey Pasi Kallinen - Andy Swanson Jochen Erwied Pat Rankin - Ari Huttunen John Kallen Patric Mueller - Barton House John Rupley Paul Winner - Benson I. Margulies John S. Bien Pierre Martineau - Bill Dyer Johnny Lee Ralf Brown - Boudewijn Waijers Jon W{tte Ray Chason - Bruce Cox Jonathan Handler Richard Addison - Bruce Holloway Joshua Delahunty Richard Beigel - Bruce Mewborne Keizo Yamamoto Richard P. Hughey - Carl Schelin Ken Arnold Rob Menke - Chris Russo Ken Arromdee Robin Bandy - David Cohrs Ken Lorber Robin Johnson - David Damerell Ken Washikita Roderick Schertler - David Gentzel Kevin Darcy Roland McGrath - David Hairston Kevin Hugo Ron Van Iwaarden - Dean Luick Kevin Sitze Ronnen Miller - Del Lamb Kevin Smolkowski Ross Brown - Derek S. Ray Kevin Sweet Sascha Wostmann - Deron Meranda Lars Huttar Scott Bigham - Dion Nicolaas Leon Arnott Scott R. Turner - Dylan O'Donnell M. Drew Streib Sean Hunt - Eric Backus Malcolm Ryan Stephen Spackman - Eric Hendrickson Mark Gooderum Stefan Thielscher - Eric R. Smith Mark Modrall Stephen White - Eric S. Raymond Marvin Bressler Steve Creps - Erik Andersen Matthew Day Steve Linhart - Frederick Roeber Merlyn LeRoy Steve VanDevender - Gil Neiger Michael Allison Teemu Suikki - Greg Laskin Michael Feir Tim Lennan - Greg Olson Michael Hamel Timo Hakulinen - Gregg Wonderly Michael Sokolov Tom Almy - Hao-yang Wang Mike Engber Tom West - Helge Hafting Mike Gallop Warren Cheung - Irina Rempt-Drijfhout Mike Passaretti Warwick Allison - Izchak Miller Mike Stephenson Yitzhak Sapir - + Adam Aronow Janet Walz Nathan Eady + Alex Kompel Janne Salmijarvi Norm Meluch + Alex Smith Jean-Christophe Collet Olaf Seibert + Andreas Dorn Jeff Bailey Pasi Kallinen + Andy Church Jochen Erwied Pat Rankin + Andy Swanson John Kallen Patric Mueller + Ari Huttunen John Rupley Paul Winner + Barton House John S. Bien Pierre Martineau + Benson I. Margulies Johnny Lee Ralf Brown + Bill Dyer Jon W{tte Ray Chason + Boudewijn Waijers Jonathan Handler Richard Addison + Bruce Cox Joshua Delahunty Richard Beigel + Bruce Holloway Karl Garrison Richard P. Hughey + Bruce Mewborne Keizo Yamamoto Rob Menke + Carl Schelin Ken Arnold Robin Bandy + Chris Russo Ken Arromdee Robin Johnson + David Cohrs Ken Lorber Roderick Schertler + David Damerell Ken Washikita Roland McGrath + David Gentzel Kevin Darcy Ron Van Iwaarden + David Hairston Kevin Hugo Ronnen Miller + Dean Luick Kevin Sitze Ross Brown + Del Lamb Kevin Smolkowski Sascha Wostmann + Derek S. Ray Kevin Sweet Scott Bigham + Deron Meranda Lars Huttar Scott R. Turner + Dion Nicolaas Leon Arnott Sean Hunt + Dylan O'Donnell M. Drew Streib Stephen Spackman + Eric Backus Malcolm Ryan Stefan Thielscher + Eric Hendrickson Mark Gooderum Stephen White + Eric R. Smith Mark Modrall Steve Creps + Eric S. Raymond Marvin Bressler Steve Linhart + Erik Andersen Matthew Day Steve VanDevender + Frederick Roeber Merlyn LeRoy Teemu Suikki + Gil Neiger Michael Allison Tim Lennan + Greg Laskin Michael Feir Timo Hakulinen + Greg Olson Michael Hamel Tom Almy + Gregg Wonderly Michael Sokolov Tom West + Hao-yang Wang Mike Engber Warren Cheung + Helge Hafting Mike Gallop Warwick Allison + Irina Rempt-Drijfhout Mike Passaretti Yitzhak Sapir + Izchak Miller Mike Stephenson + J. Ali Harlow Mikko Juola diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 48a30298b..da7071f39 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -4950,46 +4950,47 @@ in this, the list of Dungeoneers: center; c c c. .\"TABLE_START -Adam Aronow J. Ali Harlow Mikko Juola -Alex Kompel Janet Walz Nathan Eady -Alex Smith Janne Salmijarvi Norm Meluch -Andreas Dorn Jean-Christophe Collet Olaf Seibert -Andy Church Jeff Bailey Pasi Kallinen -Andy Swanson Jochen Erwied Pat Rankin -Ari Huttunen John Kallen Patric Mueller -Barton House John Rupley Paul Winner -Benson I. Margulies John S. Bien Pierre Martineau -Bill Dyer Johnny Lee Ralf Brown -Boudewijn Waijers Jon W{tte Ray Chason -Bruce Cox Jonathan Handler Richard Addison -Bruce Holloway Joshua Delahunty Richard Beigel -Bruce Mewborne Keizo Yamamoto Richard P. Hughey -Carl Schelin Ken Arnold Rob Menke -Chris Russo Ken Arromdee Robin Bandy -David Cohrs Ken Lorber Robin Johnson -David Damerell Ken Washikita Roderick Schertler -David Gentzel Kevin Darcy Roland McGrath -David Hairston Kevin Hugo Ron Van Iwaarden -Dean Luick Kevin Sitze Ronnen Miller -Del Lamb Kevin Smolkowski Ross Brown -Derek S. Ray Kevin Sweet Sascha Wostmann -Deron Meranda Lars Huttar Scott Bigham -Dion Nicolaas Leon Arnott Scott R. Turner -Dylan O'Donnell M. Drew Streib Sean Hunt -Eric Backus Malcolm Ryan Stephen Spackman -Eric Hendrickson Mark Gooderum Stefan Thielscher -Eric R. Smith Mark Modrall Stephen White -Eric S. Raymond Marvin Bressler Steve Creps -Erik Andersen Matthew Day Steve Linhart -Frederick Roeber Merlyn LeRoy Steve VanDevender -Gil Neiger Michael Allison Teemu Suikki -Greg Laskin Michael Feir Tim Lennan -Greg Olson Michael Hamel Timo Hakulinen -Gregg Wonderly Michael Sokolov Tom Almy -Hao-yang Wang Mike Engber Tom West -Helge Hafting Mike Gallop Warren Cheung -Irina Rempt-Drijfhout Mike Passaretti Warwick Allison -Izchak Miller Mike Stephenson Yitzhak Sapir +Adam Aronow Janet Walz Nathan Eady +Alex Kompel Janne Salmijarvi Norm Meluch +Alex Smith Jean-Christophe Collet Olaf Seibert +Andreas Dorn Jeff Bailey Pasi Kallinen +Andy Church Jochen Erwied Pat Rankin +Andy Swanson John Kallen Patric Mueller +Ari Huttunen John Rupley Paul Winner +Barton House John S. Bien Pierre Martineau +Benson I. Margulies Johnny Lee Ralf Brown +Bill Dyer Jon W{tte Ray Chason +Boudewijn Waijers Jonathan Handler Richard Addison +Bruce Cox Joshua Delahunty Richard Beigel +Bruce Holloway Karl Garrison Richard P. Hughey +Bruce Mewborne Keizo Yamamoto Rob Menke +Carl Schelin Ken Arnold Robin Bandy +Chris Russo Ken Arromdee Robin Johnson +David Cohrs Ken Lorber Roderick Schertler +David Damerell Ken Washikita Roland McGrath +David Gentzel Kevin Darcy Ron Van Iwaarden +David Hairston Kevin Hugo Ronnen Miller +Dean Luick Kevin Sitze Ross Brown +Del Lamb Kevin Smolkowski Sascha Wostmann +Derek S. Ray Kevin Sweet Scott Bigham +Deron Meranda Lars Huttar Scott R. Turner +Dion Nicolaas Leon Arnott Sean Hunt +Dylan O'Donnell M. Drew Streib Stephen Spackman +Eric Backus Malcolm Ryan Stefan Thielscher +Eric Hendrickson Mark Gooderum Stephen White +Eric R. Smith Mark Modrall Steve Creps +Eric S. Raymond Marvin Bressler Steve Linhart +Erik Andersen Matthew Day Steve VanDevender +Frederick Roeber Merlyn LeRoy Teemu Suikki +Gil Neiger Michael Allison Tim Lennan +Greg Laskin Michael Feir Timo Hakulinen +Greg Olson Michael Hamel Tom Almy +Gregg Wonderly Michael Sokolov Tom West +Hao-yang Wang Mike Engber Warren Cheung +Helge Hafting Mike Gallop Warwick Allison +Irina Rempt-Drijfhout Mike Passaretti Yitzhak Sapir +Izchak Miller Mike Stephenson +J. Ali Harlow Mikko Juola .\"TABLE_END Do not delete this line. .TE .pg diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 18c366a27..bfda263af 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -5523,46 +5523,47 @@ in this, the list of Dungeoneers: \begin{center} \begin{tabular}{llll} %TABLE_START -Adam Aronow & J. Ali Harlow & Mikko Juola\\ -Alex Kompel & Janet Walz & Nathan Eady\\ -Alex Smith & Janne Salmij\"{a}rvi & Norm Meluch\\ -Andreas Dorn & Jean-Christophe Collet & Olaf Seibert\\ -Andy Church & Jeff Bailey & Pasi Kallinen\\ -Andy Swanson & Jochen Erwied & Pat Rankin\\ -Ari Huttunen & John Kallen & Patric Mueller\\ -Barton House & John Rupley & Paul Winner\\ -Benson I. Margulies & John S. Bien & Pierre Martineau\\ -Bill Dyer & Johnny Lee & Ralf Brown\\ -Boudewijn Waijers & Jon W\{tte & Ray Chason\\ -Bruce Cox & Jonathan Handler & Richard Addison\\ -Bruce Holloway & Joshua Delahunty & Richard Beigel\\ -Bruce Mewborne & Keizo Yamamoto & Richard P. Hughey\\ -Carl Schelin & Ken Arnold & Rob Menke\\ -Chris Russo & Ken Arromdee & Robin Bandy\\ -David Cohrs & Ken Lorber & Robin Johnson\\ -David Damerell & Ken Washikita & Roderick Schertler\\ -David Gentzel & Kevin Darcy & Roland McGrath\\ -David Hairston & Kevin Hugo & Ron Van Iwaarden\\ -Dean Luick & Kevin Sitze & Ronnen Miller\\ -Del Lamb & Kevin Smolkowski & Ross Brown\\ -Derek S. Ray & Kevin Sweet & Sascha Wostmann\\ -Deron Meranda & Lars Huttar & Scott Bigham\\ -Dion Nicolaas & Leon Arnott & Scott R. Turner\\ -Dylan O'Donnell & M. Drew Streib & Sean Hunt\\ -Eric Backus & Malcolm Ryan & Stephen Spackman\\ -Eric Hendrickson & Mark Gooderum & Stefan Thielscher\\ -Eric R. Smith & Mark Modrall & Stephen White\\ -Eric S. Raymond & Marvin Bressler & Steve Creps\\ -Erik Andersen & Matthew Day & Steve Linhart\\ -Frederick Roeber & Merlyn LeRoy & Steve VanDevender\\ -Gil Neiger & Michael Allison & Teemu Suikki\\ -Greg Laskin & Michael Feir & Tim Lennan\\ -Greg Olson & Michael Hamel & Timo Hakulinen\\ -Gregg Wonderly & Michael Sokolov & Tom Almy\\ -Hao-yang Wang & Mike Engber & Tom West\\ -Helge Hafting & Mike Gallop & Warren Cheung\\ -Irina Rempt-Drijfhout & Mike Passaretti & Warwick Allison\\ -Izchak Miller & Mike Stephenson & Yitzhak Sapir +Adam Aronow & Janet Walz & Nathan Eady\\ +Alex Kompel & Janne Salmij\"{a}rvi & Norm Meluch\\ +Alex Smith & Jean-Christophe Collet & Olaf Seibert\\ +Andreas Dorn & Jeff Bailey & Pasi Kallinen\\ +Andy Church & Jochen Erwied & Pat Rankin\\ +Andy Swanson & John Kallen & Patric Mueller\\ +Ari Huttunen & John Rupley & Paul Winner\\ +Barton House & John S. Bien & Pierre Martineau\\ +Benson I. Margulies & Johnny Lee & Ralf Brown\\ +Bill Dyer & Jon W\{tte & Ray Chason\\ +Boudewijn Waijers & Jonathan Handler & Richard Addison\\ +Bruce Cox & Joshua Delahunty & Richard Beigel\\ +Bruce Holloway & Karl Garrison & Richard P. Hughey\\ +Bruce Mewborne & Keizo Yamamoto & Rob Menke\\ +Carl Schelin & Ken Arnold & Robin Bandy\\ +Chris Russo & Ken Arromdee & Robin Johnson\\ +David Cohrs & Ken Lorber & Roderick Schertler\\ +David Damerell & Ken Washikita & Roland McGrath\\ +David Gentzel & Kevin Darcy & Ron Van Iwaarden\\ +David Hairston & Kevin Hugo & Ronnen Miller\\ +Dean Luick & Kevin Sitze & Ross Brown\\ +Del Lamb & Kevin Smolkowski & Sascha Wostmann\\ +Derek S. Ray & Kevin Sweet & Scott Bigham\\ +Deron Meranda & Lars Huttar & Scott R. Turner\\ +Dion Nicolaas & Leon Arnott & Sean Hunt\\ +Dylan O'Donnell & M. Drew Streib & Stephen Spackman\\ +Eric Backus & Malcolm Ryan & Stefan Thielscher\\ +Eric Hendrickson & Mark Gooderum & Stephen White\\ +Eric R. Smith & Mark Modrall & Steve Creps\\ +Eric S. Raymond & Marvin Bressler & Steve Linhart\\ +Erik Andersen & Matthew Day & Steve VanDevender\\ +Frederick Roeber & Merlyn LeRoy & Teemu Suikki\\ +Gil Neiger & Michael Allison & Tim Lennan\\ +Greg Laskin & Michael Feir & Timo Hakulinen\\ +Greg Olson & Michael Hamel & Tom Almy\\ +Gregg Wonderly & Michael Sokolov & Tom West\\ +Hao-yang Wang & Mike Engber & Warren Cheung\\ +Helge Hafting & Mike Gallop & Warwick Allison\\ +Irina Rempt-Drijfhout & Mike Passaretti & Yitzhak Sapir\\ +Izchak Miller & Mike Stephenson\\ +J. Ali Harlow & Mikko Juola %TABLE_END Do not delete this line. \end{tabular} \end{center} From 3634d165828807bb672e2070eec7073bacc58532 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 28 Nov 2018 23:29:28 -0500 Subject: [PATCH 04/14] fix nethackw start without arguments The Windows graphical version in NetHackW.exe is meant to lock itself to its own windowtype and ignore the OPTIONS=windowtype setting in the config file, but the code to perform the lock only did so if (argc > 1). --- sys/share/pcmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 93674ab34..1c07555cc 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 pcmain.c $NHDT-Date: 1524413707 2018/04/22 16:15:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.74 $ */ +/* NetHack 3.6 pcmain.c $NHDT-Date: 1543465755 2018/11/29 04:29:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.101 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -177,7 +177,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ choose_windows(DEFAULT_WINDOW_SYS); #else choose_windows(default_window_sys); - if (argc > 1 + if (argc >= 1 && !strcmpi(default_window_sys, "mswin") && strstri(argv[0], "nethackw.exe")) iflags.windowtype_locked = TRUE; From 22af9a3bbf259767a7d308136ede34c307d8d4a0 Mon Sep 17 00:00:00 2001 From: Bart House Date: Wed, 28 Nov 2018 21:06:39 -0800 Subject: [PATCH 05/14] Adding manifest to NetHackW.exe in nmake build. --- sys/winnt/Makefile.msc | 2 ++ win/win32/{vs2017 => }/NetHackW.exe.manifest | 0 win/win32/vs2017/NetHackW.vcxproj | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) rename win/win32/{vs2017 => }/NetHackW.exe.manifest (100%) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 8a980999e..5958a933f 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -834,6 +834,8 @@ $(GAMEDIR)\NetHackW.exe : $(O)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 $(O)install.tag del $(O)install.tag $(O)gamedir.tag: diff --git a/win/win32/vs2017/NetHackW.exe.manifest b/win/win32/NetHackW.exe.manifest similarity index 100% rename from win/win32/vs2017/NetHackW.exe.manifest rename to win/win32/NetHackW.exe.manifest diff --git a/win/win32/vs2017/NetHackW.vcxproj b/win/win32/vs2017/NetHackW.vcxproj index e563bb072..e8e104558 100644 --- a/win/win32/vs2017/NetHackW.vcxproj +++ b/win/win32/vs2017/NetHackW.vcxproj @@ -31,7 +31,7 @@ comctl32.lib;winmm.lib;%(AdditionalDependencies) - NethackW.exe.manifest;%(AdditionalManifestFiles) + $(WinWin32Dir)NethackW.exe.manifest;%(AdditionalManifestFiles) @@ -184,4 +184,4 @@ - \ No newline at end of file + From c52fc366a09a27d9bfff57d7d143b339a9e9b362 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 29 Nov 2018 00:15:34 -0500 Subject: [PATCH 06/14] not everyone has PDCurses so re-comment it in the official sources --- sys/winnt/Makefile.msc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 5958a933f..f42c431cd 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -74,8 +74,8 @@ DEBUGINFO = Y # of your PDCurses C files which must already be resident on # your machine. # -ADD_CURSES=Y -PDCURSES_TOP=..\..\pdcurses +#ADD_CURSES=Y +#PDCURSES_TOP=..\..\pdcurses # #============================================================================== # This marks the end of the BUILD DECISIONS section. From 99891455d369f458e827cfc98eb25c35cdf253ac Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 29 Nov 2018 00:24:35 -0500 Subject: [PATCH 07/14] earlier Guidebook change neglected to update the date --- doc/Guidebook.mn | 2 +- doc/Guidebook.tex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index da7071f39..e696ec13f 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -24,7 +24,7 @@ .ds vr "NetHack 3.6 .ds f0 "\*(vr .ds f1 -.ds f2 "November 27, 2018 +.ds f2 "November 29, 2018 . .\" A note on some special characters: .\" \(lq = left double quote diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index bfda263af..daeefcf7c 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -45,7 +45,7 @@ %.au \author{Original version - Eric S. Raymond\\ (Edited and expanded for 3.6 by Mike Stephenson and others)} -\date{November 27, 2018} +\date{November 29, 2018} \maketitle From c318841363ea5c31a3108c2a85e2dd8bdc150dc3 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 29 Nov 2018 03:49:16 -0800 Subject: [PATCH 08/14] fix #H7631 - wielding cursed weptool via 'apply' Applying a non-wielded cursed pick-axe first wielded it, then dug, but it didn't report "pick-axe is welded to your hand". (Attempting to drop it or wield something else did report that, after the fact.) The same thing happened if you used a pole-arm rather than pick-axe. --- doc/fixes36.2 | 2 ++ src/wield.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 134a4e456..7ecb9d247 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -226,6 +226,8 @@ for configurations with 'long int' larger than 'int', lev_comp wrote some garbage into the *.lev files, but nethack seemed unaffected by that (at least on little-endian hardare) and loaded the levels successfully stinking cloud placed near water could kill underwater creatures +applying--rather than wielding--a cursed polearm or weapon-tool didn't report + that it had become welded to hero's hand(s) Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/wield.c b/src/wield.c index 1063e125b..701e2edcf 100644 --- a/src/wield.c +++ b/src/wield.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wield.c $NHDT-Date: 1525012623 2018/04/29 14:37:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.56 $ */ +/* NetHack 3.6 wield.c $NHDT-Date: 1543492132 2018/11/29 11:48:52 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.58 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2009. */ /* NetHack may be freely redistributed. See license for details. */ @@ -575,8 +575,13 @@ const char *verb; /* "rub",&c */ } else { struct obj *oldwep = uwep; - You("now wield %s.", doname(obj)); - setuwep(obj); + if (will_weld(obj)) { + /* hope none of ready_weapon()'s early returns apply here... */ + (void) ready_weapon(obj); + } else { + You("now wield %s.", doname(obj)); + setuwep(obj); + } if (flags.pushweapon && oldwep && uwep != oldwep) setuswapwep(oldwep); } From 4ab1c12f030ef1f2f767152cde649e3ee4f3bbf8 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 29 Nov 2018 10:24:50 -0800 Subject: [PATCH 09/14] fix github issue #164 - lack of steed-in-pit mesg Fixes #164 No message was shown when riding a steed into a pit or spiked pit. Setup for the message was done, but post-3.4.3 insertion of else-if into the previous if/else/endif cut off its delivery. --- doc/fixes36.2 | 1 + src/trap.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 7ecb9d247..3acebaa54 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -228,6 +228,7 @@ for configurations with 'long int' larger than 'int', lev_comp wrote some stinking cloud placed near water could kill underwater creatures applying--rather than wielding--a cursed polearm or weapon-tool didn't report that it had become welded to hero's hand(s) +the message when riding a steed into a pit was composed but not shown Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/trap.c b/src/trap.c index d43117e43..d8d4018e7 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 trap.c $NHDT-Date: 1543100476 2018/11/24 23:01:16 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.311 $ */ +/* NetHack 3.6 trap.c $NHDT-Date: 1543515862 2018/11/29 18:24:22 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.312 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1185,6 +1185,7 @@ unsigned trflags; if (!Sokoban) { char verbbuf[BUFSZ]; + *verbbuf = '\0'; if (u.usteed) { if ((trflags & RECURSIVETRAP) != 0) Sprintf(verbbuf, "and %s fall", @@ -1202,8 +1203,9 @@ unsigned trflags; } else { Strcpy(verbbuf, !plunged ? "fall" : (Flying ? "dive" : "plunge")); - You("%s into %s pit!", verbbuf, a_your[trap->madeby_u]); } + if (*verbbuf) + You("%s into %s pit!", verbbuf, a_your[trap->madeby_u]); } /* wumpus reference */ if (Role_if(PM_RANGER) && !trap->madeby_u && !trap->once From be327d9822a17823a86553bb33d414ba56522fd4 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 29 Nov 2018 12:15:14 -0800 Subject: [PATCH 10/14] steed vs "no monster to remove" Noticed whlie testing the steed-in-pit fix. The EXTRA_SANITY_CHECKS for remove_monster() are being tripped if riding hero has steed killed out from under him because the steed is not on the map. This started out simple but got a bit complicated. It seems to be sufficient but I'm not very confident about it. Being engulfed while mounted gave "placing monster over another?" due to a change made along with EXTRA_SANITY_CHECKS but not conditional on it. (The change was to issue a warning about an actual problem which was previously undiagnosed.) I think bumping the engulfer off the map in favor of the former steed only worked because some u.uswallow code eventually used the hero's location to put the engulfer back. I didn't pursue that to try to figure what really happened, just prevent it. The DISMOUNT_BONES handling was being executed even if the steed was dead. DISMOUNT_BONES only happens if the hero is dead. Since I don't know whether it's possible for dead hero and dead steed to happen at the same time, move it inside the steed-not-dead block just in case. --- doc/fixes36.2 | 2 ++ src/steed.c | 51 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 3acebaa54..6d64fb8fd 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -246,6 +246,8 @@ ensure tmp_at() structures are initialized for all code paths when swallowed trapped-vs-levitation/flying change broke Sting releasing hero from web life-saving while poly'd and Unchanging wasn't restoring u.mh (HP as monster) change in searching stopped finding unseen monsters except hiders and eels +buliding with EXTRA_SANITY_CHECKS enabled would issue "no monster to remove" + warning if steed was killed out from under the hero tty: turn off an optimization that is the suspected cause of Windows reported partial status lines following level changes tty: ensure that current status fields are always copied to prior status diff --git a/src/steed.c b/src/steed.c index bf675cca9..91ed935f4 100644 --- a/src/steed.c +++ b/src/steed.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 steed.c $NHDT-Date: 1542765364 2018/11/21 01:56:04 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.57 $ */ +/* NetHack 3.6 steed.c $NHDT-Date: 1543522486 2018/11/29 20:14:46 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.58 $ */ /* Copyright (c) Kevin Hugo, 1998-1999. */ /* NetHack may be freely redistributed. See license for details. */ @@ -481,7 +481,7 @@ int reason; /* Player was thrown off etc. */ { struct monst *mtmp; struct obj *otmp; - coord cc; + coord cc, steedcc; const char *verb = "fall"; boolean repair_leg_damage = (Wounded_legs != 0L); unsigned save_utrap = u.utrap; @@ -548,19 +548,44 @@ int reason; /* Player was thrown off etc. */ /* Release the steed and saddle */ u.usteed = 0; u.ugallop = 0L; - - /* Set player and steed's position. Try moving the player first - unless we're in the midst of creating a bones file. */ - if (reason == DISMOUNT_BONES) { - /* move the steed to an adjacent square */ - if (enexto(&cc, u.ux, u.uy, mtmp->data)) - rloc_to(mtmp, cc.x, cc.y); - else /* evidently no room nearby; move steed elsewhere */ - (void) rloc(mtmp, FALSE); - return; + /* + * rloc(), rloc_to(), and monkilled()->mondead()->m_detach() all + * expect mtmp to be on the map or else have mtmp->mx be 0, but + * setting the latter to 0 here would interfere with dropping + * the saddle. Prior to 3.6.2, being off the map didn't matter. + * + * place_monster() expects mtmp to be alive and not be u.usteed. + * + * Unfortunately, (former steed's implicit location) + * might now be occupied by an engulfer, so we can't just put mtmp + * at that spot. An engulfer's previous spot will be unoccupied + * but we don't know where that was and even if we did, it might + * be hostile terrain. + */ + steedcc.x = u.ux, steedcc.y = u.uy; + if (m_at(u.ux, u.uy)) + (void) enexto(&steedcc, u.ux, u.uy, mtmp->data); + if (!m_at(steedcc.x, steedcc.y)) { + if (mtmp->mhp < 1) + mtmp->mhp = 0; /* make sure it isn't negative */ + mtmp->mhp++; /* force at least one hit point, possibly resurrecting */ + place_monster(mtmp, steedcc.x, steedcc.y); + mtmp->mhp--; /* take the extra hit point away: cancel resurrection */ + } else { + impossible("Dismounting: can't place former steed on map."); } + if (!DEADMONSTER(mtmp)) { - place_monster(mtmp, u.ux, u.uy); + /* Set player and steed's position. Try moving the player first + unless we're in the midst of creating a bones file. */ + if (reason == DISMOUNT_BONES) { + /* move the steed to an adjacent square */ + if (enexto(&cc, u.ux, u.uy, mtmp->data)) + rloc_to(mtmp, cc.x, cc.y); + else /* evidently no room nearby; move steed elsewhere */ + (void) rloc(mtmp, FALSE); + return; + } if (!u.uswallow && !u.ustuck && have_spot) { struct permonst *mdat = mtmp->data; From f2da47a347103b32086a8acb0ce63e7d463cd9bd Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 29 Nov 2018 16:27:02 -0500 Subject: [PATCH 11/14] Windows Makefile updates (first batch) --- sys/winnt/Makefile.gcc | 384 ++++++++++++++++++++--------------------- sys/winnt/Makefile.msc | 253 +++++++++++++-------------- 2 files changed, 308 insertions(+), 329 deletions(-) diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index 1cc6dea87..76b140fd6 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -139,17 +139,29 @@ TARGET_CPU=x86 # 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 -MSWSYS = ../sys/winnt # mswin specific files -TTY = ../win/tty # window port files (tty) -MSWIN = ../win/win32 # window port files (win32) -WCURSES = ../win/curses # window port files (curses) -WSHR = ../win/share # Tile support files +# INCL - NetHack include files +# DAT - NetHack data files +# DOC - NetHack documentation files +# UTIL - Utility source +# SRC - Main source +# SSYS - Shared system files +# MSWSYS - mswin specific files +# TTY - window port files (tty) +# MSWIN - window port files (win32) +# WCURSES - window port files (curses) +# WSHR - Tile support files + +INCL =../include +DAT =../dat +DOC =../doc +UTIL =../util +SRC =../src +SSYS =../sys/share +MSWSYS =../sys/winnt +TTY =../win/tty +MSWIN =../win/win32 +WCURSES =../win/curses +WSHR =../win/share # # Object directory. @@ -157,14 +169,6 @@ WSHR = ../win/share # Tile support files OBJ = o -cc = gcc -cxx = g++ -rc = windres -link = gcc -ifeq "$(WANT_WIN_QT4)" "Y" - link = g++ -endif - # # Optional high-quality BSD random number generation routines # (see pcconf.h). Set to nothing if not used. @@ -198,82 +202,6 @@ endif #ZLIB = zlib.lib -#========================================== -#========================================== -# Setting up the compiler and linker -# macros. All builds include the base ones. -#========================================== -#========================================== - -cflags = -mms-bitfields -lflags = -ifeq "$(DEBUGINFO)" "Y" -cdebug = -g -linkdebug = -g -else -cdebug = -linkdebug = -endif - -CFLAGSBASE = -c $(cflags) -I$(INCL) $(WINPINC) $(cdebug) -#LFLAGSBASEC = $(linkdebug) -#LFLAGSBASEG = $(linkdebug) -mwindows - -conlibs = -lgdi32 -lwinmm -guilibs = -lcomctl32 -lwinmm -ifeq "$(WANT_WIN_QT4)" "Y" - # Might be either Qt 4 or Qt 5 - ifeq "$(HAVE_QT5)" "Y" - guilibs += $(QT4_DIRECTORY)/lib/libQt5Core.a - guilibs += $(QT4_DIRECTORY)/lib/libQt5Gui.a - guilibs += $(QT4_DIRECTORY)/lib/libQt5Widgets.a - conlibs += $(QT4_DIRECTORY)/lib/libQt5Core.a - else - guilibs += $(QT4_DIRECTORY)/lib/libQtCore4.a - guilibs += $(QT4_DIRECTORY)/lib/libQtGui4.a - conlibs += $(QT4_DIRECTORY)/lib/libQtCore4.a - endif -endif - -#========================================== -# Extra files needed for some ports -#========================================== -EXTRA_FILES = -ifeq "$(WANT_WIN_QT4)" "Y" - ifeq "$(HAVE_QT5)" "Y" - EXTRA_FILES += $(GAMEDIR)/Qt5Core.dll - EXTRA_FILES += $(GAMEDIR)/Qt5Gui.dll - EXTRA_FILES += $(GAMEDIR)/Qt5Widgets.dll - else - # TODO: define QT 4 DLLs here - EXTRA_FILES += $(GAMEDIR)/QtCore4.dll - EXTRA_FILES += $(GAMEDIR)/QtGui4.dll - endif - EXTRA_FILES += $(GAMEDIR)/rip.xpm -endif - -#========================================== -# Util builds -#========================================== - -CFLAGSU = $(CFLAGSBASE) $(WINPFLAG) $(DLBFLG) -LFLAGSU = $(LFLAGSBASEC) - -#========================================== -# - Game build -#========================================== - -CFLAGS = $(CFLAGSBASE) $(WINPFLAG) $(DLBFLG) -lflags = $(LFLAGSBASEC) $(linkdebuf) - -CXXFLAGS = $(CFLAGS) - -ifeq "$(USE_DLB)" "Y" -DLB = nhdat -else -DLB = -endif - #========================================== #================ MACROS ================== #========================================== @@ -359,7 +287,7 @@ 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 +#VOBJ28 = $(O)win10.o DLBOBJ = $(O)dlb.o @@ -367,23 +295,23 @@ REGEX = $(O)cppregex.o TTYOBJ = $(O)topl.o $(O)getline.o $(O)wintty.o -!IFNDEF ADD_CURSES -CURSESOBJ= -!ELSE +ifeq "$(ADD_CURSES)" "Y" 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 +else +CURSESOBJ= +endif SOBJ = $(O)winnt.o $(O)pcsys.o $(O)pcunix.o \ $(SOUND) $(O)pcmain.o $(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) + $(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 \ @@ -457,8 +385,7 @@ PDCOBJS = $(O)pdcclip.o $(O)pdcdisp.o $(O)pdcgetsc.o $(O)pdckbd.o $(O)pdcscrn.o PDCLIB = $(O)pdcurses.a -PDCINCL = /I$(PDCURSES_TOP) /I$(PDCSRC) /I$(PDCWINCON) - +PDCINCL = -I$(PDCURSES_TOP) -I$(PDCSRC) -I$(PDCWINCON) else PDCLIB = endif @@ -501,7 +428,7 @@ TILE_H = ../win/share/tile.h DATABASE = $(DAT)/data.base #========================================== -# More compiler setup post-macros +# More compiler setup macros #========================================== # ifeq "$(ADD_CURSES)" "Y" @@ -514,9 +441,93 @@ CURSESINCL= endif ifneq "$(ADD_CURSES)" "Y" -INCLDIR= /I../include /I../sys/winnt +INCLDIR=-I../include -I../sys/winnt else -INCLDIR= /I../include /I../sys/winnt /I$(CURSESINCL) +INCLDIR=-I../include -I../sys/winnt -I$(CURSESINCL) +endif + +#========================================== +#========================================== +# Setting up the compiler and linker +# macros. All builds include the base ones. +#========================================== +#========================================== + +cc = gcc +cxx = g++ +rc = windres +link = gcc +ifeq "$(WANT_WIN_QT4)" "Y" + link = g++ +endif + +cflags = -mms-bitfields $(INCLDIR) +lflags = +ifeq "$(DEBUGINFO)" "Y" +cdebug = -g +linkdebug = -g +else +cdebug = +linkdebug = +endif + +CFLAGSBASE = -c $(cflags) $(WINPINC) $(cdebug) +#LFLAGSBASEC = $(linkdebug) +#LFLAGSBASEG = $(linkdebug) -mwindows + +conlibs = -lgdi32 -lwinmm +guilibs = -lcomctl32 -lwinmm +ifeq "$(WANT_WIN_QT4)" "Y" + # Might be either Qt 4 or Qt 5 + ifeq "$(HAVE_QT5)" "Y" + guilibs += $(QT4_DIRECTORY)/lib/libQt5Core.a + guilibs += $(QT4_DIRECTORY)/lib/libQt5Gui.a + guilibs += $(QT4_DIRECTORY)/lib/libQt5Widgets.a + conlibs += $(QT4_DIRECTORY)/lib/libQt5Core.a + else + guilibs += $(QT4_DIRECTORY)/lib/libQtCore4.a + guilibs += $(QT4_DIRECTORY)/lib/libQtGui4.a + conlibs += $(QT4_DIRECTORY)/lib/libQtCore4.a + endif +endif + +#========================================== +# Extra files needed for some ports +#========================================== +EXTRA_FILES = +ifeq "$(WANT_WIN_QT4)" "Y" + ifeq "$(HAVE_QT5)" "Y" + EXTRA_FILES += $(GAMEDIR)/Qt5Core.dll + EXTRA_FILES += $(GAMEDIR)/Qt5Gui.dll + EXTRA_FILES += $(GAMEDIR)/Qt5Widgets.dll + else + # TODO: define QT 4 DLLs here + EXTRA_FILES += $(GAMEDIR)/QtCore4.dll + EXTRA_FILES += $(GAMEDIR)/QtGui4.dll + endif + EXTRA_FILES += $(GAMEDIR)/rip.xpm +endif + +#========================================== +# Util builds +#========================================== + +CFLAGSU = $(CFLAGSBASE) $(WINPFLAG) $(DLBFLG) +LFLAGSU = $(LFLAGSBASEC) + +#========================================== +# - Game build +#========================================== + +CFLAGS = $(CFLAGSBASE) $(WINPFLAG) $(DLBFLG) +lflags = $(LFLAGSBASEC) $(linkdebuf) + +CXXFLAGS = $(CFLAGS) + +ifeq "$(USE_DLB)" "Y" +DLB = nhdat +else +DLB = endif #========================================== @@ -552,9 +563,6 @@ $(OBJ)/%.o : $(SSYS)/%.cpp $(OBJ)/%.o : $(MSWSYS)/%.c $(cc) $(CFLAGS) -o$@ $< -$(INCL)/%.h : $(MSWSYS)/%.h - @copy $< $@ - #========================================== # Rules for files in util #========================================== @@ -682,12 +690,12 @@ default : install all : install -install: graphicschk $(O)obj.tag $(GAMEDIR)/NetHack.exe $(GAMEDIR)/NetHackW.exe $(O)install.tag $(EXTRA_FILES) +install: initialchk $(GAMEDIR)/NetHack.exe $(GAMEDIR)/NetHackW.exe install.tag $(EXTRA_FILES) @echo NetHack is up to date. @echo Done. -$(O)install.tag: $(DAT)/data $(DAT)/rumors $(DAT)/dungeon \ +install.tag: $(DAT)/data $(DAT)/rumors $(DAT)/dungeon \ $(DAT)/oracles $(DAT)/quest.dat $(O)sp_lev.tag $(DLB) ifeq "$(USE_DLB)" "Y" $(subst /,\,copy nhdat $(GAMEDIR)) @@ -717,7 +725,7 @@ recover: $(U)recover.exe $(subst /,\,if exist $(U)recover.exe copy $(U)recover.exe $(GAMEDIR)) $(subst /,\,if exist $(DOC)/recover.txt copy $(DOC)/recover.txt $(GAMEDIR)/recover.txt) -$(O)sp_lev.tag: $(O)utility.tag $(DAT)/bigroom.des $(DAT)/castle.des \ +sp_lev.tag: 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 \ @@ -751,9 +759,9 @@ $(O)sp_lev.tag: $(O)utility.tag $(DAT)/bigroom.des $(DAT)/castle.des \ $(subst /,\,$(U)levcomp $(DAT)/wizard.des) $(subst /,\,copy *.lev $(DAT)) $(subst /,\,del *.lev) - $(subst /,\,echo sp_levs done > $(O)sp_lev.tag) + $(subst /,\,echo sp_levs done > sp_lev.tag) -$(O)utility.tag: $(INCL)/date.h $(INCL)/onames.h $(INCL)/pm.h \ +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) $(subst /,\,@echo utilities made >$@) @@ -774,17 +782,18 @@ $(O)conres.o: $(MSWSYS)/console.rc $(MSWSYS)/NetHack.ico #========================================== # The game targets. #========================================== -$(O)gamedir.tag: - $(subst /,\,@if not exist $(GAMEDIR)/*.* echo creating directory $(GAMEDIR)) - $(subst /,\,@if not exist $(GAMEDIR)/*.* mkdir $(GAMEDIR)) - $(subst /,\,@echo directory created > $@) -$(GAMEDIR)/NetHack.exe : $(O)gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistub.o \ +gamedir.tag: + test -d $(GAMEDIR) || echo creating directory $(GAMEDIR) + test -d $(GAMEDIR) || mkdir $(GAMEDIR) + test -d $(GAMEDIR) && echo directory created > $@ + +$(GAMEDIR)/NetHack.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistub.o \ $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)conres.o $(KEYDLLS) @echo Linking $@... $(link) $(lflags) -o$@ $(ALLOBJ) $(TTYOBJ) $(O)nttty.o $(O)tile.o \ $(O)guistub.o $(O)conres.o $(PDCLIB) $(conlibs) -static -lstdc++ - $(subst /,\,@if exist $(O)install.tag del $(O)install.tag) + $(subst /,\,@if exist install.tag del install.tag) # NetHackW # full tty linkage libs: @@ -794,17 +803,17 @@ $(GAMEDIR)/NetHack.exe : $(O)gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)gu # libs: $(LIBS) $(guilibs) $(COMCTRL) # objs: $(GAMEOBJ) $(GUIOBJ) $(O)tile.o $(O)ttystub.o -$(GAMEDIR)/NetHackW.exe : $(O)gamedir.tag $(O)tile.o $(O)ttystub.o \ +$(GAMEDIR)/NetHackW.exe : gamedir.tag $(O)tile.o $(O)ttystub.o \ $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)winres.o $(KEYDLLS) @echo Linking $@... $(link) $(lflags) -mwindows -o$@ $(ALLOBJ) $(GUIOBJ) $(O)tile.o $(O)ttystub.o \ $(O)winres.o $(PDCLIB) $(guilibs) -static -lstdc++ - $(subst /,\,@if exist $(O)install.tag del $(O)install.tag) + $(subst /,\,@if exist install.tag del install.tag) $(O)nhdefkey.o: $(cc) $(CFLAGS) -DBUILD_DLL -o$@ $(MSWSYS)/nhdefkey.c -$(GAMEDIR)/nhdefkey.dll : $(O)nhdefkey.o $(O)gamedir.tag +$(GAMEDIR)/nhdefkey.dll : $(O)nhdefkey.o gamedir.tag @echo Linking $@ $(cc) -shared -Wl,--export-all-symbols \ -Wl,--add-stdcall-alias -o $@ $< @@ -812,7 +821,7 @@ $(GAMEDIR)/nhdefkey.dll : $(O)nhdefkey.o $(O)gamedir.tag $(O)nh340key.o: $(cc) $(CFLAGS) -DBUILD_DLL -o$@ $(MSWSYS)/nh340key.c -$(GAMEDIR)/nh340key.dll : $(O)nh340key.o $(O)gamedir.tag +$(GAMEDIR)/nh340key.dll : $(O)nh340key.o gamedir.tag @echo Linking $@ $(cc) -shared -Wl,--export-all-symbols \ -Wl,--add-stdcall-alias -o $@ $< @@ -820,7 +829,7 @@ $(GAMEDIR)/nh340key.dll : $(O)nh340key.o $(O)gamedir.tag $(O)nhraykey.o: $(cc) $(CFLAGS) -DBUILD_DLL -o$@ $(MSWSYS)/nhraykey.c -$(GAMEDIR)/nhraykey.dll : $(O)nhraykey.o $(O)gamedir.tag +$(GAMEDIR)/nhraykey.dll : $(O)nhraykey.o gamedir.tag @echo Linking $@ $(cc) -shared -Wl,--export-all-symbols \ -Wl,--add-stdcall-alias -o $@ $< @@ -832,12 +841,15 @@ $(GAME)_.ico : $(MSWSYS)/$(GAME).ico # Create directory for holding object files #========================================== -graphicschk: +initialchk: objdir.tag @echo ---- @echo NOTE: This build will include tile support. @echo ---- - $(subst /,\,@echo graphicschk > graphicschk) +objdir.tag: + test -d $(OBJ) || echo creating directory $(OBJ) + test -d $(OBJ) || mkdir $(OBJ) + test -d $(OBJ) && echo directory created > $@ #========================================== #=========== SECONDARY TARGETS ============ @@ -852,7 +864,7 @@ $(U)makedefs.exe: $(MAKEOBJS) $(O)makedefs.o: $(CONFIG_H) $(INCL)/monattk.h $(INCL)/monflag.h \ $(INCL)/objclass.h $(INCL)/monsym.h $(INCL)/qtext.h \ - $(INCL)/patchlevel.h $(U)makedefs.c $(O)obj.tag + $(INCL)/patchlevel.h $(U)makedefs.c $(cc) $(CFLAGSU) -o$@ $(U)makedefs.c # @@ -875,6 +887,18 @@ $(INCL)/vis_tab.h: $(U)makedefs.exe $(SRC)/vis_tab.c: $(U)makedefs.exe $(subst /,\,$(U)makedefs -z) +$(DAT)/data: utility.tag $(DATABASE) + $(subst /,\,$(U)makedefs -d) + +$(DAT)/rumors: utility.tag $(DAT)/rumors.tru $(DAT)/rumors.fal + $(subst /,\,$(U)makedefs -r) + +$(DAT)/quest.dat: utility.tag $(DAT)/quest.txt + $(subst /,\,$(U)makedefs -q) + +$(DAT)/oracles: utility.tag $(DAT)/oracles.txt + $(subst /,\,$(U)makedefs -h) + $(DAT)/engrave: $(DAT)/engrave.txt $(U)makedefs.exe $(subst /,\,$(U)makedefs -s) @@ -884,7 +908,9 @@ $(DAT)/epitaph: $(DAT)/epitaph.txt $(U)makedefs.exe $(DAT)/bogusmon: $(DAT)/bogusmon.txt $(U)makedefs.exe $(subst /,\,$(U)makedefs -s) - +$(DAT)/dungeon: utility.tag $(DAT)/dungeon.def + $(subst /,\,$(U)makedefs -e) + $(subst /,\,$(U)dgncomp $(DAT)/dungeon.pdf) #========================================== # uudecode utility and uuencoded targets @@ -959,7 +985,6 @@ $(O)lev_$(LEX).o: $(HACK_H) $(INCL)/lev_comp.h $(SP_LEV_H) \ $(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) @@ -967,7 +992,6 @@ ifeq "$(DO_YACC)" "YACC_ACT" $(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). @@ -1068,10 +1092,6 @@ $(O)nhsizes2.o: $(CONFIG_H) nhsizes2.c # Create directory for holding object files #========================================== -$(O)obj.tag: - $(subst /,\,@if not exist $(OBJ)/*.* echo creating directory $(OBJ)) - $(subst /,\,@if not exist $(OBJ)/*.* mkdir $(OBJ)) - $(subst /,\,@echo directory created > $@) #========================================== # DLB utility and nhdat file creation @@ -1093,7 +1113,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 $(O)sp_lev.tag + $(DAT)/porthelp $(DAT)/license $(DAT)/engrave $(DAT)/epitaph $(DAT)/bogusmon $(DAT)/tribute sp_lev.tag $(subst /,\,echo data >$(DAT)/dlb.lst) $(subst /,\,echo oracles >>$(DAT)/dlb.lst) $(subst /,\,if exist $(DAT)/options echo options >>$(DAT)/dlb.lst) @@ -1125,7 +1145,7 @@ nhdat: $(U)dlb_main.exe $(DAT)/data $(DAT)/oracles $(OPTIONS_FILE) \ $(U)recover.exe: $(RECOVOBJS) $(link) $(LFLAGSU) -o$@ $(RECOVOBJS) -$(O)recover.o: $(CONFIG_H) $(U)recover.c $(INCL)/win32api.h +$(O)recover.o: $(CONFIG_H) $(U)recover.c $(MSWSYS)/win32api.h $(cc) $(CFLAGSU) -o$@ $(U)recover.c #========================================== @@ -1197,10 +1217,10 @@ $(U)til2bm32.exe: $(O)til2bm32.o $(TEXT_IO32) @echo Linking $@... @$(link) $(LFLAGSU) -o$@ $(O)til2bm32.o $(TEXT_IO32) -$(O)tile2bmp.o: $(WSHR)/tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)/win32api.h +$(O)tile2bmp.o: $(WSHR)/tile2bmp.c $(HACK_H) $(TILE_H) $(MSWSYS)/win32api.h $(cc) $(CFLAGS) -mno-ms-bitfields -I$(WSHR) -o$@ $(WSHR)/tile2bmp.c -$(O)til2bm32.o: $(WSHR)/til2bm32.c $(HACK_H) $(TILE_H) $(INCL)/win32api.h +$(O)til2bm32.o: $(WSHR)/til2bm32.c $(HACK_H) $(TILE_H) $(MSWSYS)/win32api.h $(cc) $(CFLAGS) -I$(WSHR) -DTILE_X=32 -DTILE_Y=32 -o$@ $(WSHR)/til2bm32.c #========================================== @@ -1209,13 +1229,13 @@ $(O)til2bm32.o: $(WSHR)/til2bm32.c $(HACK_H) $(TILE_H) $(INCL)/win32api.h $(O)pdcurses.a : $(PDCLIBOBJS) $(PDCOBJS) ar rcs $@ $(PDCLIBOBJS) $(PDCOBJS) - + #========================================== # Housekeeping #========================================== spotless: clean - $(subst /,\,if exist graphicschk del graphicschk) + $(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) @@ -1260,7 +1280,7 @@ spotless: clean $(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 $(O)sp_lev.tag del $(O)sp_lev.tag) + $(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) @@ -1272,7 +1292,6 @@ spotless: clean $(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 $(INCL)/win32api.h del $(INCL)/win32api.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) @@ -1291,64 +1310,32 @@ spotless: clean $(subst /,\,if exist $(MSWIN)/rip.bmp del $(MSWIN)/rip.bmp) $(subst /,\,if exist $(MSWIN)/splash.bmp del $(MSWIN)/splash.bmp) ifneq "$(OBJ)" "" - $(subst /,\,if exist $(OBJ) rmdir $(OBJ)) /s /Q + test -d $(OBJ) && rmdir $(OBJ) /S /Q endif -ifeq "$(ADD_CURSES)" == "Y" +ifeq "$(ADD_CURSES)" "Y" if exist $(O)pdcurses.lib del $(O)pdcurses.lib endif clean: - $(subst /,\,if exist $(O)*.o del $(O)*.o) - $(subst /,\,if exist $(O)utility.tag del $(O)utility.tag) - $(subst /,\,if exist $(U)makedefs.exe del $(U)makedefs.exe) - $(subst /,\,if exist $(U)levcomp.exe del $(U)levcomp.exe) - $(subst /,\,if exist $(U)dgncomp.exe del $(U)dgncomp.exe) - $(subst /,\,if exist $(SRC)/*.lnk del $(SRC)/*.lnk) - $(subst /,\,if exist $(SRC)/*.map del $(SRC)/*.map) - $(subst /,\,if exist $(O)install.tag del $(O)install.tag) - $(subst /,\,if exist $(O)gamedir.tag del $(O)gamedir.tag) - $(subst /,\,if exist $(O)obj.tag del $(O)obj.tag) - $(subst /,\,if exist $(TILEBMP16) del $(TILEBMP16)) - $(subst /,\,if exist $(TILEBMP32) del $(TILEBMP32)) - + -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) + #=================================================================== # OTHER DEPENDENCIES #=================================================================== -# -# dat dependencies -# - -$(DAT)/data: $(O)utility.tag $(DATABASE) - $(subst /,\,$(U)makedefs -d) - -$(DAT)/rumors: $(O)utility.tag $(DAT)/rumors.tru $(DAT)/rumors.fal - $(subst /,\,$(U)makedefs -r) - -$(DAT)/quest.dat: $(O)utility.tag $(DAT)/quest.txt - $(subst /,\,$(U)makedefs -q) - -$(DAT)/oracles: $(O)utility.tag $(DAT)/oracles.txt - $(subst /,\,$(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 - $(subst /,\,$(U)makedefs -e) - $(subst /,\,$(U)dgncomp $(DAT)/dungeon.pdf) - # # NT dependencies # -$(O)nttty.o: $(HACK_H) $(TILE_H) $(INCL)/win32api.h $(MSWSYS)/nttty.c +$(O)nttty.o: $(HACK_H) $(TILE_H) $(MSWSYS)/win32api.h $(MSWSYS)/nttty.c $(cc) $(CFLAGS) -I$(WSHR) -o$@ $(MSWSYS)/nttty.c -$(O)winnt.o: $(HACK_H) $(INCL)/win32api.h $(MSWSYS)/winnt.c +$(O)winnt.o: $(HACK_H) $(MSWSYS)/win32api.h $(MSWSYS)/winnt.c $(cc) $(CFLAGS) -o$@ $(MSWSYS)/winnt.c $(O)ntsound.o: $(HACK_H) $(MSWSYS)/ntsound.c $(cc) $(CFLAGS) -o$@ $(MSWSYS)/ntsound.c @@ -1386,8 +1373,8 @@ $(O)panic.o: $(U)panic.c $(CONFIG_H) # Other dependencies needed by some ports # +ifeq "$(ADD_CURSES)" "Y" # 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 @@ -1396,7 +1383,9 @@ $(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 +endif +ifeq "$(WANT_WIN_QT4)" "Y" # Qt dependencies $(GAMEDIR)/Qt5Core.dll : $(QT4_DIRECTORY)/bin/Qt5Core.dll @@ -1419,8 +1408,6 @@ $(GAMEDIR)/nhtiles.bmp : $(SRC)/tiles.bmp $(GAMEDIR)/rip.xpm : ../win/X11/rip.xpm $(subst /,\,@copy $< $@ >nul) - - # Dependencies on .moc files (for Qt 4 or 5) $(OBJ)/qt4main.o : $(QT4)/qt4main.cpp $(QT4)/qt4main.moc $(QT4)/qt4kde0.moc $(OBJ)/qt4map.o : $(QT4)/qt4map.cpp $(QT4)/qt4map.moc @@ -1431,6 +1418,7 @@ $(OBJ)/qt4set.o : $(QT4)/qt4set.cpp $(QT4)/qt4set.moc $(OBJ)/qt4stat.o : $(QT4)/qt4stat.cpp $(QT4)/qt4stat.moc $(OBJ)/qt4xcmd.o : $(QT4)/qt4xcmd.cpp $(QT4)/qt4xcmd.moc $(OBJ)/qt4yndlg.o : $(QT4)/qt4yndlg.cpp $(QT4)/qt4yndlg.moc +endif # # The rest are stolen from sys/unix/Makefile.src, @@ -1447,7 +1435,7 @@ $(OBJ)/qt4yndlg.o : $(QT4)/qt4yndlg.cpp $(QT4)/qt4yndlg.moc $(O)tos.o: ../sys/atari/tos.c $(HACK_H) $(INCL)/tcap.h $(cc) $(CFLAGS) -o$@ ../sys/atari/tos.c $(O)pcmain.o: ../sys/share/pcmain.c $(HACK_H) $(INCL)/dlb.h \ - $(INCL)/win32api.h + $(MSWSYS)/win32api.h $(cc) $(CFLAGS) -o$@ ../sys/share/pcmain.c $(O)pcsys.o: ../sys/share/pcsys.c $(HACK_H) $(cc) $(CFLAGS) -o$@ ../sys/share/pcsys.c diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index f42c431cd..8f8eec6f3 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -115,10 +115,6 @@ WSHR = ..\win\share # Tile support files OBJ = o -cc=cl -link=link -rc=Rc - # # # Optional high-quality BSD random number generation routines @@ -151,94 +147,6 @@ DLBFLG = #ZLIB = zlib.lib -#========================================== -#========================================== -# Setting up the compiler and linker -#========================================== -#========================================== - -# 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. -# -#NMAKE version 1414264330 is distributed with VS 15.7.5 - -#!MESSAGE $(MAKEFLAGS) -#!MESSAGE $(MAKEDIR) -#!MESSAGE $(MAKE) - -MAKEVERSION=$(_NMAKE_VER:.= ) -MAKEVERSION=$(MAKEVERSION: =) -#!MESSAGE $(_NMAKE_VER) -#!MESSAGE $(MAKEVERSION) - -VSNEWEST=2017 -!IF ($(MAKEVERSION) < 1000000000) -VSVER=0000 #untested ancient version -!ELSEIF ($(MAKEVERSION) > 1000000000) && ($(MAKEVERSION) < 1100000000) -VSVER=2010 -!ELSEIF ($(MAKEVERSION) > 1100000000) && ($(MAKEVERSION) < 1200000000) -VSVER=2012 -!ELSEIF ($(MAKEVERSION) > 1200000000) && ($(MAKEVERSION) < 1400000000) -VSVER=2013 -!ELSEIF ($(MAKEVERSION) > 1400000000) && ($(MAKEVERSION) < 1411000000) -VSVER=2015 -!ELSEIF ($(MAKEVERSION) > 1411000000) && ($(MAKEVERSION) < 1414264331) -VSVER=$(VSNEWEST) -!ELSEIF ($(MAKEVERSION) > 1414264330) -VSVER=2999 #untested future version -!ENDIF - -!IF ($(VSVER) >= 2012) -!MESSAGE Autodetected Visual Studio $(VSVER) -!ELSEIF ($(VSVER) == 2999 -!MESSAGE The version of Visual Studio is newer than the most recent at -!MESSAGE the time this Makefile was crafted (Visual Studio $(VSNEWEST)). -!MESSAGE Because it is newer we'll proceed expecting that the -!MESSAGE VS$(VSNEWEST) processing will still work. -!ELSEIF ($(VSVER) == 0000) -!MESSAGE The version of Visual Studio appears to be quite old, older -!MESSAGE than VS2010 which is the oldest supported version by this -!MESSAGE Makefile, so we'll stop now. -!ERROR Untested old Visual Studio version with NMAKE $(_NMAKE_VER). -!ENDIF - -!IF ($(VSVER) == 2010) -# For VS2010 use "setenv /x86" or "setenv /x64" before invoking make process -# DO NOT DELETE THE FOLLOWING LINE -!include -! ENDIF - -#These will be in the environment variables with one of the VS2017 -#developer command prompts. -#VSCMD_ARG_HOST_ARCH=x64 -#VSCMD_ARG_TGT_ARCH=x86 - -!IFDEF VSCMD_ARG_HOST_ARCH -!MESSAGE Host architecture is $(VSCMD_ARG_HOST_ARCH) -!MESSAGE Target architecture is $(VSCMD_ARG_TGT_ARCH) -! IFNDEF TARGET_CPU -! IF "$(VSCMD_ARG_TGT_ARCH)"=="x64" -TARGET_CPU=x64 -! ELSE -TARGET_CPU=x86 -! ENDIF -! ENDIF -!ENDIF - -!IF "$(TARGET_CPU)" == "" -TARGET_CPU=x86 -!ENDIF - -!IF ($(VSVER) == 2010) -CL_RECENT= -!ELSE -! IF ($(VSVER) > 2010) -CL_RECENT=-sdl -! ENDIF -!ENDIF - - #========================================== #================ MACROS ================== #========================================== @@ -437,6 +345,97 @@ TILE_H = ..\win\share\tile.h 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. +# +#NMAKE version 1414264330 is distributed with VS 15.7.5 + +#!MESSAGE $(MAKEFLAGS) +#!MESSAGE $(MAKEDIR) +#!MESSAGE $(MAKE) + +MAKEVERSION=$(_NMAKE_VER:.= ) +MAKEVERSION=$(MAKEVERSION: =) +#!MESSAGE $(_NMAKE_VER) +#!MESSAGE $(MAKEVERSION) + +VSNEWEST=2017 +!IF ($(MAKEVERSION) < 1000000000) +VSVER=0000 #untested ancient version +!ELSEIF ($(MAKEVERSION) > 1000000000) && ($(MAKEVERSION) < 1100000000) +VSVER=2010 +!ELSEIF ($(MAKEVERSION) > 1100000000) && ($(MAKEVERSION) < 1200000000) +VSVER=2012 +!ELSEIF ($(MAKEVERSION) > 1200000000) && ($(MAKEVERSION) < 1400000000) +VSVER=2013 +!ELSEIF ($(MAKEVERSION) > 1400000000) && ($(MAKEVERSION) < 1411000000) +VSVER=2015 +!ELSEIF ($(MAKEVERSION) > 1411000000) && ($(MAKEVERSION) < 1414264331) +VSVER=$(VSNEWEST) +!ELSEIF ($(MAKEVERSION) > 1414264330) +VSVER=2999 #untested future version +!ENDIF + +!IF ($(VSVER) >= 2012) +!MESSAGE Autodetected Visual Studio $(VSVER) +!ELSEIF ($(VSVER) == 2999 +!MESSAGE The version of Visual Studio is newer than the most recent at +!MESSAGE the time this Makefile was crafted (Visual Studio $(VSNEWEST)). +!MESSAGE Because it is newer we'll proceed expecting that the +!MESSAGE VS$(VSNEWEST) processing will still work. +!ELSEIF ($(VSVER) == 0000) +!MESSAGE The version of Visual Studio appears to be quite old, older +!MESSAGE than VS2010 which is the oldest supported version by this +!MESSAGE Makefile, so we'll stop now. +!ERROR Untested old Visual Studio version with NMAKE $(_NMAKE_VER). +!ENDIF + +!IF ($(VSVER) == 2010) +# For VS2010 use "setenv /x86" or "setenv /x64" before invoking make process +# DO NOT DELETE THE FOLLOWING LINE +!include +! ENDIF + +#These will be in the environment variables with one of the VS2017 +#developer command prompts. +#VSCMD_ARG_HOST_ARCH=x64 +#VSCMD_ARG_TGT_ARCH=x86 + +!IFDEF VSCMD_ARG_HOST_ARCH +!MESSAGE Host architecture is $(VSCMD_ARG_HOST_ARCH) +!MESSAGE Target architecture is $(VSCMD_ARG_TGT_ARCH) +! IFNDEF TARGET_CPU +! IF "$(VSCMD_ARG_TGT_ARCH)"=="x64" +TARGET_CPU=x64 +! ELSE +TARGET_CPU=x86 +! ENDIF +! ENDIF +!ENDIF + +!IF "$(TARGET_CPU)" == "" +TARGET_CPU=x86 +!ENDIF + +!IF ($(VSVER) == 2010) +CL_RECENT= +!ELSE +! IF ($(VSVER) > 2010) +CL_RECENT=-sdl +! ENDIF +!ENDIF + #========================================== # More compiler setup post-macros #========================================== @@ -664,7 +663,7 @@ default : install all : install -install: $(O)envchk.tag $(O)obj.tag $(O)utility.tag $(GAMEDIR)\NetHack.exe $(GAMEDIR)\NetHackW.exe $(O)install.tag +install: $(O)envchk.tag $(O)utility.tag $(GAMEDIR)\NetHack.exe $(GAMEDIR)\NetHackW.exe $(O)install.tag @echo Done. $(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \ @@ -939,6 +938,33 @@ $(INCL)\vis_tab.h: $(U)makedefs.exe $(SRC)\vis_tab.c: $(U)makedefs.exe $(U)makedefs -z +$(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) + #========================================== # uudecode utility and uuencoded targets #========================================== @@ -1081,11 +1107,6 @@ $(O)nhsizes2.o: $(CONFIG_H) 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 >$@ - #========================================== # DLB utility and nhdat file creation #========================================== @@ -1276,6 +1297,9 @@ $(O)envchk.tag: $(O)obj.tag # @echo CL=$(CL) ! ENDIF echo envchk >$@ + @if not exist $(OBJ)\*.* echo creating directory $(OBJ:\=/) + @if not exist $(OBJ)\*.* mkdir $(OBJ) + @echo directory created >$@ #========================================== # Housekeeping @@ -1343,7 +1367,6 @@ spotless: clean 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 $(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 @@ -1401,7 +1424,6 @@ clean: if exist $(O)nhraykey.map del $(O)nhraykey.map if exist $(O)nhraykey.PDB del $(O)nhraykey.PDB 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 @@ -1420,37 +1442,6 @@ 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 # From 5f02f2455bdd6b6c18c2efd7f7af049df3726ba6 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 29 Nov 2018 16:36:07 -0500 Subject: [PATCH 12/14] more Makefile for Windows --- sys/winnt/Makefile.msc | 58 ++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 8f8eec6f3..d4c034a68 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -663,11 +663,11 @@ default : install all : install -install: $(O)envchk.tag $(O)utility.tag $(GAMEDIR)\NetHack.exe $(GAMEDIR)\NetHackW.exe $(O)install.tag +install: envchk.tag utility.tag $(GAMEDIR)\NetHack.exe $(GAMEDIR)\NetHackW.exe install.tag @echo Done. -$(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \ - $(DAT)\oracles $(DAT)\quest.dat $(O)sp_lev.tag $(DLB) +install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \ + $(DAT)\oracles $(DAT)\quest.dat sp_lev.tag $(DLB) ! IF ("$(USE_DLB)"=="Y") copy nhdat $(GAMEDIR) copy $(DAT)\license $(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 -$(O)sp_lev.tag: $(O)utility.tag $(DAT)\bigroom.des $(DAT)\castle.des \ +sp_lev.tag: 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 @@ $(O)sp_lev.tag: $(O)utility.tag $(DAT)\bigroom.des $(DAT)\castle.des \ $(U)levcomp valkyrie.des $(U)levcomp wizard.des cd $(SRC) - echo sp_levs done > $(O)sp_lev.tag + echo sp_levs done > sp_lev.tag -$(O)utility.tag: $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h \ +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) @@ -798,7 +798,7 @@ GAMEOBJ=$(GAMEOBJ:^ =^ # objs: $(GAMEOBJ) $(TTYOBJ) $(O)tile.o $(O)guistub.o -$(GAMEDIR)\NetHack.exe : $(O)gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistub.o \ +$(GAMEDIR)\NetHack.exe : 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 +811,7 @@ $(GAMEDIR)\NetHack.exe : $(O)gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)gu $(O)guistub.o $(O)console.res << - @if exist $(O)install.tag del $(O)install.tag + @if exist install.tag del install.tag # NetHackW # full tty linkage libs: @@ -821,8 +821,8 @@ $(GAMEDIR)\NetHack.exe : $(O)gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)gu # libs: $(LIBS) $(guilibs) $(COMCTRL) # objs: $(GAMEOBJ) $(GUIOBJ) $(O)tile.o $(O)ttystub.o -$(GAMEDIR)\NetHackW.exe : $(O)gamedir.tag $(O)tile.o $(O)ttystub.o \ - $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)winhack.res $(O)gamedir.tag $(KEYDLLS) +$(GAMEDIR)\NetHackW.exe : gamedir.tag $(O)tile.o $(O)ttystub.o \ + $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)winhack.res gamedir.tag $(KEYDLLS) @if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR) @echo Linking $(@:\=/) $(link) $(lflagsBuild) $(guilflags) /STACK:2048 /PDB:$(GAMEDIR)\$(@B).PDB \ @@ -835,9 +835,9 @@ $(GAMEDIR)\NetHackW.exe : $(O)gamedir.tag $(O)tile.o $(O)ttystub.o \ << @echo Adding manifest mt.exe -manifest $(MSWIN)\NetHackW.exe.manifest -outputresource:$(GAMEDIR)\NetHackW.exe;1 - @if exist $(O)install.tag del $(O)install.tag + @if exist install.tag del install.tag -$(O)gamedir.tag: +gamedir.tag: @if not exist $(GAMEDIR)\*.* echo creating directory $(GAMEDIR:\=/) @if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR) @echo directory created > $@ @@ -855,7 +855,7 @@ $(O)nhdefkey.def: @echo KeyHandlerName >>$@ ! ENDIF -$(GAMEDIR)\nhdefkey.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def +$(GAMEDIR)\nhdefkey.dll : $(O)$(@B).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 +874,7 @@ $(O)nh340key.def: @echo KeyHandlerName >>$@ ! ENDIF -$(GAMEDIR)\nh340key.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def +$(GAMEDIR)\nh340key.dll : $(O)$(@B).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,7 +893,7 @@ $(O)nhraykey.def: @echo KeyHandlerName >>$@ ! ENDIF -$(GAMEDIR)\nhraykey.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def +$(GAMEDIR)\nhraykey.dll : $(O)$(@B).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 \ @@ -938,13 +938,13 @@ $(INCL)\vis_tab.h: $(U)makedefs.exe $(SRC)\vis_tab.c: $(U)makedefs.exe $(U)makedefs -z -$(DAT)\data: $(O)utility.tag $(DATABASE) +$(DAT)\data: utility.tag $(DATABASE) $(U)makedefs -d -$(DAT)\rumors: $(O)utility.tag $(DAT)\rumors.tru $(DAT)\rumors.fal +$(DAT)\rumors: utility.tag $(DAT)\rumors.tru $(DAT)\rumors.fal $(U)makedefs -r -$(DAT)\quest.dat: $(O)utility.tag $(DAT)\quest.txt +$(DAT)\quest.dat: utility.tag $(DAT)\quest.txt $(U)makedefs -q $(DAT)\oracles: $(O)utility.tag $(DAT)\oracles.txt @@ -959,7 +959,7 @@ $(DAT)\epitaph: $(DAT)\epitaph.txt $(U)makedefs.exe $(DAT)\bogusmon: $(DAT)\bogusmon.txt $(U)makedefs.exe $(U)makedefs -s -$(DAT)\dungeon: $(O)utility.tag $(DAT)\dungeon.def +$(DAT)\dungeon: utility.tag $(DAT)\dungeon.def $(U)makedefs -e cd $(DAT) $(U)dgncomp dungeon.pdf @@ -1132,7 +1132,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 $(O)sp_lev.tag + $(DAT)\license $(DAT)\engrave $(DAT)\epitaph $(DAT)\bogusmon $(DAT)\tribute sp_lev.tag cd $(DAT) echo data >dlb.lst echo oracles >>dlb.lst @@ -1280,7 +1280,7 @@ $(O)pdcurses.lib : $(PDCLIBOBJS) $(PDCOBJS) # options. #========================================== -$(O)envchk.tag: $(O)obj.tag +envchk.tag: obj.tag ! IF "$(TARGET_CPU)"=="x64" @echo Windows x64 64-bit target build ! ELSE @@ -1296,6 +1296,8 @@ $(O)envchk.tag: $(O)obj.tag # @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) @@ -1364,10 +1366,10 @@ 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 $(O)sp_lev.tag del $(O)sp_lev.tag + if exist sp_lev.tag del sp_lev.tag if exist $(SRC)\vis_tab.c del $(SRC)\vis_tab.c if exist nhdat. del nhdat. - if exist $(O)gamedir.tag del $(O)gamedir.tag + if exist gamedir.tag del 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 @@ -1389,20 +1391,20 @@ spotless: clean !ENDIF clean: if exist $(O)*.o del $(O)*.o - if exist $(O)utility.tag del $(O)utility.tag + if exist utility.tag del 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 $(O)install.tag del $(O)install.tag + if exist install.tag del 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 $(O)gamedir.tag del $(O)gamedir.tag + if exist gamedir.tag del 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 @@ -1423,8 +1425,8 @@ 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 $(O)envchk.tag del $(O)envchk.tag - if exist $(O)sp_lev.tag del $(O)sp_lev.tag + if exist envchk.tag del envchk.tag + if exist sp_lev.tag del sp_lev.tag if exist $(O)uudecode.MAP del $(O)uudecode.MAP if exist $(O)uudecode.PDB del $(O)uudecode.PDB rem From d45b8e4fb3119ac67cb83ff25e2a23aaa3116ef1 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 29 Nov 2018 17:41:20 -0500 Subject: [PATCH 13/14] More Makefiles --- sys/winnt/Makefile.gcc | 28 +++++++++++++++++++++++----- sys/winnt/Makefile.msc | 2 +- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index 76b140fd6..70387b07a 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -135,6 +135,10 @@ TARGET_CPU=x86 # #============================================================================== +SKIP_NETHACKW=Y + +#============================================================================== + # # Source directories. Makedefs hardcodes these, don't change them. # @@ -269,7 +273,7 @@ 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 +VOBJ10 = $(O)mail.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 @@ -313,11 +317,14 @@ OBJS = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \ $(VOBJ26) $(VOBJ27) $(VOBJ28) $(VOBJ29) $(REGEX) \ $(CURSESOBJ) +ifneq "$(SKIP_NETHACKW)" "Y" 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 +endif + ifeq "$(WANT_WIN_QT4)" "Y" GUIOBJ += $(O)qt4bind.o $(O)qt4click.o $(O)qt4clust.o $(O)qt4delay.o \ $(O)qt4glyph.o $(O)qt4icon.o $(O)qt4inv.o $(O)qt4key.o $(O)qt4line.o \ @@ -326,11 +333,13 @@ ifeq "$(WANT_WIN_QT4)" "Y" $(O)qt4svsel.o $(O)qt4win.o $(O)qt4xcmd.o $(O)qt4yndlg.o endif +ifneq "$(SKIP_NETHACKW)" "Y" 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 +endif ifeq "$(WANT_WIN_QT4)" "Y" GUIHDR += $(QT4)/qt4bind.h $(QT4)/qt4click.h $(QT4)/qt4clust.h \ @@ -669,6 +678,12 @@ $(OBJ)/%.o : $(QT4)/%.cpp $(QT4)/%.moc : $(QT4)/%.h $(QT4_DIRECTORY)\bin\moc -o $@ $< +ifeq "$(SKIP_NETHACKW)" "Y" +NETHACKW_EXE = +else +NETHACKW_EXE = $(GAMEDIR)/NetHack.exe +endif + #========================================== #=============== TARGETS ================== #========================================== @@ -690,7 +705,8 @@ default : install all : install -install: initialchk $(GAMEDIR)/NetHack.exe $(GAMEDIR)/NetHackW.exe install.tag $(EXTRA_FILES) +install: initialchk $(GAMEDIR)/NetHack.exe $(U)uudecode.exe $(O)winres.o \ + $(NETHACKW_EXE) install.tag $(EXTRA_FILES) @echo NetHack is up to date. @echo Done. @@ -803,12 +819,14 @@ $(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 \ +ifneq "$(SKIP_NETHACKW)" "Y" +$(GAMEDIR)/NetHackW.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)ttystub.o \ $(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)winres.o $(KEYDLLS) @echo Linking $@... $(link) $(lflags) -mwindows -o$@ $(ALLOBJ) $(GUIOBJ) $(O)tile.o $(O)ttystub.o \ $(O)winres.o $(PDCLIB) $(guilibs) -static -lstdc++ $(subst /,\,@if exist install.tag del install.tag) +endif $(O)nhdefkey.o: $(cc) $(CFLAGS) -DBUILD_DLL -o$@ $(MSWSYS)/nhdefkey.c @@ -923,8 +941,8 @@ $(O)uudecode.o: $(SSYS)/uudecode.c $(MSWSYS)/NetHack.ico : $(U)uudecode.exe $(MSWSYS)/nhico.uu $(subst /,\,$(U)uudecode.exe $(MSWSYS)/nhico.uu) - $(subst /,\,copy NetHack.ico $@) - del NetHack.ico + cp NetHack.ico $@ + rm NetHack.ico $(MSWIN)/NetHack.ico : $(MSWSYS)/NetHack.ico $(subst /,\,copy $< $@) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index d4c034a68..f529c6940 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -947,7 +947,7 @@ $(DAT)\rumors: utility.tag $(DAT)\rumors.tru $(DAT)\rumors.fal $(DAT)\quest.dat: utility.tag $(DAT)\quest.txt $(U)makedefs -q -$(DAT)\oracles: $(O)utility.tag $(DAT)\oracles.txt +$(DAT)\oracles: utility.tag $(DAT)\oracles.txt $(U)makedefs -h $(DAT)\engrave: $(DAT)\engrave.txt $(U)makedefs.exe From 5049d23ce0d624448d52c992a061e7b9ee7e95d3 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 29 Nov 2018 20:59:03 -0500 Subject: [PATCH 14/14] 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 +