From f0ca6fca2ea404977adc5dc8eb429f4741a03bf4 Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Thu, 22 Oct 2009 12:02:37 +0200 Subject: [PATCH] bsd.dep.mk: correctly sequence .depend* and generated sources If depend files are paritioned, we need to make sure that all .depend* files have generated files from SRCS in their sources, otherwise a mkdep might run before all necessary headers have been generated. Noticed-by: swildner@ --- share/mk/bsd.dep.mk | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 39694028e6..20f4931f2e 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -124,8 +124,22 @@ _DEPENDFILES= ${FLAGS_GROUPS:S/^/.depend_/g} ${DEPENDFILE}: ${_DEPENDFILES} +# +# __FLAG_FILES is built from SRCS. That means it will contain +# also .h files and other files that are not direct sources, but which +# might be required to even run mkdep. This is important if those are +# generated as well, like some forwarding headers. +# +# We'll have to pass these "sources" on to the other .depend_ file targets, +# since otherwise they might be run before the generated sources are +# generated. _ALL_DEPENDS captures all files in SRCS that are not handled +# by the mkdep calls, i.e. all sources that are not being used directly +# for the .depend* file. +# +_ALL_DEPENDS=${__FLAGS_FILES:N*.[sS]:N*.c:N*.cc:N*.C:N*.cpp:N*.cpp:N*.cxx:N*.m} + .for _FG in _ ${FLAGS_GROUPS} -.depend${_FG:S/^/_/:N__}: ${${_FG}_FLAGS_FILES} +.depend${_FG:S/^/_/:N__}: ${${_FG}_FLAGS_FILES} ${_ALL_DEPENDS} -rm -f ${.TARGET} -> ${.TARGET} .if ${${_FG}_FLAGS_FILES:M*.[sS]} != "" -- 2.41.0