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

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


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 28 Mar 2022 09:41:26 +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=ntH+YI2glGh1hhQvbnS5boURGCiH0lvIpdbNClN8A1A=; b=RYOds1lGy+iv+7RhiISgSjUhPdJiscAE1a015df5cV5MoT4RwrGCcJjiM7Xx/7atoG6EcVNeuoSKYUwmgzjddSPniYs2PMCf6nfR9TX9bC3iAJZbAJ47A5zAf4hl2fHuD52reCmAR5HkrBTMm6e7zVaNYsvVmCzDqHP/QPfX7ehQRRsbeEUht0Hd0brTzZFx/CaiU4R+rtIg3jT8T4qj9C0BTvhZ7HaS9bf+q5apWVH938sTQXqabOOu+mSTrHB070tSsfZVZGfIr/VIEwVTyMb+jDk2sm7gCvq2XAHHZR9ZWDQH3KLvE/jh0LhQdeGJmxnb1cjui7udRHD/gi2IPQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TJpFsfZUL6+yy+rVfore7w0ElgTrsC1w0CWy5D0Xv2NBO1aW1stEcBJ3bbXkfNxhda4SLFW688Zq8d8ZUuddwz4KJ8Q+jmFLkvEhmoHc8jtWnu57MKZ9wprnIa+IBBarCXiYkgh+0ugShXF5oS6B4VqCYyWXCLADELU9Tl9DzRiY6KgmjrR163fglINKmP1MTjYscGJh0ya4hcQkir39D2L2l9tGGCLdXkCG0oIbu9AaM3WJNMJyxVL67TsDTqFH9Ktd7gfuu6kXU7aF/zaeYeaokuYl79v+3boD+KY3jTSVI/OPGQ4vMO4peorubJ6aG/JchqnOkUi0kbHC/2g7gw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Mon, 28 Mar 2022 07:41:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

In particular when cross-compiling or having in place other tool chain
overrides, invoking make to build individual files (e.g. object,
preprocessed, or assembly ones) so far involves putting the various
overrides on the command line instead of simply getting them from
./.config.

Furthermore this helps working around a yet unaddressed make quirk [1]:
Variables put on the command line are invisible to $(shell ...), unless
invoked from a recursive make: During the recursive invocation such
variables are put in the recursive make's environment and hence become
"visible".

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

[1] https://savannah.gnu.org/bugs/?10593

--- 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)))))
+
 .PHONY: build-docs
 build-docs:
        $(MAKE) -C docs build
@@ -334,3 +341,6 @@ uninstall: uninstall-tools-public-header
 .PHONY: xenversion
 xenversion:
        @$(MAKE) --no-print-directory -C xen xenversion
+
+PHONY += FORCE
+FORCE:




 


Rackspace

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