Add make android target for Termux APK builds
ober
dfede96297461431e8839655999ff0982667f07b
--- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ TUI_SHIM_DIR := $(CURDIR)/vendor/termbox2 NATIVE_LIB_DIR := $(JERBOA_HOME)/lib LDPATH := $(SHIM_DIR):$(TUI_SHIM_DIR):$(SQLITE_LIB_DIR):$(NATIVE_LIB_DIR) -.PHONY: all help build gen run test clean repl binary install tui-shim run-tui jcode-musl linux linux-check linux-local docker purge-stale sqlite-shim +.PHONY: all help build gen run test clean repl binary install tui-shim run-tui jcode-musl linux linux-check linux-local docker purge-stale sqlite-shim android android-clean all: help @@ -31,6 +31,8 @@ help: @echo " purge-stale Remove stale .so/.wpo files" @echo " sqlite-shim Rebuild chez_sqlite_shim.so" @echo " tui-shim Rebuild jcode_tui_shim" + @echo " android Build Android APK in Termux (android/build/*.apk)" + @echo " android-clean Remove android/build/" # ── Stale-artifact prevention ─────────────────────────────────────────────── # Delete any compiled .so/.wpo whose source .ss/.sls is newer (or whose @@ -163,3 +165,31 @@ clean: find . -name "*.so" -delete find . -name "*.wpo" -delete rm -f jcode jcode-musl jcode-musl.sha256 + +# ── Android APK (thin client, no embedded binary) ─────────────────────────── +# Build from Termux — no Android Studio / Gradle required. +# Requires Termux packages: aapt2 d8 kotlin openjdk-17 apksigner android-tools +# Requires android/android.jar (API 30+) — not checked in. +# +# The APK is a thin GUI client that connects to `jcode serve` over localhost. + +android: + @command -v bash >/dev/null || { echo "bash required"; exit 1; } + @test -f android/android.jar || { \ + echo "Missing android/android.jar (API 30+ platform jar)."; \ + echo "Download one, e.g.:"; \ + echo " curl -L -o android/android.jar https://github.com/Sable/android-platforms/raw/master/android-30/android.jar"; \ + exit 1; } + @for cmd in aapt2 d8 kotlinc keytool apksigner zipalign; do \ + command -v $$cmd >/dev/null || { \ + echo "Missing tool: $$cmd"; \ + echo "Install with: pkg install aapt2 d8 kotlin openjdk-17 apksigner android-tools"; \ + exit 1; }; \ + done + bash android/build-apk.sh + @echo "" + @echo "APK(s) in android/build/:" + @ls -lh android/build/*.apk 2>/dev/null || echo " (none found — check build-apk.sh output above)" + +android-clean: + rm -rf android/build