Commit Graph

1624 Commits

Author SHA1 Message Date
PatR
10359c7bee build fix for unix
Add src/mdlib.[co] to Makefile.src.  Dependencies for mklib.o have
been added manually rather than via 'make depend'.
2019-11-29 15:58:03 -08:00
nhmall
2954608a39 another Windows Makefile bit
Ensure the tools build whether a CROSSCOMPILE_HOST build, or
when there is no CROSSCOMPILE.
2019-11-28 23:36:15 -05:00
nhmall
4b558bf94e yet more Windows Makefile 2019-11-27 22:34:55 -05:00
nhmall
e8f796da24 allow testing of CROSSCOMPILE without cross-compiler using windows Makefile 2019-11-27 22:11:08 -05:00
nhmall
2bfe01d268 remove c files from nethack.tags generation
I noticed that src/sfdata.c and include/sfproto.h come out the same without those c files in the list. Remove them.
2019-11-27 21:28:20 -05:00
nhmall
2492cde10f another lib bit 2019-11-27 13:53:57 -05:00
nhmall
48852b0857 missed a part of vmsbuild.com 2019-11-27 13:48:25 -05:00
nhmall
c1dad9bb25 more lib subfolder updates 2019-11-27 13:19:45 -05:00
nhmall
8af0c59bdb another windows Makefile bit 2019-11-27 07:59:36 -05:00
nhmall
c9d298ee6c Windows mingw Makefile updates 2019-11-27 01:34:53 -05:00
nhmall
503b97960b windows Makefile updates 2019-11-27 01:25:17 -05:00
PatR
865607a392 3.7 Unix Makefiles
Copy lib/lua-$(VERSION)/src/liblua.h to lib/lua/ rather than lib/.

Instead of copying any of the header files or telling the compiler
where to find the lua ones, generate include/nhlua.h on the fly and
restrict the knowledge of where they are to it (paths are relative
to include/).

|/* nhlua.h - generated by top Makefile */
|#include "../lib/lua-5.3.5/src/lua.h"
|LUA_API int   (lua_error) (lua_State *L) NORETURN;
|#include "../lib/lua-5.3.5/src/lualib.h"
|#include "../lib/lua-5.3.5/src/lauxlib.h"
|/*nhlua.h*/

This might need to be redone (or augmented by having CFLAGS add back
'-I path-to-lua') if some compiler can't find '#include "luaconf.h"'
issued by lua.h.
2019-11-26 19:27:00 -08:00
nhmall
2a78011030 instructional doc bit 2019-11-26 19:35:46 -05:00
nhmall
5f75048386 another msdos cross-compile bit 2019-11-26 00:34:57 -05:00
nhmall
36983e6889 more msdos cross-compile fixes
undefined reference to g.variables if certain parts of
drawing.c are included in host-side utilities, so
surround the offending code in
->  #if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
2019-11-26 00:02:38 -05:00
nhmall
7fcccdf5c6 linux-hosted msdos cross-compiler updates 2019-11-25 22:47:54 -05:00
PatR
1b2b330e9f lua reorganization
Reduce the implied reliance of a specific version of lua.

Instead of copying liblua.a to src/, copy it to lib/.  Instead of
telling the compiler to look for headers in lib/lua-5.3.5/src/ as
well as in include/, copy the relevant ones to lib/ and tell the
compiler to look for them there.  'make spotless' in src/ will
remove both the object library and the header files from lib/ but
there really should be a new Makefile.lib to take care of that
directory.

Update Makefile.src to be able to build lua in case someone starts
with 'make all' there instead of in the top Makefile.  It doesn't
duplicate the option to fetch the lua source package though.

NHinternal/../genFiles.c has been updated to mention lib/liblua.a
and lib/lua*.h as 'generated at compile time' in Files and to skip
lib/lua-* entirely if it comes across that (so not operating on a
completely clean tree).  But it won't be accurate unless/until
other ports stage their lua files there instead of in src/ and
lib/lua-$(VERSION)/src/.

I haven't tried 'make depend' to see what it makes of the numerous
changes....
2019-11-25 12:20:42 -08:00
Pasi Kallinen
ddd8b7d9a5 Remove vestiges of quest text data file 2019-11-25 16:30:54 +02:00
nhmall
f10e4218c6 msdos now has its own sysconf as the sys/winnt/sysconf.template had incompatible entries 2019-11-25 00:17:16 -05:00
nhmall
d830f3578a Merge branch 'NetHack-3.7' into paxed-quest-lua 2019-11-24 23:11:30 -05:00
PatR
8f5cca8e3d 3.7 build cleanup
Unix Makefile.utl wasn't aware of the dependency of makedefs.o on
src/mdlib.c so didn't rebuild makedefs when it should have.

Eliminate several warnings:
mdlib.c  - #if inside the arguments to macro Sprintf();
nhlua.c  - nhl_error() ends with a call to lua_error() which doesn't
           return, but neither of them were declared that way;
nhlsel.c - because of the previous, the 'else error' case of
           l_selection_ellipse() led to complaints about uninitialized
	   variables;
sp_lev.c - missing 'const'.

I did minimal testing which went ok, but revisiting a couple of levels
gave me un-freed memory allocated by restore.c line 1337.  (I haven't
looked at that at all.)
2019-11-24 17:56:01 -08:00
nhmall
2bf7731e12 remove a debugging line from msdos-cross-compile.sh 2019-11-24 13:44:53 -05:00
nhmall
541f177408 Merge branch 'paxed-quest-lua' of https://rodney.nethack.org:20040/git/NHsource into paxed-quest-lua 2019-11-24 13:38:32 -05:00
nhmall
c1dd898df6 use curl which is always available on osx rather than wget 2019-11-24 13:37:22 -05:00
Pasi Kallinen
350371e030 Don't remove dungeon.lua with make spotless 2019-11-24 19:39:31 +02:00
nhmall
a9f33df64a more support in cross-compile for the changes in this branch 2019-11-24 12:23:00 -05:00
nhmall
c6fab3aad8 windows and msdos Makefile support of the changes in this branch 2019-11-24 12:01:33 -05:00
Pasi Kallinen
8b87013fba Move quest texts to lua 2019-11-24 17:41:39 +02:00
nhmall
8bc171ec50 more sys/msdos/Makefile?.cross updates 2019-11-23 18:57:17 -05:00
Pasi Kallinen
3afbcb76f5 Minor msdos cross compile improvements 2019-11-23 23:40:25 +02:00
nhmall
69136fbb98 more cross-compile djgpp build tweaks 2019-11-23 12:19:33 -05:00
nhmall
95c1ccd716 another cross-compile script bit 2019-11-23 10:20:18 -05:00
nhmall
ad6ef85177 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2019-11-23 10:15:05 -05:00
nhmall
308ebea68e add some msdos files to .gitignore, produce zip 2019-11-23 10:13:10 -05:00
nhmall
89b315be47 Makefile?.cross bits 2019-11-23 08:49:55 -05:00
nhmall
11678e72f2 fix an error with msdos cross-compiler NetHack packaging 2019-11-23 01:30:54 -05:00
nhmall
1e0c03b3f6 incremental improvements to cross-compiling support in NetHack 3.7
Some support of new code #defines to faciliate cross-compiling:

    OPTIONS_AT_RUNTIME    If this is defined, code to support obtaining
                          the compile time options and features is
                          included. If you define this, you'll also have
                          to compile sys/mdlib.c and link the resulting
                          object file into your game binary/executable.

    CROSSCOMPILE          Flags that this is a cross-compiled NetHack build,
                          where there are two stages:
                          1. makedefs and some other utilities are compiled
                          on the host platform and executed there to generate
                          some output files and header files needed by the
                          game.
                          2. the NetHack game files are compiled by a
                          cross-compiler to generate binary/executables for
                          a different platform than the one the build is
                          being run on. The executables produced for the
                          target platform may not be able to execute on the
                          build platform, except perhaps via a software
                          emulator.

                          The 2-stage process (1. host, 2.target) can be done
                          on the same platform to test the cross-compile
                          process. In that case, the host and target platforms
                          would be the same.

    CROSSCOMPILE_HOST     Separates/identifies code paths that should only be
                          be included in the compile on the host side, for
                          utilities that will be run on the host as part of
                          stage 1 to produce output files needed to build the
                          game. Examples are the code for makedefs, tile
                          conversion utilities, uudecode, dlb, etc.

    CROSSCOMPILE_TARGET   Separates/identifies code paths that should be
                          included on the build for the target platform
                          during stage 2, the cross-compiler stage. That
                          includes most of the pieces of the game itself
                          but the code is only flagged as such if it must
                          not execute on the host.

If you don't define any of those, things should build as before.
One follow-on change that is likely required is setting the new dependency
makedefs has on src/mdlib.c in Makefiles etc.

More information about the changes:

    makedefs

    - splinter off some of makedefs functionality into a separate file
      called src/mdlib.c.
        - src/mdlib.c, while included during the compile of makedefs.c
          for producing the makedefs utility, can also be compiled
          as a stand-alone object file for inclusion in the link step
          of your NetHack game build. The src/mdlib.c code can then
          deliver the same functionality that it provided to makedefs
          right to your NetHack game code at run-time.
          For example, do_runtime_info() will provide the caller with
          the features and options that were built into the game.
          Previously, that information was produced at build time on the
          host and stored in a dat file. Under a cross-compile situation,
          those values are highly suspect and might not even reflect the
          correct options and setting for the cross-compiled target
          platform's binary/executable. The compile of those values and
          the functionality to obtain them needs to move to the target
          cross-compiler stage of the build (stage 2).
        - date information on the target-side binary is produced from
          the cross-compiler preprocessor pre-defined macros __DATE__
          and __TIME__, as they reflect the actual compile time of the
          cross-compiled target and not host-side execution of a utility
          to produce them. The cross-compiler itself, through those
          pre-defined preprocessor macros, provides them to the target
          platform binary/executable. They reflect the actual build
          time of the target binary/executable (not values produced
          at the time the makefiles utility was built and the
          appropriate option selected to store them in a text file.)
        - most Makefiles should not require adding the new file
          src/mdlib.c because util/makedefs.c has a preprocessor
          include "../src/mdlib.c" to draw in its contents. As previously
          stated though, the Makefile dependency may be required:
		makedefs.o: ../util/makedefs.c ../src/mdlib.c
                                               ^^^^^^^^^^^^^^^
2019-11-22 22:35:48 -05:00
nhmall
c9e7182f43 Merge branch 'NetHack-3.6' 2019-11-22 07:46:42 -05:00
nhmall
c8af8e23c1 slash vs backslash Makefile bit 2019-11-22 07:45:43 -05:00
nhmall
fa4552e09e Merge branch 'NetHack-3.6' 2019-11-22 07:41:53 -05:00
nhmall
7af4797671 when decl.h changes, ensure windmain is rebuilt 2019-11-22 07:40:17 -05:00
nhmall
3545374e9c internal self-recover fix and bones name buffers 2019-11-21 23:41:11 -05:00
nhmall
4a8b9ee26c merge fix 2019-11-18 19:21:50 -05:00
nhmall
47fb8e5c0e Merge branch 'NetHack-3.6' 2019-11-18 19:20:55 -05:00
nhmall
893fa4efa8 update nhusage output on Windows 2019-11-18 19:20:03 -05:00
Pasi Kallinen
65ccd1d89e Fix double DLB definition in linux hints file 2019-11-18 09:16:51 +02:00
nhmall
cc5ecbcb56 Merge NetHack-3.6 2019-11-17 00:19:33 -05:00
nhmall
80b90f2b0f Merge branch 'NetHack-3.6' 2019-11-17 00:18:24 -05:00
nhmall
21e4595127 sysconf template for windows 2019-11-17 00:16:02 -05:00
nhmall
5f3398347c Merge branch 'NetHack-3.6' 2019-11-16 23:14:34 -05:00