]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Build: Fix newlines in build of proto-build.c
authorOndrej Zajicek <santiago@crfreenet.org>
Tue, 10 Dec 2024 13:58:05 +0000 (14:58 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 10 Dec 2024 13:58:05 +0000 (14:58 +0100)
Add newlines to the body of proto-build.c . Use printf instead of echo
for portable handling of backslash sequences.

Thanks to CCX for the change.

nest/Makefile

index ef0fdf6764a746c7dbe1a7e3cdd5951aef941013..c6e172654f282799f6fde054ede97dc2ec7cd69c 100644 (file)
@@ -6,7 +6,7 @@ $(conf-y-targets): $(s)mpls.Y
 
 $(o)proto-build.c: Makefile $(lastword $(MAKEFILE_LIST)) $(objdir)/.dir-stamp
        $(E)echo GEN $@
-       $(Q)echo "$(patsubst %,void %_build(void); ,$(PROTO_BUILD)) void protos_build_gen(void) { $(patsubst %,  %_build(); ,$(PROTO_BUILD))}" > $@
+       $(Q)( P='$(PROTO_BUILD)' && printf "void %s_build(void);\n" $$P && printf "\nvoid\nprotos_build_gen(void)\n{\n" && printf "  %s_build();\n" $$P && printf "}\n" ) > $@
 
 prepare: $(o)proto-build.c