aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-08-12 02:58:34 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-08-12 22:43:46 -0300
commitc619f13ea0335d5f4debc6fb16900043e87fb04a (patch)
tree007dc172163243dd3908d5af1112a46d10814853
parentbuild: add missing makefile dep (diff)
downloadfirejail-c619f13ea0335d5f4debc6fb16900043e87fb04a.tar.gz
firejail-c619f13ea0335d5f4debc6fb16900043e87fb04a.tar.zst
firejail-c619f13ea0335d5f4debc6fb16900043e87fb04a.zip
build: print syntax list generation
Relates to #5627.
-rw-r--r--Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c0b8e1daa..84fa5597a 100644
--- a/Makefile
+++ b/Makefile
@@ -104,15 +104,18 @@ syntax: $(SYNTAX_FILES)
104 104
105# TODO: include/rlimit are false positives 105# TODO: include/rlimit are false positives
106contrib/syntax/lists/profile_commands_arg0.list: src/firejail/profile.c Makefile 106contrib/syntax/lists/profile_commands_arg0.list: src/firejail/profile.c Makefile
107 @printf 'Generating %s from %s\n' $@ $<
107 @sed -En 's/.*strn?cmp\(ptr, "([^ "]*[^ ])".*/\1/p' $< | \ 108 @sed -En 's/.*strn?cmp\(ptr, "([^ "]*[^ ])".*/\1/p' $< | \
108 grep -Ev '^(include|rlimit)$$' | sed 's/\./\\./' | LC_ALL=C sort -u >$@ 109 grep -Ev '^(include|rlimit)$$' | sed 's/\./\\./' | LC_ALL=C sort -u >$@
109 110
110# TODO: private-lib is special-cased in the code and doesn't match the regex 111# TODO: private-lib is special-cased in the code and doesn't match the regex
111contrib/syntax/lists/profile_commands_arg1.list: src/firejail/profile.c Makefile 112contrib/syntax/lists/profile_commands_arg1.list: src/firejail/profile.c Makefile
113 @printf 'Generating %s from %s\n' $@ $<
112 @{ sed -En 's/.*strn?cmp\(ptr, "([^"]+) ".*/\1/p' $<; echo private-lib; } | \ 114 @{ sed -En 's/.*strn?cmp\(ptr, "([^"]+) ".*/\1/p' $<; echo private-lib; } | \
113 LC_ALL=C sort -u >$@ 115 LC_ALL=C sort -u >$@
114 116
115contrib/syntax/lists/profile_conditionals.list: src/firejail/profile.c Makefile 117contrib/syntax/lists/profile_conditionals.list: src/firejail/profile.c Makefile
118 @printf 'Generating %s from %s\n' $@ $<
116 @awk -- 'BEGIN {process=0;} /^Cond conditionals\[\] = \{$$/ {process=1;} \ 119 @awk -- 'BEGIN {process=0;} /^Cond conditionals\[\] = \{$$/ {process=1;} \
117 /\t*\{"[^"]+".*/ \ 120 /\t*\{"[^"]+".*/ \
118 { if (process) {print gensub(/^\t*\{"([^"]+)".*$$/, "\\1", 1);} } \ 121 { if (process) {print gensub(/^\t*\{"([^"]+)".*$$/, "\\1", 1);} } \
@@ -120,16 +123,20 @@ contrib/syntax/lists/profile_conditionals.list: src/firejail/profile.c Makefile
120 $< | LC_ALL=C sort -u >$@ 123 $< | LC_ALL=C sort -u >$@
121 124
122contrib/syntax/lists/profile_macros.list: src/firejail/macros.c Makefile 125contrib/syntax/lists/profile_macros.list: src/firejail/macros.c Makefile
126 @printf 'Generating %s from %s\n' $@ $<
123 @sed -En 's/.*\$$\{([^}]+)\}.*/\1/p' $< | LC_ALL=C sort -u >$@ 127 @sed -En 's/.*\$$\{([^}]+)\}.*/\1/p' $< | LC_ALL=C sort -u >$@
124 128
125contrib/syntax/lists/syscall_groups.list: src/lib/syscall.c Makefile 129contrib/syntax/lists/syscall_groups.list: src/lib/syscall.c Makefile
130 @printf 'Generating %s from %s\n' $@ $<
126 @sed -En 's/.*"@([^",]+).*/\1/p' $< | LC_ALL=C sort -u >$@ 131 @sed -En 's/.*"@([^",]+).*/\1/p' $< | LC_ALL=C sort -u >$@
127 132
128contrib/syntax/lists/syscalls.list: $(SYSCALL_HEADERS) Makefile 133contrib/syntax/lists/syscalls.list: $(SYSCALL_HEADERS) Makefile
134 @printf 'Generating %s\n' $@
129 @sed -n 's/{\s\+"\([^"]\+\)",.*},/\1/p' $(SYSCALL_HEADERS) | \ 135 @sed -n 's/{\s\+"\([^"]\+\)",.*},/\1/p' $(SYSCALL_HEADERS) | \
130 LC_ALL=C sort -u >$@ 136 LC_ALL=C sort -u >$@
131 137
132contrib/syntax/lists/system_errnos.list: src/lib/errno.c Makefile 138contrib/syntax/lists/system_errnos.list: src/lib/errno.c Makefile
139 @printf 'Generating %s from %s\n' $@ $<
133 @sed -En 's/.*"(E[^"]+).*/\1/p' $< | LC_ALL=C sort -u >$@ 140 @sed -En 's/.*"(E[^"]+).*/\1/p' $< | LC_ALL=C sort -u >$@
134 141
135pipe_fromlf = { tr '\n' '|' | sed 's/|$$//'; } 142pipe_fromlf = { tr '\n' '|' | sed 's/|$$//'; }