aboutsummaryrefslogtreecommitdiffstats
path: root/src/fnettrace
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-07-02 22:19:48 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2024-01-19 11:40:34 -0300
commit5b1bd33c7dc1b96cc27e4e52e8bdfe63268887e9 (patch)
tree9b9920abdf4c4881bf85ae2d08a44ed097f9209b /src/fnettrace
parentmodif: Change errExit msg format to match assert (diff)
downloadfirejail-5b1bd33c7dc1b96cc27e4e52e8bdfe63268887e9.tar.gz
firejail-5b1bd33c7dc1b96cc27e4e52e8bdfe63268887e9.tar.zst
firejail-5b1bd33c7dc1b96cc27e4e52e8bdfe63268887e9.zip
build: use full paths on compile/link targets
This makes the compile commands clearer when building in parallel (with `make -j`) and ensures that `__FILE__` includes the full build-time path (relative to the root of the repository) whenever it is referenced, such as in failed assert() messages (currently the full path is only shown in errExit() messages). Example: Before: firejail: main.c:100: main: Assertion `1 == 2' failed. Error src/firecfg/main.c:100: main: malloc: Cannot allocate memory After: firejail: ../../src/firejail/main.c:100: main: Assertion `1 == 2' failed. Error ../../src/firecfg/main.c:100: main: malloc: Cannot allocate memory Commands used to search and replace: $ git grep -Ilz '^MOD_DIR =' -- '*Makefile' | xargs -0 -I '{}' \ sh -c "printf '%s\n' \"\$(sed -E \ -e 's|^MOD_DIR = src/(.*)|MOD = \\1\\nMOD_DIR = \$(ROOT)/src/\$(MOD)|' \ -e 's:^(PROG|SO) = [^.]+(\.so)?$:\\1 = \$(MOD_DIR)/\$(MOD)\2:' \ '{}')\" >'{}'" $ git grep -Ilz '^HDRS :=' -- '*.mk' | xargs -0 -I '{}' \ sh -c "printf '%s\n' \"\$(sed -E \ -e 's|wildcard (\*\..)|wildcard \$(MOD_DIR)/\\1|' '{}')\" >'{}'" Note: config.mk.in, src/fnettrace/Makefile and src/include/common.h were edited manually. This is a follow-up to #5871.
Diffstat (limited to 'src/fnettrace')
-rw-r--r--src/fnettrace/Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/fnettrace/Makefile b/src/fnettrace/Makefile
index 68a4cbdc0..2ad296d1d 100644
--- a/src/fnettrace/Makefile
+++ b/src/fnettrace/Makefile
@@ -2,12 +2,13 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fnettrace 5MOD = fnettrace
6PROG = fnettrace 6MOD_DIR = $(ROOT)/src/$(MOD)
7PROG = $(MOD_DIR)/$(MOD)
7TARGET = $(PROG) 8TARGET = $(PROG)
8 9
9include $(ROOT)/src/prog.mk 10include $(ROOT)/src/prog.mk
10 11
11all: $(TARGET) static-ip-map 12all: $(TARGET) static-ip-map
12static-ip-map: static-ip-map.txt fnettrace 13static-ip-map: static-ip-map.txt $(PROG)
13 ./fnettrace --squash-map=static-ip-map.txt > static-ip-map 14 ./$(PROG) --squash-map=static-ip-map.txt > static-ip-map