Subject: Re: [PATCH 2/2] Makefile: adjust sed command for generating "clar-decls.h"

From: Toon Claes <[email-masked]>
Date: Fri, 18 Oct 2024 17:45:58 +0200

Patrick Steinhardt <[email-masked]> writes:

> From: Alejandro R. Sedeño <[email-masked]>
>
> 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 <[email-masked]>
> Signed-off-by: Patrick Steinhardt <[email-masked]>
> ---
>  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.dirty

You'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/[email-masked]/

-- 
Toon