From 94f26cec62be7f0d766f80f7376ea5e0040948ae Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 17 Apr 2024 12:09:11 -0400 Subject: build: Dont include ${BUILDDIR} in short messages --- Makefile | 2 +- config/config.mk | 6 +++--- config/deps.mk | 2 +- config/flags.mk | 2 +- config/pkg.mk | 7 +++++-- config/pkgs.mk | 2 +- config/prelude.mk | 3 +++ 7 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index f42c59b..52f3aee 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ ${BIN}/bfs: ${LIBBFS} ${OBJ}/src/main.o ${BINS}: @${MKDIR} ${@D} - +${MSG} "[ LD ] $@" ${CC} ${ALL_LDFLAGS} ${.ALLSRC} ${LDLIBS} -o $@ + +${MSG} "[ LD ] ${TGT}" ${CC} ${ALL_LDFLAGS} ${.ALLSRC} ${LDLIBS} -o $@ ${POSTLINK} # Get the .c file for a .o file diff --git a/config/config.mk b/config/config.mk index 164af76..9d64eec 100644 --- a/config/config.mk +++ b/config/config.mk @@ -16,7 +16,7 @@ MKS := \ # The main configuration file, which includes the others ${CONFIG}: ${MKS} - ${MSG} "[ GEN] $@" + ${MSG} "[ GEN] ${TGT}" @printf '# %s\n' "$@" >$@ @printf 'include $${GEN}/%s\n' ${.ALLSRC:${GEN}/%=%} >>$@ ${VCAT} ${CONFIG} @@ -25,7 +25,7 @@ ${CONFIG}: ${MKS} # Saves the configurable variables ${GEN}/vars.mk:: @${MKDIR} ${@D} - ${MSG} "[ GEN] $@" + ${MSG} "[ GEN] ${TGT}" @printf '# %s\n' "$@" >$@ @printf 'PREFIX := %s\n' "$$XPREFIX" >>$@ @printf 'MANDIR := %s\n' "$$XMANDIR" >>$@ @@ -53,7 +53,7 @@ ${GEN}/deps.mk: ${GEN}/flags.mk # Lists file.o: file.c dependencies ${GEN}/objs.mk:: @${MKDIR} ${@D} - ${MSG} "[ GEN] $@" + ${MSG} "[ GEN] ${TGT}" @printf '# %s\n' "$@" >$@ @for obj in ${OBJS:${OBJ}/%.o=%}; do printf '$${OBJ}/%s.o: %s.c\n' "$$obj" "$$obj"; done >>$@ diff --git a/config/deps.mk b/config/deps.mk index 52ee0e1..ca178de 100644 --- a/config/deps.mk +++ b/config/deps.mk @@ -9,7 +9,7 @@ include ${GEN}/flags.mk include config/exports.mk ${GEN}/deps.mk:: - ${MSG} "[ GEN] $@" + ${MSG} "[ GEN] ${TGT}" printf '# %s\n' "$@" >$@ if config/cc.sh -MD -MP -MF /dev/null config/empty.c; then \ printf 'DEPFLAGS = -MD -MP -MF $${@:.o=.d}\n'; \ diff --git a/config/flags.mk b/config/flags.mk index 2c91691..c9d7913 100644 --- a/config/flags.mk +++ b/config/flags.mk @@ -104,7 +104,7 @@ SETVAR = printf '%s := %s\n' >>$@ APPEND = append() { test -z "$$2" || printf '%s += %s\n' "$$1" "$$2" >>$@; }; append ${GEN}/flags.mk:: - ${MSG} "[ GEN] $@" + ${MSG} "[ GEN] ${TGT}" printf '# %s\n' "$@" >$@ ${SETVAR} CPPFLAGS "$$BFS_CPPFLAGS" ${APPEND} CPPFLAGS "$$TSAN_CPPFLAGS" diff --git a/config/pkg.mk b/config/pkg.mk index 2086555..482ca17 100644 --- a/config/pkg.mk +++ b/config/pkg.mk @@ -8,13 +8,16 @@ include ${GEN}/vars.mk include ${GEN}/flags.mk include config/exports.mk +# Like ${TGT} but for ${TARGET}, not $@ +SHORT = ${TARGET:${BUILDDIR}/%=%} + default:: @printf '# %s\n' "${TARGET}" >${TARGET} config/pkg.sh ${TARGET:${GEN}/%.mk=%} >>${TARGET} 2>${TARGET}.log @if [ "${IS_V}" ]; then \ cat ${TARGET}; \ elif grep -q PKGS ${TARGET}; then \ - printf '[ GEN] %-18s [y]\n' ${TARGET}; \ + printf '[ GEN] %-18s [y]\n' ${SHORT}; \ else \ - printf '[ GEN] %-18s [n]\n' ${TARGET}; \ + printf '[ GEN] %-18s [n]\n' ${SHORT}; \ fi diff --git a/config/pkgs.mk b/config/pkgs.mk index 5ebbaec..de9e16e 100644 --- a/config/pkgs.mk +++ b/config/pkgs.mk @@ -10,7 +10,7 @@ include ${GEN}/pkgs.mk include config/exports.mk ${GEN}/pkgs.mk:: - ${MSG} "[ GEN] $@" + ${MSG} "[ GEN] ${TGT}" config/pkgconf.sh --cflags ${PKGS} >>$@ 2>>$@.log config/pkgconf.sh --ldflags ${PKGS} >>$@ 2>>$@.log config/pkgconf.sh --ldlibs ${PKGS} >>$@ 2>>$@.log diff --git a/config/prelude.mk b/config/prelude.mk index 1d5fb83..2bcb208 100644 --- a/config/prelude.mk +++ b/config/prelude.mk @@ -95,6 +95,9 @@ IS_V := ${TRUTHY,${V}} Q, := @ Q := ${Q,${IS_V}} +# The current target, with ${BUILDDIR} stripped for shorter messages +TGT = ${@:${BUILDDIR}/%=%} + # Show full commands with `make V=1`, otherwise short summaries MSG = @msg() { \ MSG="$$1"; \ -- cgit v1.2.3