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

Re: [PATCH] build: generic top-level rule to build individual files


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 29 Mar 2022 12:57:58 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=TkLfro1CJu6ToFG8jn144yBomXoh2rvoLRQZDuHg4eI=; b=YrCSQ0nZg6rBOtc/rHZsM4sDF4XekBRfekVXm9AAwbgTlVcWKTzkL3ETf/Pbo7q9ptDZF2x6HDONGMkZo5u8LRMXMMl4uJsSLyAQk/OujjsepA4l8PFCll5bEeFCH9UKvt27voSHNQiPitWpnrf5cigSYnkjcWnUZW+o70jNNmtMJ3E+NqTtnBy9PLC3c4Ccm6LNKXu9ocPqYWrXnfIpNtJn9/Q5Q4nx6jPb/L6euAcCJ7C5noDTWvFfC7fS2qs1sjuWtFOiIyVLLlAg+naruSsXVjO7YOwSBTr1pBLY2+SM0PXCK85PfAH4WdZWCSJg9qUjWfsNdR9LOBQbQzJ0xQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MreXbRjbkYMDaUoh9nOie1DJxPxAfXWxOCzHjHbYxZclULi/+q5cK8tBKkW7UAuinCNQFmYI21q5CjR5ksPcoWXSlukyeWTxzLeVxQXpzyu//RBB5fWvChkTARnxsrnmQqnRIdLFsyg/ZXUB+ZIsbKfzzW4RKMH4qKmmxBgB7nqfg7ZlCVEsxNPKdZU8WgyHvdzHOdoAwPrV9jTnnw8g6OpwlEM7XlLTp5686w+Io+m1yNlzNxV5hsPEbLsaiPeXQHs8M0/jmELpIh0DaXAoz1CuWd7/9v8xSASjChL3EPlbSR9Tw2PKFzsIVmAHnNo8JBPamOEVbbu6kA15kt+66g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 29 Mar 2022 10:58:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 29.03.2022 12:28, Anthony PERARD wrote:
> On Mon, Mar 28, 2022 at 09:41:26AM +0200, Jan Beulich wrote:
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -75,6 +75,13 @@ ifeq (x86_64,$(XEN_TARGET_ARCH))
>>      XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom pv-grub-if-enabled
>>  endif
>>  
>> +define do-subtree
>> +$(1)/%: FORCE
>> +    $$(MAKE) -C $(1) $$*
>> +endef
>> +
>> +$(foreach m,$(wildcard */Makefile),$(eval $(call do-subtree,$(patsubst 
>> %/Makefile,%,$(m)))))
> 
> Any reason to not use $(SUBSYSTEMS) instead of $(wildcard ) ? Or maybe
> you would rather been able to run `make xen/foo/bar.o` even after
> running `./configure --disable-xen`.

This particular case I don't care about as much, but I think it is
helpful if any subtree which has a Makefile can be recursed into
this way. That way if someone hooks other trees (xtf, mini-os) into
the tree, they're as accessible. As would be subtrees which aren't
subsystems by which still have a Makefile (such may or may not
appear).

>> @@ -334,3 +341,6 @@ uninstall: uninstall-tools-public-header
>>  .PHONY: xenversion
>>  xenversion:
>>      @$(MAKE) --no-print-directory -C xen xenversion
>> +
>> +PHONY += FORCE
> 
> That's a Kbuild construct which will not work here. You need to write
> ".PHONY: FORCE" instead.
> 
> In Kbuild, there's a ".PHONY: $(PHONY)", and various macros needs to
> know what's .PHONY.

Oh, right - thanks for pointing out. I should have really noticed by
looking at context in the file ...

> With at least the .PHONY business taking care of: Reviewed-by: Anthony PERARD 
> <anthony.perard@xxxxxxxxxx>

Thanks.

Jan




 


Rackspace

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