From c619f13ea0335d5f4debc6fb16900043e87fb04a Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Sat, 12 Aug 2023 02:58:34 -0300 Subject: build: print syntax list generation Relates to #5627. --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index c0b8e1daa..84fa5597a 100644 --- a/Makefile +++ b/Makefile @@ -104,15 +104,18 @@ syntax: $(SYNTAX_FILES) # TODO: include/rlimit are false positives contrib/syntax/lists/profile_commands_arg0.list: src/firejail/profile.c Makefile + @printf 'Generating %s from %s\n' $@ $< @sed -En 's/.*strn?cmp\(ptr, "([^ "]*[^ ])".*/\1/p' $< | \ grep -Ev '^(include|rlimit)$$' | sed 's/\./\\./' | LC_ALL=C sort -u >$@ # TODO: private-lib is special-cased in the code and doesn't match the regex contrib/syntax/lists/profile_commands_arg1.list: src/firejail/profile.c Makefile + @printf 'Generating %s from %s\n' $@ $< @{ sed -En 's/.*strn?cmp\(ptr, "([^"]+) ".*/\1/p' $<; echo private-lib; } | \ LC_ALL=C sort -u >$@ contrib/syntax/lists/profile_conditionals.list: src/firejail/profile.c Makefile + @printf 'Generating %s from %s\n' $@ $< @awk -- 'BEGIN {process=0;} /^Cond conditionals\[\] = \{$$/ {process=1;} \ /\t*\{"[^"]+".*/ \ { if (process) {print gensub(/^\t*\{"([^"]+)".*$$/, "\\1", 1);} } \ @@ -120,16 +123,20 @@ contrib/syntax/lists/profile_conditionals.list: src/firejail/profile.c Makefile $< | LC_ALL=C sort -u >$@ contrib/syntax/lists/profile_macros.list: src/firejail/macros.c Makefile + @printf 'Generating %s from %s\n' $@ $< @sed -En 's/.*\$$\{([^}]+)\}.*/\1/p' $< | LC_ALL=C sort -u >$@ contrib/syntax/lists/syscall_groups.list: src/lib/syscall.c Makefile + @printf 'Generating %s from %s\n' $@ $< @sed -En 's/.*"@([^",]+).*/\1/p' $< | LC_ALL=C sort -u >$@ contrib/syntax/lists/syscalls.list: $(SYSCALL_HEADERS) Makefile + @printf 'Generating %s\n' $@ @sed -n 's/{\s\+"\([^"]\+\)",.*},/\1/p' $(SYSCALL_HEADERS) | \ LC_ALL=C sort -u >$@ contrib/syntax/lists/system_errnos.list: src/lib/errno.c Makefile + @printf 'Generating %s from %s\n' $@ $< @sed -En 's/.*"(E[^"]+).*/\1/p' $< | LC_ALL=C sort -u >$@ pipe_fromlf = { tr '\n' '|' | sed 's/|$$//'; } -- cgit v1.2.3-70-g09d2