diff options
author | Florian Sowade <f.sowade@suora.com> | 2021-02-14 20:07:54 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-16 10:50:03 +0100 |
commit | c4d508c2bc09860bfa15b7f520e0ba68425acfc1 (patch) | |
tree | 16de54fde9783fdc13f86117c3480a5ab5e6a6c5 /build | |
parent | e727919b97c4baeca93cb7700d4adf2e35a3530f (diff) | |
download | php-git-c4d508c2bc09860bfa15b7f520e0ba68425acfc1.tar.gz |
Add dependency tracking for header files
This ensures all .c files which include a header file directly or
indirectly are rebuilt whenever the header file is changed.
Closes GH-6693.
Diffstat (limited to 'build')
-rw-r--r-- | build/Makefile.global | 6 | ||||
-rw-r--r-- | build/php.m4 | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/build/Makefile.global b/build/Makefile.global index ae797408b5..c558c107a7 100644 --- a/build/Makefile.global +++ b/build/Makefile.global @@ -111,7 +111,7 @@ test: all clean: find . -name \*.gcno -o -name \*.gcda | xargs rm -f - find . -name \*.lo -o -name \*.o | xargs rm -f + find . -name \*.lo -o -name \*.o -o -name \*.dep | xargs rm -f find . -name \*.la -o -name \*.a | xargs rm -f find . -name \*.so | xargs rm -f find . -name .libs -a -type d|xargs rm -rf @@ -156,9 +156,5 @@ prof-use: fi; \ fi; -# As we don't track includes, this is just a heuristic -%.c: %_arginfo.h - @touch $@ - .PHONY: all clean install distclean test prof-gen prof-clean prof-use .NOEXPORT: diff --git a/build/php.m4 b/build/php.m4 index 70abfc864c..04651f01e2 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -257,8 +257,12 @@ dnl Choose the right compiler/flags/etc. for the source-file. *.cpp|*.cc|*.cxx[)] ac_comp="$b_cxx_pre $ac_inc $b_cxx_meta $3 -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; esac +dnl Generate Makefiles with dependencies + ac_comp="$ac_comp -MMD -MF $ac_bdir$ac_obj.dep -MT $ac_bdir[$]ac_obj.lo" + dnl Create a rule for the object/source combo. cat >>Makefile.objects<<EOF +-include $ac_bdir[$]ac_obj.dep $ac_bdir[$]ac_obj.lo: $ac_srcdir[$]ac_src $ac_comp EOF |