# Shared by the build scripts of the terminal games (see README.md). Source it after `emcc` is on the PATH: # # . "$here/curses-web/flags.sh" # emcc "${CW_CFLAGS[@]}" -c game.c -o game.o # -I: curses.h, term.h # emcc "${CW_CFLAGS[@]}" -c "$CW_DIR/curses.c" -o curses.o # emcc game.o curses.o "${CW_LDFLAGS[@]}" -o game.js # # Copyright (C) 2026 FredyGames. Distributed under the MIT License (see LICENSE). CW_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CW_CFLAGS=(-O2 -w -I"$CW_DIR") # ASYNCIFY: getch() and napms() wait for the page. EXIT_RUNTIME: the page learns when the game ends. # EMULATE_FUNCTION_POINTER_CASTS: old K&R C calls function pointers with other signatures than the callee's. CW_LDFLAGS=(-O2 -lidbfs.js -sASYNCIFY -sASYNCIFY_STACK_SIZE=65536 -sALLOW_MEMORY_GROWTH=1 -sENVIRONMENT=web -sEXIT_RUNTIME=1 -sEXPORTED_RUNTIME_METHODS=FS,ENV,addRunDependency,removeRunDependency)