aboutsummaryrefslogtreecommitdiffstats
path: root/.gitignore
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-07-05 23:56:06 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2024-01-22 18:05:47 -0300
commite665769f5225062565b3a75677ce43eb37b988c5 (patch)
treeba46eebf03f497bfa9669c85d10e41fcef946895 /.gitignore
parentbuild: move EXTRA vars directly into targets (diff)
downloadfirejail-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 '.gitignore')
-rw-r--r--.gitignore1
1 files changed, 1 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index fd35dde40..3413abd55 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
1*.d
1*.o 2*.o
2*.so 3*.so
3*~ 4*~