Something went wrong. Try again.
Something went wrong. Try again.
code-browser Makefile
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253# Dev entry points. `make` (or `make dev`) installs dependencies, builds the# native addon if it's out of date and the guest if it's missing, then runs# the app with hot reload. `make app` builds dist/code-browser.app, ad-hoc# signed, and `make install` copies it to /Applications. Toolchains come from# mise.toml (`mise install`); the guest build also needs Podman.
NATIVE := native/code-browser-vz.nodeGUEST := guest/out/rootfs.erofs
.DEFAULT_GOAL := dev.PHONY: dev build app install typecheck test native guest
dev: node_modules $(NATIVE) | $(GUEST) bun run dev
build: node_modules $(NATIVE) | $(GUEST) bun run build
# A self-contained, ad-hoc signed app bundle (scripts/package-app.sh).app: build scripts/package-app.sh
# Replaces an installed copy; quit code-browser first.install: app rm -rf /Applications/code-browser.app ditto dist/code-browser.app /Applications/code-browser.app @echo "installed /Applications/code-browser.app"
typecheck: node_modules bun run typecheck
test: node_modules bun test src
native: $(NATIVE)
# Rebuild the guest explicitly; dev/build only build it when it's missing.guest: bun run build:guest
# postinstall downloads Electron, names its bundle and ad-hoc signs it with# the VZ entitlement; a change to that script reinstalls too.node_modules: package.json bun.lock scripts/sign-electron-dev.sh bun install @touch $@
$(NATIVE): native/Cargo.toml native/Cargo.lock native/build.rs $(shell find native/src -type f) bun run build:native
# Slow (kernel + rootfs in Podman), so file timestamps don't trigger it.$(GUEST): bun run build:guest