Files
nethack/sys/lib/test/run.sh
Adam Powers dc2d757399 libnethack pr385
roll parts of pr385 into source tree

This does not take the PR as is.

Unlike the PR, this streamlines and minimizes the integration somewhat:

- use hints/include mechanism instead of creating alternative
  Makefile.dat, Makefile.src, Makefile.top, Makefile.utl in sys/lib;
  those would have been a maintenance nightmare.

- don't have alternative mkmkfile.sh and setup.sh in sys/lib.

- sys/lib/libnethackmain.c differed from sys/unix/unixmain.c by
  very little, so just place a small bit of conditional code at the
  top of sys/unix/unixmain.c instead.

- changed the conditional code bits from __EMSCRIPTEN__ to
  CROSS_TO_WASM.

- You should be able to build the wasm result by:
    cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
    make fetch-lua    (<-one time)
    make WANT_LIBNH all

- You should be able to build LIBNBH by:
    cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
    make fetch-lua    (<-one time)
    make CROSS_TO_WASM=1 all

As it is currently coded, winshim.c requires C99.
2020-10-04 14:46:32 -04:00

42 lines
700 B
Bash
Executable File

#!/bin/bash -x
if [ x$1 == "xlib" ]; then
echo Doing lib...
make spotless
cd sys/lib
./setup.sh hints/macOS.2020
cd ../..
make
fi
if [ x$1 == "xrunlib" ]; then
LIBS="-Lsrc -lnethack -Llib/lua -llua -lm"
BADLIBS="-lncurses"
rm nhlibtest
gcc -o nhlibtest libtest.c $LIBS $BADLIBS
./nhlibtest
fi
if [ x$1 == "xwasm" ]; then
echo Doing wasm...
make spotless
cd sys/lib
./setup.sh hints/wasm
cd ../..
make
fi
if [ x$1 == "xrunwasm" ]; then
cd sys/lib/npm-package && node test/test.js
fi
if [ x$1 == "xbin" ]; then
echo Doing bin...
make spotless
cd sys/unix
./setup.sh hints/macOS.2020
cd ../..
make
fi