aboutsummaryrefslogtreecommitdiffstats
path: root/src/libpostexecseccomp
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-06-23 07:35:19 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-06-30 05:32:07 -0300
commite21637ca82199d9b659f34d71674090e45fc89db (patch)
tree2a0629d8202ee179124ff7466165aa65cd937e22 /src/libpostexecseccomp
parentmakefiles: stop failing when config.mk does not exist (diff)
downloadfirejail-e21637ca82199d9b659f34d71674090e45fc89db.tar.gz
firejail-e21637ca82199d9b659f34d71674090e45fc89db.tar.zst
firejail-e21637ca82199d9b659f34d71674090e45fc89db.zip
makefiles: add generated files as dependencies
With the previous commit ("makefiles: stop failing when config.mk does not exist", 2022-06-23), make will not immediately fail when trying to build a target without having the proper compile-time flags (which are defined on common.mk). For example, when running the command below: make distclean && make It will throw an error only after (mis-)compiling multiple objects. So add a dependency on config.mk on every target that uses output variables (such as @NAME@ / $(NAME)) on its recipe. And add a dependency on config.sh on targets that call shell scripts that use output variables (such as @NAME@ / $NAME). Also, add a recipe for config.mk / config.sh telling to run ./configure, to make it a bit more obvious just in case. With this commit, make will abort earlier, by detecting that the config.mk / config.sh dependency does not exist. This happens before trying to execute the recipe. This also makes the dependencies more accurate, since if config.mk (which defines some CFLAGS) is changed, the CFLAGS may also have changed, so a target that uses CFLAGS should probably be considered out of date in this case anyway. Relates to #5140.
Diffstat (limited to 'src/libpostexecseccomp')
-rw-r--r--src/libpostexecseccomp/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libpostexecseccomp/Makefile b/src/libpostexecseccomp/Makefile
index 14e0cdb1d..5386af58b 100644
--- a/src/libpostexecseccomp/Makefile
+++ b/src/libpostexecseccomp/Makefile
@@ -11,10 +11,10 @@ LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now
11.PHONY: all 11.PHONY: all
12all: libpostexecseccomp.so 12all: libpostexecseccomp.so
13 13
14%.o : %.c $(H_FILE_LIST) ../include/seccomp.h ../include/rundefs.h 14%.o : %.c $(H_FILE_LIST) ../include/seccomp.h ../include/rundefs.h $(ROOT)/config.mk
15 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 15 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
16 16
17libpostexecseccomp.so: $(OBJS) 17libpostexecseccomp.so: $(OBJS) $(ROOT)/config.mk
18 $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl 18 $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl
19 19
20.PHONY: clean 20.PHONY: clean