Re: [PATCH 2/2] Makefile: adjust sed command for generating "clar-decls.h"
- From
Toon Claes <toon@iotcl.com>
- Date
- Oct 18, 2024, 15:45 UTC
- Message-ID
- <87y12lbeix.fsf@iotcl.com>
- In-Reply-To
- <dda9b8e033c2e32e17dff73cad43211dd355d3ec.1728903464.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 27 quoted lines
> From: Alejandro R. Sedeño <asedeno@mit.edu>
>
> This moves the end-of-line marker out of the captured group, matching
> the start-of-line marker and for some reason fixing generation of
> "clar-decls.h" on some older, more esoteric platforms.
>
> Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index feeed6f9321..0101d349f38 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3905,7 +3905,7 @@ GIT-TEST-SUITES: FORCE
>
> $(UNIT_TEST_DIR)/clar-decls.h: $(patsubst %,$(UNIT_TEST_DIR)/%.c,$(CLAR_TEST_SUITES)) GIT-TEST-SUITES
> $(QUIET_GEN)for suite in $(CLAR_TEST_SUITES); do \
> - sed -ne "s/^\(void test_$${suite}__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)$$\)/extern \1;/p" $(UNIT_TEST_DIR)/$$suite.c; \
> + sed -ne "s/^\(void test_$${suite}__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)\)$$/extern \1;/p" $(UNIT_TEST_DIR)/$$suite.c; \
> done >$@
> $(UNIT_TEST_DIR)/clar.suite: $(UNIT_TEST_DIR)/clar-decls.h
> $(QUIET_GEN)awk -f $(UNIT_TEST_DIR)/clar-generate.awk $< >$(UNIT_TEST_DIR)/clar.suite
> --
> 2.47.0.dirtyYou're most likely aware, but this change needs to move when the patch "Makefile: extract script to generate clar declarations" [1] is merged, because this line then lives in t/unit-tests/generate-clar-decls.sh.
[1]: https://lore.kernel.org/git/7a619677c7af6ba8213a36208e20ab75c4318e38.1728985514.git.ps@pks.im/
-- Toon