On 21/11/2025 3:10 pm, Jürgen Groß wrote:
> On 21.11.25 16:03, Andrew Cooper wrote:
>> On 21/11/2025 1:23 pm, Juergen Gross wrote:
>>> Add a new make macro for creating <file> from <file>.in at build
>>> time. To be used like this:
>>>
>>> $(foreach file,$(IN_TARGETS),$(eval $(call apply-build-vars,$(file))))
>>>
>>> This can be used instead of the current approach to perform the similar
>>> step for file.in during ./configure.
>>>
>>> This will avoid having to run ./configure just because of modifying a
>>> file depending on a variable set by configure.
>>>
>>> Prepare to have multiple files as source for the replacement patterns.
>>>
>>> Signed-off-by: Juergen Gross <[email protected]>
>>> ---
>>> V2:
>>> - don't use pattern rule, but create explicit dependency in macro,
>>>    don't require to rename source files (Jan Beulich, Andrew Cooper)
>>> V3:
>>> - prepare for $(PATH_FILES) to be extended by other Makefile
>>> - let generated file depend on $(INC_FILES)
>>> ---
>>>   Config.mk | 13 +++++++++++++
>>>   1 file changed, 13 insertions(+)
>>>
>>> diff --git a/Config.mk b/Config.mk
>>> index e1556dfbfa..39e8007b9c 100644
>>> --- a/Config.mk
>>> +++ b/Config.mk
>>> @@ -159,6 +159,19 @@ define move-if-changed
>>>       if ! cmp -s $(1) $(2); then mv -f $(1) $(2); else rm -f $(1); fi
>>>   endef
>>>   +PATH_FILES := Paths
>>> +INC_FILES = $(foreach f, $(PATH_FILES), $(XEN_ROOT)/config/$(f).mk)
>>> +
>>> +include $(INC_FILES)
>>> +
>>> +BUILD_MAKE_VARS = $(foreach f, $(PATH_FILES), $(shell awk '$$2 ==
>>> ":=" { print $$1; }' $(XEN_ROOT)/config/$(f).mk.in))
>>
>> Everything else in the series is looking fine now.  But why is
>> PATH_FILES dropping the .mk extension from the file?
>>
>> It looks weird for both INC_FILES and BUILD_MAKE_VARS to have to
>> re-insert it.
>
> Hmm, right.
>
> Let me change that.

If it's only that, I could fix up on commit to save another posting.

Whole series, Reviewed-by: Andrew Cooper <[email protected]>

Reply via email to