From a98a651d7926fcbbe02ebdfef25ffb55ea34224d Mon Sep 17 00:00:00 2001 From: rillig Date: Wed, 9 Dec 2020 08:15:45 +0000 Subject: [PATCH] make(1): split the -j -n test into separate targets The manual page says that in -j mode when the shell does not have ErrCtl (and none of the default shells has that), the command prefix '-' "affects the entire job", but this seems to be wrong. At least, there is no change in the output from before, when all commands had been in the same target. --- usr.bin/make/unit-tests/opt-jobs-no-action.mk | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/usr.bin/make/unit-tests/opt-jobs-no-action.mk b/usr.bin/make/unit-tests/opt-jobs-no-action.mk index 82f19906d61a..93e1122a29db 100644 --- a/usr.bin/make/unit-tests/opt-jobs-no-action.mk +++ b/usr.bin/make/unit-tests/opt-jobs-no-action.mk @@ -1,4 +1,4 @@ -# $NetBSD: opt-jobs-no-action.mk,v 1.4 2020/12/09 07:57:52 rillig Exp $ +# $NetBSD: opt-jobs-no-action.mk,v 1.5 2020/12/09 08:15:45 rillig Exp $ # # Tests for the combination of the options -j and -n, which prints the # commands instead of actually running them. @@ -74,16 +74,26 @@ ALWAYS.yes= + IGNERR.no= echo running IGNERR.yes= -echo running; false # -combined: - @+echo 'begin $@' +combined: combined-begin + +combined-begin: .PHONY + @+echo 'begin combined' @+echo + .for silent in no yes . for always in no yes . for ignerr in no yes +. for target in combined-silent-${silent}-always-${always}-ignerr-${ignerr} +combined: .WAIT ${target} .WAIT +${target}: .PHONY @+echo silent=${silent} always=${always} ignerr=${ignerr} ${SILENT.${silent}}${ALWAYS.${always}}${IGNERR.${ignerr}} @+echo +. endfor . endfor . endfor .endfor - @+echo 'end $@' + +combined: combined-end +combined-end: .PHONY + @+echo 'end combined'