diff options
Diffstat (limited to 'ext/wasm/make-make.sh')
-rwxr-xr-x | ext/wasm/make-make.sh | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/ext/wasm/make-make.sh b/ext/wasm/make-make.sh index e5b81b3d1..6f93d8883 100755 --- a/ext/wasm/make-make.sh +++ b/ext/wasm/make-make.sh @@ -23,7 +23,14 @@ function die(){ SQLITE3_C="${1-../../sqlite3.c}" -echo "# GENERATED makefile code. DO NOT EDIT." +separator='########################################################################' + +cat <<EOF +# GENERATED makefile code. DO NOT EDIT. +# Generated by $0 on $(date) +_GEN_MAKE := \$(lastword \$(MAKEFILE_LIST)) +\$(_GEN_MAKE): ${SQLITE3_C} $0 +EOF if grep sqlite3_activate_see "$SQLITE3_C" &>/dev/null; then echo 'SQLITE_C_IS_SEE := 1' @@ -34,6 +41,7 @@ fi ######################################################################## # Locate the emcc (Emscripten) binary... +echo $separator EMCC_BIN=$(which emcc) if [[ x = "x${EMCC_BIN}" ]]; then if [[ x != "x${EMSDK_HOME}" ]]; then @@ -51,6 +59,7 @@ echo '$(info using emcc version [$(emcc.version)])' ######################################################################### # wasm-strip binary... +echo $separator WASM_STRIP_BIN=$(which wasm-strip 2>/dev/null) echo "wasm-strip ?= ${WASM_STRIP_BIN}" if [[ x = "x${WASM_STRIP_BIN}" ]]; then @@ -71,14 +80,19 @@ ifeq (,\$(filter clean,\$(MAKECMDGOALS)))' \$(info WARNING: sudo apt install wabt) \$(info WARNING: *******************************************************************) endif +ifneq (,\$(filter release snapshot,\$(MAKECMDGOALS))) + \$(error Cannot make release-quality binary because wasm-strip is not available.) +endif EOF else - echo 'maybe-wasm-strip = $(wasm-strip)' +echo 'maybe-wasm-strip = $(wasm-strip)' fi +# /$(wasm-strip) +######################################################################## - -dir_dout=jswasm -dir_tmp=bld -for d in $dir_dout $dir_tmp; do +######################################################################## +# Make necessary dirs. Note that these need to align with their names +# in the main makefile. +for d in jswasm bld; do [ -d $d ] || mkdir -p $d done |