[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 1/4] build: add make macro for making file from file.in


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Jürgen Groß <jgross@xxxxxxxx>
  • Date: Mon, 24 Nov 2025 15:58:26 +0100
  • Autocrypt: addr=jgross@xxxxxxxx; keydata= xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 24 Nov 2025 14:58:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.11.25 15:30, Jan Beulich wrote:
On 24.11.2025 13:45, Jürgen Groß wrote:
On 24.11.25 13:18, Jan Beulich wrote:
On 24.11.2025 12:27, Juergen Gross wrote:
On 24.11.25 12:15, Jan Beulich wrote:
On 24.11.2025 12:05, Jürgen Groß wrote:
On 24.11.25 11:41, Jan Beulich wrote:
On 21.11.2025 14:23, Juergen Gross wrote:
--- 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))

Feels like my prior comments weren't really addressed. I continue to think that
none of the above is part of what the subject says.

I really don't understand your concern here.

For replacing the @markers@ make needs to know what should be replaced.
So it needs to scan the files containing the markers and gather them.
This is what is done above.

In the final macro below the replacements are done then. How would you
handle that?

By passing (another) argument to the macro, for example. As indicated
earlier, different sub-trees may have different places where these
definitions live, and they would want to be able to pass that in
(ideally without needing to put this in a common part of the tree).

I don't get what you want to pass in additionally.

I've already changed the macro and the Makefiles to be able to add another
marker file to the PATH_FILES variable. What else do you need?

Well, that's simply an odd way of passing a parameter. Plus, the extra file

We do that all the times, e.g. by "OBJ-y += ..."

That's sufficiently different though: Accumulating the set of objects to
produce is kind of naturally done that way.

won't affect INC_FILES, or more precisely its use in the include directive
in patch 1: At least aiui, $(INC_FILES) is expanded at the point when the
directive is processed. Hence why you need to open-code another include
there.

The INC_FILES variable is mostly needed for specifying the dependence of
the generated files on the files mentioned in PATH_FILES.

It might be better to just have "-include $(XEN_ROOT/config/Paths.mk" in
Config.mk, matching the setting of PATH_FILES there.

Looking at this the 3rd or 4th time now, I still don't quite get why the
include is needed in the first place. You don't mean to use (right here)
any of the settings the file produces, do you? Really, as also mentioned
by Andrew, you really can't, because in a pure hypervisor build the file
wouldn't have been made, as no configure would have run.

If I'm not mistaken, you really need those values only at the time you
execute the rule. And I'm worried of these definitions to collide with
something else. Hence one desire would be to limit the scope of these
variables to just the new rule. Maybe something like

# Replace @xxx@ markers in $(1).in with $(xxx) variable contents, write to $(1)
define apply-build-vars
$(1): $$(shell grep -h := $$(wildcard $$(INC_FILES)) /dev/null)
$(1): $(1).in $$(INC_FILES)
        sed $$(foreach v, $$(BUILD_MAKE_VARS), -e 's#@$$(v)@#$$($$(v))#g') <$$< 
>$$@
endef

could work? (This likely depends on INC_FILES to only list files which
are configure generated, i.e. wouldn't be updated by a make rule.)

And who is setting BUILD_MAKE_VARS? You didn't think the snippet doing that
should be there.

And TBH: any setting from Paths.mk colliding with something else would
_really_ be worrying.


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.