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

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


  • To: Juergen Gross <jgross@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 14 Nov 2025 11:42:32 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OfES6KGhUAWg8BoCHuMAly8nwfzvpyHrYnRrMe2892U=; b=NCMSNxYdOh6Jlm5e4DcSf2QUSzwtF9R82SL7/2GN9LYi8dsLuld5Kfh/NcRNlOCHt/PnOd8DHuP1TdJI9LE1rwbd3quFR03hwyrHPHKYro/I6H02/9GbeRzmleW4WbePQ0XMhOMfYEkvtmrvau2Ek9qEqJ1WlIaPAUOHgUKhReAKE//UqWy1gV7MpD8jbkO/S1VR2NWmIn/pWak1BUPuI4pCS5WGGwhmzIQslvrpQL3iZHrxwJDWt10Wy+stviwGOqOgViYop+2shI7XSOhmvn3Kuzk4BCeb7kCdGxAidd5LNEtvKEpZI5brE36VNdal6G1kBLTVp2JUT9mxpFGNUA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=krNSqhnWV6dEJcgfzLzTKZaRjW9HNFxkMhPrsYzyFIwd/nZmDYf/4N60/57uj7rVzrAOWcTj3aCaI+kiAdlTSqlZuuYYQAyfzE+aQ63MNKQx5GUimb8WCzdYOeJ+WqRvq4lClFYumbANHkS53LnHeDeLmNmNnUIn5e3Ui2U2zeq8peEAy3Ojy3vLxPmXQ3WKJVhV5y4pQvd0MOmw+RLTHpJy3+C5ZhATaoaJ8l9k2O5xqOEPpvqZ3JMRV5goh6uFJ58+RGVXzYnA1g2tQzG9FlbxjVo74zKrvjAJdfRvupmtPDj/2psy1tBtlFXcTVvv4WMyI6wiq1viPTlm0qUs9w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Fri, 14 Nov 2025 11:42:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14/11/2025 11:32 am, Juergen Gross wrote:
> diff --git a/Config.mk b/Config.mk
> index e1556dfbfa..d21d67945a 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))
> +
> +# Replace @xxx@ markers in $(1).in with $(xxx) variable contents, write to 
> $(1)
> +define apply-build-vars
> + $(1): $(1).in
> +     sed $$(foreach v, $$(BUILD_MAKE_VARS), -e 's#@$$(v)@#$$($$(v))#g') <$$< 
> >$$@
> +endef

Shouldn't this write to a tmp file, and use move-if-changed?  Most of
the time the markers won't have changed, and we'll want to short circuit
dependent rules.

~Andrew



 


Rackspace

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