diff --git a/template/Makefile b/template/Makefile index c888292..264c617 100644 --- a/template/Makefile +++ b/template/Makefile @@ -7,7 +7,7 @@ # make postgen — finalize a freshly generated project (git init) # make clangd — write a local .clangd pointing at the resolved toolchain # make clean — remove build artifacts -# make QUIET=1 — quiet: status lines only, no echoed commands +# make V=1 — show the commands behind the status lines # # This is the build *frontend*: it orchestrates two independent # compilers — clang for the BPF objects, esbuild for the JS bundle. @@ -56,8 +56,8 @@ ESBUILD_FLAGS := --bundle --format=esm --platform=neutral \ --outfile=dist/index.jsx --jsx=automatic --jsx-import-source=yeet:tui bundle: | toolchain - $(call status,Bundling,src/main.jsx) $(Q)$(ESBUILD) src/main.jsx $(ESBUILD_FLAGS) --log-level=warning '--external:yeet:*' '--external:*.bpf.o' + @printf '$(STATUS_FMT)' 'Bundling' "src/main.jsx -> dist/index.jsx ($$(wc -c < dist/index.jsx | awk '{ printf "%.1fkb", $$1 / 1024 }'))" >&2 # Post-generation finalize: initialize a git repository with the vendored git # (fetched via `vendored-git`). Idempotent — skipped if this is already a repo. diff --git a/template/README.md b/template/README.md index 6938f5d..b29f264 100644 --- a/template/README.md +++ b/template/README.md @@ -64,7 +64,7 @@ the `@/` alias; `main.jsx` wires them together and owns input. ```sh make # compile BPF (clang + bpftool) + bundle JS (esbuild) -make QUIET=1 # same, quiet: status lines only, no echoed commands +make V=1 # same, showing every command behind the status lines yeet run . # runs the bundled dist/index.jsx (needs root for BPF) ``` diff --git a/template/build/ui.mk b/template/build/ui.mk index 5b65d62..0408fcb 100644 --- a/template/build/ui.mk +++ b/template/build/ui.mk @@ -5,24 +5,23 @@ # Compiling cpusched.bpf.c # Compiling runqlat.bpf.c # Linking bin/probe.bpf.o -# Bundling src/main.jsx +# Bundling src/main.jsx -> dist/index.jsx (15.5kb) # Finished build in 0.84s # # A bold green verb, right-aligned to 12 columns, then the message — on -# stderr, like cargo, so the build's stdout stays clean for piping. Each -# command is echoed under its status line, so the exact invocation is always -# on screen; `make QUIET=1` hides the commands and keeps only the status lines. -# Color is used only when stderr is a terminal, TERM isn't dumb and +# stderr, like cargo, so the build's stdout stays clean for piping. The +# commands themselves are hidden; `make V=1` echoes each one under its status +# line. Color is used only when stderr is a terminal, TERM isn't dumb and # NO_COLOR (https://no-color.org) is unset. Compiler diagnostics pass through # untouched, so a warning or error is never hidden. # # Included first by the project Makefile, so build/toolchain.mk and # build/bpf.mk can use `$(Q)` and `$(call status,Verb,message)`. -ifeq ($(QUIET),1) - Q := @ -else +ifeq ($(V),1) Q := +else + Q := @ endif COLOR := $(shell [ -t 2 ] && [ -z "$$NO_COLOR" ] && [ "$$TERM" != dumb ] && echo 1)