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..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 @@ -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..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 @@ -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} diff --git a/doc/fixes36.2 b/doc/fixes36.2 index b840669b2..94986c5b0 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -225,6 +225,15 @@ 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 +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 +dismount that kills steed because there is no room to put it on map blamed the + hero; change that to only blame hero if dismount was voluntary +to emphasize that it's not a light source, change description of wielded Sting + from "(glowing light blue)" to "(light blue aura)" when sighted and + from "(glowing)" to nothing (not warm enough to feel) when blind Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository @@ -242,6 +251,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 @@ -263,6 +274,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 +294,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 @@ -315,6 +333,9 @@ X11: don't reuse perm_invent window for picking an object X11: obey mouse_support and allow toggling it in game X11: obey menu movement keys X11: enable menu [cancel] button for PICK_NONE menus +X11: text popups on OSX wouldn't accept keyboard input unless the 'autofocus' + resource was enabled; most noticeable when trying to dismiss 'things + that are here' while walking over object piles General New Features diff --git a/include/ntconf.h b/include/ntconf.h index 73d421fd8..bf98fec65 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -94,6 +94,15 @@ extern void FDECL(interject, (int)); *=============================================== */ +#ifdef __MINGW32__ +#ifdef strncasecmp +#undef strncasecmp +#endif +#ifdef strcasecmp +#undef strcasecmp +#endif +#endif + #ifdef _MSC_VER #if (_MSC_VER > 1000) /* Visual C 8 warning elimination */ diff --git a/include/winX.h b/include/winX.h index 1a061fa14..a1a560528 100644 --- a/include/winX.h +++ b/include/winX.h @@ -165,6 +165,7 @@ struct menu_info_t { boolean cancelled; /* Menu has been explicitly cancelled. */ boolean counting; /* true when menu_count has a valid value */ boolean permi; + boolean disable_mcolors; /* disable menucolors */ int permi_x, permi_y; /* perm_invent window x,y */ int permi_w, permi_h; /* perm_invent window wid, hei */ diff --git a/include/wincurs.h b/include/wincurs.h index eb07879f4..55e7f1d22 100644 --- a/include/wincurs.h +++ b/include/wincurs.h @@ -7,16 +7,11 @@ /* Global declarations for curses interface */ -int term_rows, term_cols; /* size of underlying terminal */ - -WINDOW *base_term; /* underlying terminal window */ - -WINDOW *mapwin, *statuswin, *messagewin; /* Main windows */ - -int orig_cursor; /* Preserve initial cursor state */ - -boolean counting; /* Count window is active */ - +extern int term_rows, term_cols; /* size of underlying terminal */ +extern int orig_cursor; /* Preserve initial cursor state */ +extern WINDOW *base_term; /* underlying terminal window */ +extern boolean counting; /* Count window is active */ +extern WINDOW *mapwin, *statuswin, *messagewin; /* Main windows */ #define TEXTCOLOR /* Allow color */ #define NHW_END 19 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/mondata.c b/src/mondata.c index 74814bd3d..62dea9a10 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mondata.c $NHDT-Date: 1539938825 2018/10/19 08:47:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.67 $ */ +/* NetHack 3.6 mondata.c $NHDT-Date: 1543545188 2018/11/30 02:33:08 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.69 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -739,6 +739,10 @@ const char *in_str; /* Outdated names */ { "invisible stalker", PM_STALKER }, { "high-elf", PM_ELVENKING }, /* PM_HIGH_ELF is obsolete */ + /* other misspellings or incorrect words */ + { "wood-elf", PM_WOODLAND_ELF }, + { "wood elf", PM_WOODLAND_ELF }, + { "woodland nymph", PM_WOOD_NYMPH }, { "halfling", PM_HOBBIT }, /* potential guess for polyself */ { "genie", PM_DJINNI }, /* potential guess for ^G/#wizgenesis */ /* Hyphenated names -- it would be nice to handle these via diff --git a/src/objnam.c b/src/objnam.c index 3fc3e01d2..af74c3bf0 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 objnam.c $NHDT-Date: 1539938837 2018/10/19 08:47:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.214 $ */ +/* NetHack 3.6 objnam.c $NHDT-Date: 1543544340 2018/11/30 02:19:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.226 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1154,11 +1154,11 @@ unsigned doname_flags; (obj->otyp == AKLYS) ? "tethered " : "", hand_s); if (warn_obj_cnt && obj == uwep && (EWarn_of_mon & W_WEP) != 0L) { - /* presumably can be felt when blind */ - Strcat(bp, " (glowing"); + /* this used to be "(glowing )" when sighted or + "(glowing)" when blind (via feeling warmth), but it + isn't a light source so describe something fainter */ if (!Blind) - Sprintf(eos(bp), " %s", glow_color(obj->oartifact)); - Strcat(bp, ")"); + Sprintf(eos(bp), " (%s aura)", glow_color(obj->oartifact)); } } } 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) */ diff --git a/src/steed.c b/src/steed.c index bf675cca9..65e5ebbae 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: 1543543362 2018/11/30 02:02:42 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.59 $ */ /* 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,55 @@ 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)) { + /* hero's spot has a monster in it; hero must have been plucked + from saddle as engulfer moved into his spot--other dismounts + shouldn't run into this situation; find nearest viable spot */ + if (!enexto(&steedcc, u.ux, u.uy, mtmp->data) + /* no spot? must have been engulfed by a lurker-above over + water or lava; try requesting a location for a flyer */ + && !enexto(&steedcc, u.ux, u.uy, &mons[PM_BAT])) + /* still no spot; last resort is any spot within bounds */ + (void) enexto(&steedcc, u.ux, u.uy, &mons[PM_GHOST]); } + 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); + /* if for bones, there's no reason to place the hero; + we want to make room for potential ghost, so move steed */ + 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; + } + + /* Set hero's and/or steed's positions. Try moving the hero first. */ if (!u.uswallow && !u.ustuck && have_spot) { struct permonst *mdat = mtmp->data; @@ -614,20 +650,29 @@ int reason; /* Player was thrown off etc. */ if (save_utrap) (void) mintrap(mtmp); } - /* Couldn't... try placing the steed */ + + /* Couldn't move hero... try moving the steed. */ } else if (enexto(&cc, u.ux, u.uy, mtmp->data)) { /* Keep player here, move the steed to cc */ rloc_to(mtmp, cc.x, cc.y); /* Player stays put */ - /* Otherwise, kill the steed */ - } else { - killed(mtmp); - adjalign(-1); - } - } - /* Return the player to the floor */ - if (reason != DISMOUNT_ENGULFED) { + /* Otherwise, kill the steed. */ + } else { + if (reason == DISMOUNT_BYCHOICE) { + /* [un]#ride: hero gets credit/blame for killing steed */ + killed(mtmp); + adjalign(-1); + } else { + /* other dismount: kill former steed with no penalty; + damage type is just "neither AD_DGST nor -AD_RBRE" */ + monkilled(mtmp, "", -AD_PHYS); + } + } + } /* !DEADMONST(mtmp) */ + + /* usually return the hero to the surface */ + if (reason != DISMOUNT_ENGULFED && reason != DISMOUNT_BONES) { in_steed_dismounting = TRUE; (void) float_down(0L, W_SADDLE); in_steed_dismounting = FALSE; 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 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); } diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 93674ab34..20b73f728 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. */ @@ -87,9 +87,12 @@ unsigned _stklen = STKSIZ; * to help MinGW decide which entry point to choose. If both main and * WinMain exist, the resulting executable won't work correctly. */ -#ifndef __MINGW32__ int +#ifndef __MINGW32__ main(argc, argv) +#else +mingw_main(argc, argv) +#endif int argc; char *argv[]; { @@ -115,7 +118,6 @@ char *argv[]; /*NOTREACHED*/ return 0; } -#endif boolean pcmain(argc, argv) @@ -177,7 +179,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; diff --git a/sys/vms/Makefile.src b/sys/vms/Makefile.src index d6e1a9a25..a29367655 100644 --- a/sys/vms/Makefile.src +++ b/sys/vms/Makefile.src @@ -1,5 +1,5 @@ # NetHack Makefile (VMS) - for building nethack itself. -# NetHack 3.6 Makefile.src $NHDT-Date: 1542388601 2018/11/16 17:16:41 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.31 $ +# NetHack 3.6 Makefile.src $NHDT-Date: 1543545915 2018/11/30 02:45:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.32 $ # Copyright (c) 2011 by Robert Patrick Rankin # NetHack may be freely redistributed. See license for details. @@ -140,9 +140,9 @@ VERSOURCES = $(HACKCSRC) $(SYSSRC) $(WINSRC) $(RANDSRC) $(GENCSRC) HACKINCL = align.h amiconf.h artifact.h artilist.h attrib.h beconf.h color.h \ config.h config1.h context.h coord.h decl.h def_os2.h display.h \ dlb.h dungeon.h engrave.h extern.h flag.h func_tab.h global.h \ - hack.h lev.h macconf.h mextra.h mfndpos.h micro.h \ - mkroom.h monattk.h mondata.h monflag.h monst.h monsym.h obj.h \ - objclass.h os2conf.h patchlevel.h pcconf.h permonst.h prop.h rect.h \ + hack.h lev.h macconf.h mextra.h mfndpos.h micro.h mkroom.h \ + monattk.h mondata.h monflag.h monst.h monsym.h obj.h objclass.h \ + os2conf.h patchlevel.h pcconf.h permonst.h prop.h rect.h \ region.h rm.h sp_lev.h spell.h sys.h system.h tcap.h timeout.h \ tosconf.h tradstdc.h trampoli.h trap.h unixconf.h vision.h \ vmsconf.h wintty.h winX.h winprocs.h wintype.h you.h youprop.h @@ -206,8 +206,8 @@ nethack.opt : $(MAKEFILE) # this file @ write f f$edit("$(HOBJ5)","COLLAPSE") @ write f f$edit("$(HOBJ6)","COLLAPSE") @ write f "sys$library:starlet.olb/Include=(lib$initialize) - @ write f \ - "psect_attr=lib$initialize, Con,Usr,noPic,Rel,Gbl,noShr,noExe,Rd,noWrt,Long" + @ write f "! psect_attributes Usr, noPic, and Long removed" + @ write f "psect_attr=lib$initialize, Con,Rel,Gbl,noShr,noExe,Rd,noWrt" @ write f "iosegment=128" close f @@ -378,7 +378,7 @@ attrib.obj : attrib.c $(HACK_H) ball.obj : ball.c $(HACK_H) bones.obj : bones.c $(HACK_H) $(INC)lev.h botl.obj : botl.c $(HACK_H) -cmd.obj : cmd.c $(HACK_H) $(INC)func_tab.h +cmd.obj : cmd.c $(HACK_H) $(INC)lev.h $(INC)func_tab.h dbridge.obj : dbridge.c $(HACK_H) decl.obj : decl.c $(HACK_H) detect.obj : detect.c $(HACK_H) $(INC)artifact.h diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index 1cc6dea87..f71953aec 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -91,8 +91,8 @@ TARGET_CPU=x86 # 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 #4b Qt # @@ -135,21 +135,37 @@ TARGET_CPU=x86 # #============================================================================== +SKIP_NETHACKW=Y + +#============================================================================== + # # 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 +173,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,81 +206,20 @@ 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 +# Have windows path styles available for use in commands +W_OBJ =$(subst /,\, $(OBJ)) +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 ================== @@ -297,17 +244,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 @@ -341,7 +288,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 @@ -359,7 +306,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,29 +314,32 @@ 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) +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 \ @@ -398,11 +348,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 \ @@ -457,8 +409,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,22 +452,104 @@ TILE_H = ../win/share/tile.h DATABASE = $(DAT)/data.base #========================================== -# More compiler setup post-macros +# More compiler setup macros #========================================== # ifeq "$(ADD_CURSES)" "Y" -#CURSESDEF=-D"PDC_DLL_BUILD" -D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" else CURSDEF= CURSESLIB= -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 +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) $(CURSESDEF) +#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 +585,6 @@ $(OBJ)/%.o : $(SSYS)/%.cpp $(OBJ)/%.o : $(MSWSYS)/%.c $(cc) $(CFLAGS) -o$@ $< -$(INCL)/%.h : $(MSWSYS)/%.h - @copy $< $@ - #========================================== # Rules for files in util #========================================== @@ -569,8 +599,8 @@ $(OBJ)/%.o : $(UTIL)/%.c $(OBJ)/%.o : $(WSHR)/%.c $(cc) $(CFLAGS) -o$@ $< -$(INCL)/%.h : $(WSHR)/%.h - @copy $< $@ +#$(INCL)/%.h : $(WSHR)/%.h +# @copy $< $@ #{$(WSHR)}.txt{$(DAT)}.txt: # @copy $< $@ @@ -594,7 +624,7 @@ $(OBJ)/%.o : $(MSWIN)/%.c #========================================== $(OBJ)/%.o : $(WCURSES)/%.c - $(cc) $(CFLAGS) -o$@ $< + $(cc) $(PDCINCL) $(CFLAGS) -o$@ $< #========================================== # Rules for files in PDCurses @@ -628,11 +658,13 @@ 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= # # - Specify your flex skeleton file (if needed). @@ -645,6 +677,12 @@ YTABC = y_tab.c YTABH = y_tab.h LEXYYC = lexyy.c +export YACC +export LEX +export FLEXSKEL +export YTABC +export YTABH +export LEXYYC #========================================== # Rules for files in win/Qt4 @@ -661,6 +699,14 @@ $(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 + +SHELL=CMD.EXE + #========================================== #=============== TARGETS ================== #========================================== @@ -682,13 +728,14 @@ 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 $(U)uudecode.exe $(O)winres.o \ + $(NETHACKW_EXE) install.tag $(EXTRA_FILES) @echo NetHack is up to date. @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) ifeq "$(USE_DLB)" "Y" $(subst /,\,copy nhdat $(GAMEDIR)) $(subst /,\,copy $(DAT)/license $(GAMEDIR)) @@ -706,7 +753,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 > $@) @@ -717,7 +764,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 +798,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 >$@) @@ -766,25 +813,26 @@ $(O)winres.o: $(TILEBMP16) $(MSWIN)/winhack.rc $(MSWIN)/mnsel.bmp \ $(MSWIN)/mnselcnt.bmp $(MSWIN)/mnunsel.bmp \ $(MSWIN)/petmark.bmp $(MSWIN)/pilemark.bmp $(MSWIN)/NetHack.ico $(MSWIN)/rip.bmp \ $(MSWIN)/splash.bmp - @$(rc) -o$@ --include-dir $(MSWIN) -i $(MSWIN)/winhack.rc + $(rc) -o$@ --include-dir $(MSWIN) -i $(MSWIN)/winhack.rc $(O)conres.o: $(MSWSYS)/console.rc $(MSWSYS)/NetHack.ico - @$(rc) -o$@ --include-dir $(MSWSYS) -i $(MSWSYS)/console.rc + $(rc) -o$@ --include-dir $(MSWSYS) -i $(MSWSYS)/console.rc #========================================== # 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 $(W_GAMEDIR) + test -d $(GAMEDIR) || mkdir $(W_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 +842,19 @@ $(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 \ +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 $(O)install.tag del $(O)install.tag) + $(subst /,\,@if exist install.tag del install.tag) +endif $(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 +862,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 +870,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 +882,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 ============ @@ -848,11 +901,11 @@ graphicschk: #========================================== $(U)makedefs.exe: $(MAKEOBJS) - @$(link) $(LFLAGSU) -o$@ $(MAKEOBJS) + $(link) $(LFLAGSU) -o$@ $(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 +928,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,20 +949,22 @@ $(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 #========================================== $(U)uudecode.exe: $(O)uudecode.o - @$(link) $(LFLAGSU) -o$@ $(O)uudecode.o + $(link) $(LFLAGSU) -o$@ $(O)uudecode.o $(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 $@) + copy NetHack.ico $(W_MSWSYS)\NetHack.ico del NetHack.ico $(MSWIN)/NetHack.ico : $(MSWSYS)/NetHack.ico @@ -945,106 +1012,54 @@ $(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 $@... - @$(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 + @echo Linking $@... + $(link) $(LFLAGSU) -o$@ $(DGNCOMPOBJS) #================================================= # For a couple of devteam utilities @@ -1052,11 +1067,11 @@ endif $(U)nhsizes.exe: $(O)nhsizes.o @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o$(U)nhsizes.exe: $(O)nhsizes.o + $(link) $(LFLAGSU) -o$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o$(U)nhsizes.exe: $(O)nhsizes.o $(U)nhsize2.exe: $(O)nhsizes2.o @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(O)nhsizes2.o $(O)panic.o $(O)alloc.o + $(link) $(LFLAGSU) -o$@ $(O)nhsizes2.o $(O)panic.o $(O)alloc.o $(O)nhsizes.o: $(CONFIG_H) nhsizes.c $(cc) $(CFLAGSU) -o$@ nhsizes.c @@ -1068,17 +1083,13 @@ $(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 #========================================== $(U)dlb_main.exe: $(DLBOBJ) $(O)dlb.o - @$(link) $(LFLAGSU) -o$@ $(O)dlb_main.o $(O)dlb.o $(O)alloc.o $(O)panic.o + $(link) $(LFLAGSU) -o$@ $(O)dlb_main.o $(O)dlb.o $(O)alloc.o $(O)panic.o $(O)dlb.o: $(O)dlb_main.o $(O)alloc.o $(O)panic.o $(INCL)/dlb.h @@ -1093,7 +1104,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 +1136,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 #========================================== @@ -1137,7 +1148,7 @@ $(SRC)/tile.c: $(U)tilemap.exe @$(U)tilemap $(U)tilemap.exe: $(O)tilemap.o - @$(link) $(LFLAGSU) -o$@ $(O)tilemap.o + $(link) $(LFLAGSU) -o$@ $(O)tilemap.o $(O)tilemap.o: $(WSHR)/tilemap.c $(HACK_H) $(cc) $(CFLAGSU) -o$@ $(WSHR)/tilemap.c @@ -1169,38 +1180,38 @@ $(O)tilete32.o: $(WSHR)/tiletext.c $(CONFIG_H) $(TILE_H) $(U)gif2txt.exe: $(GIFREADERS) $(TEXT_IO) @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(GIFREADERS) $(TEXT_IO) + $(link) $(LFLAGSU) -o$@ $(GIFREADERS) $(TEXT_IO) $(U)gif2tx32.exe: $(GIFREADERS32) $(TEXT_IO32) @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(GIFREADERS32) $(TEXT_IO32) + $(link) $(LFLAGSU) -o$@ $(GIFREADERS32) $(TEXT_IO32) $(U)txt2ppm.exe: $(PPMWRITERS) $(TEXT_IO) @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(PPMWRITERS) $(TEXT_IO) + $(link) $(LFLAGSU) -o$@ $(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) @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(O)tile2bmp.o $(TEXT_IO) + $(link) $(LFLAGSU) -o$@ $(O)tile2bmp.o $(TEXT_IO) $(U)til2bm32.exe: $(O)til2bm32.o $(TEXT_IO32) @echo Linking $@... - @$(link) $(LFLAGSU) -o$@ $(O)til2bm32.o $(TEXT_IO32) + $(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,146 +1220,200 @@ $(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 $(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 $(O)sp_lev.tag del $(O)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 $(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) - $(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) -ifneq "$(OBJ)" "" - $(subst /,\,if exist $(OBJ) rmdir $(OBJ)) /s /Q + if exist o\* del /Q o\* + -test -d o && rd o + if exist objdir.tag del objdir.tag + if exist gamedir.tag del gamedir.tag +ifneq "$(W_GAMEDIR)" "" + if exist $(W_GAMEDIR)\NetHack.exe del $(W_GAMEDIR)\NetHack.exe + 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 -ifeq "$(ADD_CURSES)" == "Y" - if exist $(O)pdcurses.lib del $(O)pdcurses.lib +ifneq "$(W_SRC)" "" + 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_SRC)\vis_tab.c del $(W_SRC)\vis_tab.c + if exist nhdat. del nhdat. 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)) +ifneq "$(W_DAT)" "" + 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 +endif +ifneq "$(W_OBJ)" "" + if exist $(W_OBJ)\sp_lev.tag del $(W_OBJ)\sp_lev.tag + 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 +endif +ifneq "$(W_MSWIN)" "" + 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 +endif +ifneq "$(W_MSWSYS)" "" + if exist $(W_MSWSYS)\nethack.ico del $(W_MSWSYS)\nethack.ico +endif +ifneq "$(W_UTIL)" "" + if exist $(W_UTIL)\*.lnk del $(W_UTIL)\*.lnk + if exist $(W_UTIL)\*.map del $(W_UTIL)\*.map + 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 +endif +ifneq "$(W_INCL)" "" + 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 +endif +ifeq "$(ADD_CURSES)" "Y" +ifneq "$(W_OBJ)" "" + if exist $(W_OBJ)\pdcurses.lib del $(W_OBJ)\pdcurses.lib +endif +endif + if exist $(W_GAMEDIR)\license. del $(W_GAMEDIR)\license. + if exist $(W_GAMEDIR)\nh340key.dll del $(W_GAMEDIR)\nh340key.dll + if exist $(W_GAMEDIR)\nhdefkey.dll del $(W_GAMEDIR)\nhdefkey.dll + if exist $(W_GAMEDIR)\nhraykey.dll del $(W_GAMEDIR)\nhraykey.dll + -test -d ..\binary && rd ..\binary +clean: + if exist initialchk del initialchk + if exist install.tag del install.tag + if exist utility.tag del utility.tag +ifneq "$(W_UTIL)" "" + 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 +endif +ifneq "$(W_SRC)" "" + if exist $(W_SRC)\*.lnk del $(W_SRC)\*.lnk + if exist $(W_SRC)\*.map del $(W_SRC)\*.map +endif +ifneq "$(W_OBJ)" "" + if exist $(W_OBJ)\*.o del $(W_OBJ)\*.o + if exist $(W_OBJ)\utility.tag del $(W_OBJ)\utility.tag + 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 +endif + 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 #=================================================================== -# -# 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 @@ -1358,13 +1423,13 @@ $(O)ntsound.o: $(HACK_H) $(MSWSYS)/ntsound.c #include the following stub for proper linkage. $(O)guistub.o: $(HACK_H) $(MSWSYS)/stubs.c - @$(cc) $(CFLAGS) -DGUISTUB -o$@ $(MSWSYS)/stubs.c + $(cc) $(CFLAGS) -DGUISTUB -o$@ $(MSWSYS)/stubs.c #if you aren't linking in the full tty then #include the following stub for proper linkage. $(O)ttystub.o: $(HACK_H) $(MSWSYS)/stubs.c - @$(cc) $(CFLAGS) -DTTYSTUB -o$@ $(MSWSYS)/stubs.c + $(cc) $(CFLAGS) -DTTYSTUB -o$@ $(MSWSYS)/stubs.c $(O)tile.o: $(SRC)/tile.c $(HACK_H) @@ -1386,8 +1451,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,13 +1461,15 @@ $(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 +$(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 @@ -1419,8 +1486,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 +1496,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 +1513,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 ce6768ce3..f22cea224 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 @@ PDCURSES_TOP=..\..\pdcurses # 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,10 +118,11 @@ 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 @@ -151,93 +155,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 ================== @@ -272,7 +189,7 @@ 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+ +# 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 @@ -298,19 +215,19 @@ 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 +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 @@ -354,8 +271,7 @@ GUIHDR = $(MSWIN)\mhaskyn.h $(MSWIN)\mhdlg.h $(MSWIN)\mhfont.h \ COMCTRL = comctl32.lib -KEYDLLS = $(GAMEDIR)\nhdefkey.dll $(GAMEDIR)\nh340key.dll \ - $(GAMEDIR)\nhraykey.dll +KEYDLLS = $(GAMEDIR)\nhdefkey.dll $(GAMEDIR)\nh340key.dll $(GAMEDIR)\nhraykey.dll TILEUTIL16 = $(UTIL)\tile2bmp.exe TILEBMP16 = $(SRC)\tiles.bmp @@ -437,31 +353,109 @@ 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 #========================================== #---------------------------------------------------------------- !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) \ @@ -531,6 +525,12 @@ conlibs = $(baselibs) guilibs = $(winlibs) # +!IFNDEF ADD_CURSES +INCLDIR= /I..\include /I..\sys\winnt +!ELSE +INCLDIR= /I..\include /I..\sys\winnt +!ENDIF + #========================================== # Util builds #========================================== @@ -550,10 +550,6 @@ DLB = nhdat DLB = ! ENDIF -#========================================== -#---- end of Visual Studio Specific macros -#========================================== - #========================================== #================ RULES ================== #========================================== @@ -632,6 +628,9 @@ DLB = {$(WCURSES)}.c{$(OBJ)}.o: @$(cc) $(PDCINCL) $(cflagsBuild) -Fo$@ $< +#{$(WCURSES)}.txt{$(DAT)}.txt: +# @copy $< $@ + #========================================== # Rules for files in PDCurses #========================================== @@ -683,12 +682,10 @@ $(O)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) @@ -753,10 +750,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 @@ -778,8 +775,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:^ =^ ) @@ -898,14 +893,20 @@ $(GAMEDIR)\nhraykey.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def /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) @@ -1057,24 +1058,6 @@ $(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 #================================================= @@ -1084,6 +1067,34 @@ $(O)obj.tag: @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 #========================================== @@ -1244,40 +1255,19 @@ $(O)tile2bmp.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(MSWSYS)\win32api.h $(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) lib -nologo /out:$@ $(PDCLIBOBJS) $(PDCOBJS) -#========================================== -# Notify of any CL environment variables -# in effect since they change the compiler -# options. -#========================================== +$(O)pdcscrn.o : $(PDCURSES_HEADERS) $(PDCWINCON)\pdcscrn.c $(MSWSYS)\stub-pdcscrn.c + $(cc) $(PDCINCL) $(cflagsBuild) -Fo$@ $(MSWSYS)\stub-pdcscrn.c -$(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 >$@ - -#========================================== +#=============================================================================== # Housekeeping -#========================================== +#=============================================================================== spotless: clean ! IF ("$(OBJ)"!="") @@ -1370,7 +1360,6 @@ clean: 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 $(O)console.res del $(O)console.res if exist $(O)dgncomp.MAP del $(O)dgncomp.MAP @@ -1480,8 +1469,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 # @@ -1495,21 +1482,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: @@ -1582,6 +1566,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/sys/winnt/nttty.c b/sys/winnt/nttty.c index 579125867..b71133af2 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -1889,7 +1889,7 @@ void nethack_enter_nttty() error("Unable to load nhraykey.dll"); } } -#endif TTY_GRAPHICS +#endif /* TTY_GRAPHICS */ /* this is used as a printf() replacement when the window * system isn't initialized yet diff --git a/sys/winnt/stub-pdcscrn.c b/sys/winnt/stub-pdcscrn.c new file mode 100644 index 000000000..7588a782b --- /dev/null +++ b/sys/winnt/stub-pdcscrn.c @@ -0,0 +1,15 @@ +/* + * Use this stub to insert a needed pragma prior + * to compiling $(PDCWINCON)\pdcscrn.c in the + * PDCurses distribution. + * + * We don't want to ask NetHack builders to + * modify the PDCurses distribution in any way, + * we only ask that they have the original intact + * PDCurses source tree available during the build. + * + */ + +#pragma warning(disable : 4996) +#include "pdcscrn.c" + diff --git a/sys/winnt/stubs.c b/sys/winnt/stubs.c index bb5ad82e4..3e7fa4c20 100644 --- a/sys/winnt/stubs.c +++ b/sys/winnt/stubs.c @@ -7,7 +7,7 @@ #ifdef GUISTUB #ifdef TTYSTUB -#error You can't compile this with both GUISTUB and TTYSTUB defined. +#error You cannot compile this with both GUISTUB and TTYSTUB defined. #endif int GUILaunched; @@ -29,6 +29,7 @@ mswin_destroy_reg() */ #ifdef __MINGW32__ extern char default_window_sys[]; +extern int mingw_main(int argc, char **argv); int main(argc, argv) @@ -37,10 +38,7 @@ char *argv[]; { boolean resuming; - sys_early_init(); - Strcpy(default_window_sys, "tty"); - resuming = pcmain(argc, argv); - moveloop(resuming); + resuming = mingw_main(argc, argv); nethack_exit(EXIT_SUCCESS); /*NOTREACHED*/ return 0; diff --git a/win/X11/winX.c b/win/X11/winX.c index 7337e6f04..09d5c7a50 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -1962,6 +1962,7 @@ boolean complain; wp->title = dupstr(str); wp->menu_information->permi = FALSE; + wp->menu_information->disable_mcolors = TRUE; (void) X11_select_menu(newwin, PICK_NONE, &menu_list); X11_destroy_nhwindow(newwin); } diff --git a/win/X11/winmenu.c b/win/X11/winmenu.c index 04d75e77f..7ac8d2491 100644 --- a/win/X11/winmenu.c +++ b/win/X11/winmenu.c @@ -1162,7 +1162,7 @@ struct menu *curr_menu; XtSetArg(args[num_args], nhStr(XtNborderWidth), 0); num_args++; XtSetArg(args[num_args], nhStr(XtNvertDistance), 0); num_args++; - if (!iflags.use_menu_color + if (!iflags.use_menu_color || wp->menu_information->disable_mcolors || !get_menu_coloring(curr->str, &color, &attr)) attr = curr->attr; diff --git a/win/X11/wintext.c b/win/X11/wintext.c index ada6a398d..1f743766d 100644 --- a/win/X11/wintext.c +++ b/win/X11/wintext.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintext.c $NHDT-Date: 1450453309 2015/12/18 15:41:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.15 $ */ +/* NetHack 3.6 wintext.c $NHDT-Date: 1543622533 2018/12/01 00:02:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.16 $ */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ @@ -281,11 +281,9 @@ struct xwindow *wp; #endif num_args = 0; - XtSetArg(args[num_args], XtNallowShellResize, True); - num_args++; + XtSetArg(args[num_args], XtNallowShellResize, True), num_args++; XtSetArg(args[num_args], XtNtranslations, - XtParseTranslationTable(text_translations)); - num_args++; + XtParseTranslationTable(text_translations)), num_args++; #ifdef TRANSIENT_TEXT wp->popup = XtCreatePopupShell("text", transientShellWidgetClass, @@ -299,8 +297,9 @@ struct xwindow *wp; XtParseTranslationTable("WM_PROTOCOLS: delete_text()")); num_args = 0; - XtSetArg(args[num_args], XtNallowShellResize, True); - num_args++; + XtSetArg(args[num_args], XtNallowShellResize, True), num_args++; + XtSetArg(args[num_args], XtNtranslations, + XtParseTranslationTable(text_translations)), num_args++; form = XtCreateManagedWidget("form", formWidgetClass, wp->popup, args, num_args); diff --git a/win/curses/cursmain.c b/win/curses/cursmain.c index 8e20a31f8..2412def4b 100644 --- a/win/curses/cursmain.c +++ b/win/curses/cursmain.c @@ -80,6 +80,16 @@ struct window_procs curses_procs = { genl_can_suspend_yes, }; +/* + * Global variables for curses interface + */ + +int term_rows, term_cols; /* size of underlying terminal */ +int orig_cursor; /* Preserve initial cursor state */ +WINDOW *base_term; /* underlying terminal window */ +boolean counting; /* Count window is active */ +WINDOW *mapwin, *statuswin, *messagewin; /* Main windows */ + /* Track if we're performing an update to the permanent window. Needed since we aren't using the normal menu functions to handle the inventory window. */ diff --git a/win/curses/cursmesg.c b/win/curses/cursmesg.c index 69215871a..df45d07b8 100644 --- a/win/curses/cursmesg.c +++ b/win/curses/cursmesg.c @@ -371,12 +371,12 @@ curses_message_win_getline(const char *prompt, char *answer, int buffer) char *tmpstr; /* for free() */ int maxy, maxx; /* linewrap / scroll */ int ch; - WINDOW *win = curses_get_nhwin(MESSAGE_WIN); int border_space = 0; int len = 0; /* of answer string */ boolean border = curses_window_has_border(MESSAGE_WIN); - int orig_cursor = curs_set(0); + + orig_cursor = curs_set(0); curses_get_window_size(MESSAGE_WIN, &height, &width); if (border) { 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/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 + 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 +