diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-04-15 12:02:21 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-04-15 12:02:21 -0400 |
commit | eb7dffa166a01240ba50dd23b1f086339b6eb619 (patch) | |
tree | 6a58c109bdb5d3877af16699568c4e1930410388 /Makefile | |
parent | a28b04cfbce8948cb1b216da065a229009a99f01 (diff) | |
download | bfs-eb7dffa166a01240ba50dd23b1f086339b6eb619.tar.xz |
build: Show a nicer error if the user forgets to run make config
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -244,10 +244,17 @@ ${PKG_MKS}: ${GEN}/vars.mk # bfs used to have flag-like targets (`make release`, `make asan ubsan`, etc.). # Direct users to the new configuration system. asan lsan msan tsan ubsan gcov lint release:: - @printf 'error: `make %s` is no longer supported. ' $@ >&2 - @printf 'Use `make config %s=y` instead.\n' $$(echo $@ | tr '[a-z]' '[A-Z]') >&2 + @printf 'error: `%s %s` is no longer supported. ' "${MAKE}" $@ >&2 + @printf 'Use `%s config %s=y` instead.\n' "${MAKE}" $$(echo $@ | tr '[a-z]' '[A-Z]') >&2 @false +# Print an error if `make` is run before `make config` +${CONFIG}:: + @if ! [ -e $@ ]; then \ + printf 'error: You must run `%s config` before `%s`.\n' "${MAKE}" "${MAKE}" >&2; \ + false; \ + fi + ## Build phase (`make`) # The main binary |