Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions template/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```

Expand Down
15 changes: 7 additions & 8 deletions template/build/ui.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading