diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-07-05 23:56:06 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2024-01-22 18:05:47 -0300 |
commit | e665769f5225062565b3a75677ce43eb37b988c5 (patch) | |
tree | ba46eebf03f497bfa9669c85d10e41fcef946895 /src/fzenity/Makefile | |
parent | build: move EXTRA vars directly into targets (diff) | |
download | firejail-e665769f5225062565b3a75677ce43eb37b988c5.tar.gz firejail-e665769f5225062565b3a75677ce43eb37b988c5.tar.zst firejail-e665769f5225062565b3a75677ce43eb37b988c5.zip |
build: automatically generate header dependencies
Instead of manually specifying which source files depend on which
headers, use compiler flags to automatically generate depfiles (.d),
which declare the correct header (make) dependencies for each source
file (.c).
Use `-MMD` (which ignores system headers) to generate the dependencies
and `-MP` to prevent make from complaining when a header file is removed
while it is listed as a dependency in a depfile.
If depfiles exist, just include them. If not, make each object file
(.o) unconditionally depend on all header files in its source directory
and in src/include, to ensure that rebuilds are done when needed. The
latter case applies to the first build after `make clean` (which would
build everything anyway) and when the compiler does not support
generating depfiles.
Note that both gcc and clang have supported these options for a long
time.
Misc: This depends on the changes from commit 5b1bd33c7 ("build: use
full paths on compile/link targets", 2023-07-02) / PR #6158 to avoid
issues with make dependency tracking.
Diffstat (limited to 'src/fzenity/Makefile')
-rw-r--r-- | src/fzenity/Makefile | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/fzenity/Makefile b/src/fzenity/Makefile index 3c1aa0574..4cebe7ac5 100644 --- a/src/fzenity/Makefile +++ b/src/fzenity/Makefile | |||
@@ -7,6 +7,4 @@ MOD_DIR = $(ROOT)/src/$(MOD) | |||
7 | PROG = $(MOD_DIR)/$(MOD) | 7 | PROG = $(MOD_DIR)/$(MOD) |
8 | TARGET = $(PROG) | 8 | TARGET = $(PROG) |
9 | 9 | ||
10 | EXTRA_HDRS = ../include/common.h | ||
11 | |||
12 | include $(ROOT)/src/prog.mk | 10 | include $(ROOT)/src/prog.mk |