diff --git a/Makefile b/Makefile index 4f29a0885d2..727a97be958 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/|$$//'; }