Commit Graph

2121 Commits

Author SHA1 Message Date
nhmall
8ca0ce4b12 Makefile.gcc follow-up
Errors in the CI after dependency update
2021-09-14 23:39:22 -04:00
nhmall
3a5ba5a81a msdos Makefile.gcc dependency update
Copy the recently updated dependencies from sys/unix/Makefile.src
over to sys/msdos/Makefile.gcc.
2021-09-14 12:48:42 -04:00
nhmall
db9059f735 Windows Makefile.gcc dependency update
Copy the recently updated dependencies from sys/unix/Makefile.src
over to sys/windows/Makefile.gcc.
2021-09-14 12:36:29 -04:00
nhmall
ef1af7c951 Windows Makefile.msc dependency update
Copy the recently updated dependencies from sys/unix/Makefile.src
over to sys/windows/Makefile.msc.
2021-09-14 10:25:49 -04:00
PatR
84b4eb9888 Unix 'make depend'
I recently changed a comment in objclass.h and that should have
triggered a full or nearly full rebuild but only resulted in a
couple of files being recompiled.  Instead of trying to figure out
why, I just ran Makefile.src through 'make depend' to force it to
be up to date.

A side-effect is that version.c won't be unnecessarily recompiled
every time nethack gets relinked.  The reason for that (date.h
being regenerated with new data) is handled by date.c now.
2021-09-14 02:06:14 -07:00
nhmall
15ec24a524 windows visual studio project build tweaks 2021-09-13 11:32:59 -04:00
nhmall
a772751745 build failure detected in CI
The build in the CI was failing after commits today due to this error:
prob error for class 4 (28%)

It was caused by running
	makedefs -o

Remove unnecessary invocation of makedefs with outdated options from
aftermakedefs.proj
2021-08-28 23:10:49 -04:00
nhmall
6ffa912359 missed dependency 2021-08-23 22:18:55 -04:00
nhmall
61ed041c9e Windows VS build failure if DLB wasn't defined 2021-08-22 19:25:13 -04:00
nhmall
f785026006 remove test bit 2021-08-21 22:51:39 -04:00
nhmall
1c270ea31b build issue without DLB defined 2021-08-21 22:47:55 -04:00
nhmall
12f8be6452 more visual studio build tweaks 2021-08-21 15:53:21 -04:00
nhmall
d1e49d7d67 follow-up build fixes for Windows 2021-08-21 15:48:40 -04:00
nhmall
9bb96322a8 compile NetHack-3.7 without makedefs-generated .h files
This evolves and hopefully eases the game-build requirements by
removing game-compile dependencies on any header files generated
by the makedefs utility, including:

date.h dependency and its inclusion is removed and comparable functionality
is produced at runtime via new file src/date.c.

pm.h dependency and its inclusion is removed and comparable functionality is
produced by moving the monster definitions from monst.c into new header
file called monsters.h and altering them slightly. The former pm.h header
file #define PM_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.

onames.h dependency and	its inclusion is removed and comparable functionality
is produced by moving the object definitions from objects.c into new header
file called objects.h and altering them slightly. The former onames.h header
file #define values are now replaced with appropriate emitted enum entries
during the compiler preprocessing.

artilist.h has been slightly altered, and the former onames.h artifact-related
header file #define ART_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.

makedefs can still produce date.h (makedefs -v), pm.h (makedefs -p), and
onames.h (makedefs -o) for reference purposes. They won't be used during
the compiler.

The other uses for makedefs remain. They are used to prepare external
file content that the game utilizes, not prerequisite code for the
compile:
    makedefs -d    (database)
    makedefs -r    (rumors)
    makedefs -h    (oracles)
    makedefs -s    (epitaphs, engravings, bogusmons)

date.c

Pull the code for date/time stamping from mdlib.c into date.c.
Set date.o to be dependent on source files, header files, and .o files
so that date.o is rebuilt from date.c when any of those changes, thus
ensuring an accurate date/time stamp. It also includes git sha
functionality formerly done by makedefs writing #define directives
into include/date.h. For unix it passes the git info on
the compile line for date.c (via sys/unix/hints/linux.2020, macOS.2020)

nethack --dumpenums (optional, but on by default)

Allow developer to obtain some internal enum values from NetHack
without having to resort to an external utility such as
makedefs.

Uncomment #define NODUMPENUMS in config.h to disable this.

The updates to sys/windows/Makefile.gcc have not been tested yet.
2021-08-21 07:59:18 -04:00
nhmall
29aca6276e fix some VS warnings that recently appeared
..\src\explode.c(884): warning C4028: formal parameter 1 different from declaration

  That one stems from commit 6b60618e0e.
  Adjust the prototype in include/extern.h to match the function definition in
  src/explode.c

  Also, a recent update to the Microsoft Visual Studio 2019 causes the
  compiler to complain while compiling a vendor c++ header (string) if
  warning C4774 is enabled.

  We force that warning to be enabled during the Makefile build, even though
  it is not enabled by default.

  Only do so in the Makefile.msc for c source files, and not for c++
  (sys/share/cppregex.cpp).

  See below for an example of the compiler complaint.

  cppregex.cpp
  C:\Program Files (x86)\Microsoft Visual
  Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\string(530):
  warning C4774: '_scprintf' : format string expected in argument 1 is
  not a string literal
  C:\Program Files (x86)\Microsoft Visual
  Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\string(530):
  note: e.g. instead of printf(name); use printf("%s", name); because
  format specifiers in 'name' may pose a security issue
  C:\Program Files (x86)\Microsoft Visual
  Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\string(530):
  note: consider using constexpr specifier for named string literals
  C:\Program Files (x86)\Microsoft Visual
  Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\string(583):
  note: see reference to function template instantiation 'std::string
  std::_Floating_to_string<float>(const char *,_Ty)' being compiled
          with
	[
	   _Ty=float
	]
2021-08-14 15:36:54 -04:00
nhmall
2baadd6a29 header files sym.h and defsym.h
There were multiple symbol-related lists that had to be kept
in sync in various places.

Consolidate some of that into a single new file
    defsym.h
with a set of morphing macros that can be custom-called from
the various places that use the sym info without maintaining
multiple occurrences. Most maintenance can be done there.

Rename monsym.h to sym.h since it looks after some
symbols not related to monsters now too.

The defsym.h header file is included in multiple places to
produce different code depending on its use and the controlling
macro definitions in place prior to including it.

Its purpose is to have a definitive source for
pchar, objclass and mon symbol maintenance.

The controlling macros used to morph the resulting code are
used in these places:
  - in include/sym.h for enums of some S_ symbol values
    (define PCHAR_ENUM, MONSYMS_ENUM prior to #include defsym.h)
  - in include/objclass.h for enums of some S_ symbol values
    (define OBJCLASS_ENUM prior to #include defsym.h)
  - in src/symbols.c for parsing S_ entries in config files
    (define PCHAR_PARSE, MONSYMS_PARSE, OBJCLASS_PARSE prior
    to #include defsym.h)
  - in src/drawing.c for initializing some data structures/arrays
    (define PCHAR_DRAWING, MONSYMS_DRAWING, OBJCLASS_DRAWING prior
    to #include defsym.h)
  - in win/share/tilemap.c for processing a tile file
    (define PCHAR_TILES prior to #include defsym.h).
2021-08-10 13:35:25 -04:00
nhmall
e16b98b61d NetHackW before and after tile additions
The NetHackW.res file wasn't being forced to be rebuilt if
the tiles were changed as they were recently.

Fix the Makefile.msc dependency so that it is.
Also have 'nmake clean' clear the generated *.res files.
2021-08-04 15:48:17 -04:00
PatR
9c71b7dc4a Unix 'make clean' bit
When deleting obsolete generated files (monstr.c, vis_tab.[ch])
for src 'make clean' or clean called from src 'make spotless' or
from top Makefile, don't complain if they aren't present.

Deletion failure wasn't stopping 'make' but did result in looking
like something might be wrong.
Before:
 rm monstr.c vis_tab.c ../include/vis_tab.h  #obsolete generated files
 rm: monstr.c: No such file or directory
 rm: vis_tab.c: No such file or directory
 rm: ../include/vis_tab.h: No such file or directory
 make[1]: [clean] Error 1 (ignored)
After:
 rm -f monstr.c vis_tab.c ../include/vis_tab.h #obsolete generated files
(no extra feedback from rm or make).
2021-07-22 08:32:25 -07:00
nhmall
bed1645f5b Guidebook.txt to July 21, 2021 current (retry) 2021-07-21 14:58:06 -04:00
nhmall
cd87283ba4 recognize vs2019 16.10.4 in sys/windows/Makefile.msc 2021-07-21 11:23:10 -04:00
Pasi Kallinen
29a8153170 Add a new bigroom variant "boulder maze" 2021-07-09 18:18:31 +03:00
nhmall
216c26aaef do vs2017 warnings.h a little differently than vs2019
fixes #545
2021-07-07 09:05:22 -04:00
nhmall
ca7b1d5df0 another nhsetup.bat tweak 2021-06-08 14:15:36 -04:00
nhmall
e6d9e6be0b no need to check vs version in nhsetup.bat 2021-06-08 13:56:02 -04:00
nhmall
0305a14a27 windows substitution error in gcc Makefile 2021-06-04 21:46:03 -04:00
nhmall
7439c8b060 windsys.c name tidbit 2021-06-04 08:51:42 -04:00
nhmall
631e80c47a msdos Install.dos tidbit 2021-06-04 08:49:20 -04:00
nhmall
80d3178d25 windows doc update tidbit 2021-06-04 00:24:46 -04:00
nhmall
254c6c55f5 Windows build warning and Makefile update
.\hack.c(2657): warning C4389: '!=': signed/unsigned mismatch
Visual Studio autodetection update for Makefile.msc
2021-06-04 00:14:37 -04:00
nhmall
91ab71f0f9 windows and visual studio follow-up bit 2021-06-03 23:43:32 -04:00
nhmall
0a10bd632d change references from winnt to windows
rename sys/winnt to sys/windows
move vs (visual studio) folder out of win/win32 and into sys/windows
rename include/ntconf.h to include/windconf.h
rename winnt.c to windsys.c
place visual studio projects into individual subfolders.

This will hopefully resolve GitHub issue #484 as well.
2021-06-03 23:26:00 -04:00
PatR
acfbf20958 unix/Makefile.top fetch-Lua bit
% make spotless
% sh sys/unix/setup.sh sys/unix/hints/macOS.2020
% make fetch-Lua

worked, but the last ended with

|rm include/nhlua.h
|rm: include/nhlua.h: No such file or directory
|make: [fetch-Lua] Error 1 (ignored)

which might frighten skittish users (like me).  Check whether the
constructed header file exists (so is assumed to be for an earlier
Lua version) and only delete it in that case.  No more scary report
of benign failure when it isn't there (after 'make spotless' or for
brand new source setup).

Also, some time ago we came to the conclusion that 'if [ ]' was an
extension for GNU 'bash' and wouldn't work with some older actual
'sh' implementations.  This replaces the one post-3.6 instance of
|if [ ! -d foo ] then bar; fi
in Makefile.top with
|if test -d foo; then true; else bar; fi
Testing was successful but done with bash rather than an old sh. :-}
2021-06-02 17:13:56 -07:00
nhmall
5c95603a82 Makefile command echo suppression 2021-06-02 19:21:37 -04:00
nhmall
e69808987e support for build with current Lua version 5.4.3
On some platforms this may require:
	make spotless
	make fetch-lua

I did attempt to force a reminder message about the latter to
Makefile.top this time, and hope that works correctly for everyone.
2021-06-02 19:12:47 -04:00
PatR
0cdb91aa50 Unix 'make update'
Revise Makefile.top to remove the obsolete commands which change
the last modified date of save and bones files during 'make update'.
Using file dates to validate save files against nethack hasn't been
useful for many years.

Also, update assorted comments.
2021-05-23 18:14:13 -07:00
Pasi Kallinen
29868036f1 Lua: nhcore script with function callbacks
Adds possible callbacks for "start_new_game", "restore_old_game",
"moveloop_turn", and "game_exit" which when defined, will be called
from core code at the appropriate time.

Adds lua hooks for dump_fmtstr (only if DUMPLOG), dnum_name, u.moves,
u.uhave_amulet, and u.depth.
2021-05-21 21:24:59 +03:00
nhmall
49c008fcee Windows nmake build - recognize VS 16.8.5 2021-02-20 11:53:17 -05:00
nhmall
c4d9ceda9d Windows sys/winnt/Makefile.msc update 2021-02-05 19:54:15 -05:00
nhmall
30bb6525b2 add -Wdeprecated-copy if clang and clang >= 9 2021-02-05 16:28:09 -05:00
nhmall
d344e61da1 typo fix 2021-02-05 10:03:18 -05:00
nhmall
5003a0578c sync some macOS hints changes to linux hints 2021-02-05 09:51:07 -05:00
nhmall
769b8877fc separate the C compiler flags and C++ compiler flags where needed 2021-02-05 09:45:03 -05:00
nhmall
f8785792bd potential fix for the macOS issue encountered
Some build flags were unintentionally overlooked in a previous change
2021-02-05 09:38:35 -05:00
nhmall
d714eca924 roll back a Makefile.src change due to macOS issue afterwards
Requires further investigation
2021-02-05 07:43:51 -05:00
nhmall
b14c47132f more cross-compile warning bits
maximize warnings for NetHack sources
minimize warnings for Lua and pdcurses which we won't be changing
2021-02-04 19:42:07 -05:00
nhmall
c87b556f42 more msdos cross-compile pdcurses warning suppression 2021-02-04 18:53:18 -05:00
nhmall
fd970e58a2 warnings in cross-compile of pdcurses are not desired 2021-02-04 18:41:07 -05:00
nhmall
4380b4e3e4 progress detail in the CI log file is too verbose 2021-02-04 18:04:11 -05:00
nhmall
91558e5ce9 another duplicate entry in Xcode project file 2021-02-03 22:04:15 -05:00
nhmall
b00677223d remove a duplicate entry in Xcode project file 2021-02-03 22:03:04 -05:00