aboutsummaryrefslogtreecommitdiffstats
path: root/src/firecfg
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/firecfg
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/firecfg')
-rw-r--r--src/firecfg/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/firecfg/Makefile b/src/firecfg/Makefile
index c06bb5338..3b0daed71 100644
--- a/src/firecfg/Makefile
+++ b/src/firecfg/Makefile
@@ -4,10 +4,10 @@ all: firecfg
4ROOT = ../.. 4ROOT = ../..
5include $(ROOT)/src/common.mk 5include $(ROOT)/src/common.mk
6 6
7%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/euid_common.h ../include/libnetlink.h ../include/firejail_user.h ../include/pid.h 7%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/euid_common.h ../include/libnetlink.h ../include/firejail_user.h ../include/pid.h $(ROOT)/config.mk
8 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@ 8 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
9 9
10firecfg: $(OBJS) ../lib/common.o ../lib/firejail_user.o 10firecfg: $(OBJS) ../lib/common.o ../lib/firejail_user.o $(ROOT)/config.mk
11 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o ../lib/firejail_user.o $(LIBS) $(EXTRA_LDFLAGS) 11 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o ../lib/firejail_user.o $(LIBS) $(EXTRA_LDFLAGS)
12 12
13.PHONY: clean 13.PHONY: clean