Add optional feature bundle build target
ober
a2e9ad57b584b7993ad8e1baa84ca402d380baf8
--- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ *.ta6fb /jsh +/jsh-options /jsh-macos /jsh-macos.sha256 /ffi-shim-symbols.list --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ export JSH_VERSION_SHORT JERBOA_VERSION ?= v0.2.0 JERBOA_TOOL_DIR ?= $(CURDIR)/.jerboa/bin +JERBOA_SHELL_EXTRAS_URL ?= https://git.sr.ht/~lisp/jerboa-shell-extras +JERBOA_SHELL_EXTRAS_DIR ?= $(CURDIR)/_vendor/jerboa-shell-extras JERBUILD ?= $(shell if [ -x ./jerbuild ]; then echo ./jerbuild; \ elif [ -x "$(JERBOA_TOOL_DIR)/jerbuild" ]; then echo "$(JERBOA_TOOL_DIR)/jerbuild"; \ elif command -v jerbuild >/dev/null 2>&1; then command -v jerbuild; \ @@ -59,7 +61,7 @@ SH_SPEC := python3 $(CURDIR)/test/run_spec.py BASH := /bin/bash JSH ?= $(if $(filter Darwin,$(UNAME_S)),./jsh-macos,./jsh) -.PHONY: ensure-jerboa-tools jerboa binary jsh jsh-macos macos run security test test-binary test-native \ +.PHONY: ensure-jerboa-tools ensure-shell-extras options jerboa binary jsh jsh-macos macos run security test test-binary test-native \ test-native-sanitize test-security-regressions adversarial-corpus audit \ sbom reproducibility-report timing-evidence verify release-evidence \ compat compat-smoke compat-tier0 compat-tier1 compat-tier2 compat-one compat-range compat-debug \ @@ -74,6 +76,19 @@ ensure-jerboa-tools: sh support/ensure-jerboa.sh "$(JERBOA_VERSION)" "$(JERBOA_TOOL_DIR)"; \ fi +ensure-shell-extras: + @if [ ! -f "$(JERBOA_SHELL_EXTRAS_DIR)/Makefile" ]; then \ + echo "=== Fetching jerboa-shell-extras ==="; \ + mkdir -p "$$(dirname "$(JERBOA_SHELL_EXTRAS_DIR)")"; \ + git clone "$(JERBOA_SHELL_EXTRAS_URL)" "$(JERBOA_SHELL_EXTRAS_DIR)"; \ + fi + +options: ensure-shell-extras + @$(MAKE) -C "$(JERBOA_SHELL_EXTRAS_DIR)" options \ + JERBOA_SHELL_DIR="$(CURDIR)" \ + JSH_EMBED="$(JERBOA_SHELL_EXTRAS_DIR)/embed" \ + OPTIONS_OUTPUT="$(CURDIR)/jsh-options" + ffi-shim-symbols.list: ffi-shim.c tools/extract-ffi-symbols.sh Makefile @echo "=== Regenerating FFI symbol whitelist from ffi-shim.c ===" @tools/extract-ffi-symbols.sh --ffi-shim > $@.tmp && mv $@.tmp $@ @@ -280,6 +295,7 @@ help: @echo "Build:" @echo " make jsh-macos Build the macOS binary" @echo " make jsh Build and copy the native binary to ./jsh" + @echo " make options Select and build optional feature bundles" @echo "" @echo "Test:" @echo " make security Release security metadata and secret scan"