diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-04-30 15:07:06 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-04-30 15:07:06 -0400 |
commit | 1f06941a7cc586c78152ca67dec0551106977b08 (patch) | |
tree | 4ebedfe5ed59fafae32e337eff73758828ff82f7 /build/prelude.mk | |
parent | 37caa3d71fd8bb4d0d9204e4a2f5cac234fa25fd (diff) | |
download | bfs-1f06941a7cc586c78152ca67dec0551106977b08.tar.xz |
build: Listen to make -s
Diffstat (limited to 'build/prelude.mk')
-rw-r--r-- | build/prelude.mk | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/build/prelude.mk b/build/prelude.mk index b235fa9..5be26cb 100644 --- a/build/prelude.mk +++ b/build/prelude.mk @@ -44,33 +44,22 @@ TRUTHY,y := y TRUTHY,1 := y # Boolean operators are also implemented with nested expansion -NOT, := y +NOT, := y # Normalize ${V} to either "y" or "" -IS_V := ${TRUTHY,${V}} +export XV=${TRUTHY,${V}} # Suppress output unless V=1 Q, := @ -Q := ${Q,${IS_V}} +Q := ${Q,${XV}} # Show full commands with `make V=1`, otherwise short summaries -MSG = @msg() { \ - MSG="$$1"; \ - shift; \ - test "${IS_V}" || printf '%s\n' "$$MSG"; \ - test "$${1:-}" || return 0; \ - test "${IS_V}" && printf '%s\n' "$$*"; \ - "$$@"; \ - }; \ - msg - -# Maximum width of a short message, to align the ✔/✘ -MSG_WIDTH := 30 +MSG = @build/msg.sh # cat a file if V=1 VCAT,y := @cat VCAT, := @: -VCAT := ${VCAT,${IS_V}} +VCAT := ${VCAT,${XV}} # All external dependencies ALL_PKGS := \ |