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

[XEN PATCH v7 13/51] build: convert binfile use to if_changed


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Tue, 24 Aug 2021 11:50:00 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Ian Jackson" <iwj@xxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 24 Aug 2021 11:01:06 +0000
  • Ironport-hdrordr: A9a23:fCnLzqFyzFcUXqC5pLqEEseALOsnbusQ8zAXPiBKJCC9vPb5qy nOpoV+6faQslwssR4b9uxoVJPvfZq+z+8R3WByB8bAYOCOggLBQL2KhbGI/9SKIVydygcy78 Zdm6gVMqyMMbB55/yKnDVRxbwbsaa6GKPDv5ah8590JzsaDJ2Jd21Ce32m+ksdfnghObMJUK Cyy+BgvDSadXEefq2AdwM4t7iqnayzqHr+CyR2fyIa1A==
  • Ironport-sdr: V5zkhaFj1GJEZ9xLAqK6GdzDCUgaGdMHnS8SzdSXpa8yMjZncY8XGpF+D4eYZRL1gZ9CwaJRof H1UWmZOa221YArykhQGZPUzSgZAGHr1ZuBM2hnnxe2yj1kG694XykysdPrwQ4gmz8RC7kImmbP +KwgegsLA1Fi8GD+p2nX7pgeSBmdXYap3Y+LwD+nTcVjpk6XMVzCSMfT2vfc5SxEmelyBXkvcZ SDQWNcApf8ecc4rk+0lp4he5s+7Db0/kiXf22NPBA1gtIESleU/AitiZN2R0QuYvmp3I4hmTtZ nfTnSDA3/F1KE1NCpVVGbXKh
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This will allow to detect command line changes and allow to regenerate
the file in that case.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---

Notes:
    v7:
    - define $(cmd_binfile) in Rules.mk so we can use the same one in both
      common/ and xsm/flask/

 xen/Rules.mk           | 5 +++++
 xen/common/Makefile    | 5 +++--
 xen/xsm/flask/Makefile | 6 ++++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index c313486ce0f6..f449669475bd 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -57,6 +57,11 @@ cmd_ar = rm -f $@; $(AR) cr $@ $(real-prereqs)
 quiet_cmd_objcopy = OBJCOPY $@
 cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $< $@
 
+# binfile
+# use e.g. $(call if_changed,binfile,binary-file varname)
+quiet_cmd_binfile = BINFILE $@
+cmd_binfile = $(SHELL) $(BASEDIR)/tools/binfile $(BINFILE_FLAGS) $@ $(2)
+
 define gendep
     ifneq ($(1),$(subst /,:,$(1)))
         DEPS += $(dir $(1)).$(notdir $(1)).d
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 54de70d42278..141d7d40d3dc 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -80,8 +80,9 @@ config.gz: $(CONF_FILE)
 
 config_data.o: config.gz
 
-config_data.S: $(BASEDIR)/tools/binfile
-       $(SHELL) $(BASEDIR)/tools/binfile $@ config.gz xen_config_data
+config_data.S: $(BASEDIR)/tools/binfile FORCE
+       $(call if_changed,binfile,config.gz xen_config_data)
+targets += config_data.S
 
 clean::
        rm -f config_data.S config.gz 2>/dev/null
diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index 637159ad8276..f4d4038c01bd 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -35,8 +35,10 @@ $(subst include/,%/,$(AV_H_FILES)): $(AV_H_DEPEND) 
$(mkaccess) FORCE
 obj-bin-$(CONFIG_XSM_FLASK_POLICY) += flask-policy.o
 flask-policy.o: policy.bin
 
-flask-policy.S: $(BASEDIR)/tools/binfile
-       $(SHELL) $(BASEDIR)/tools/binfile -i $@ policy.bin xsm_flask_init_policy
+flask-policy.S: BINFILE_FLAGS := -i
+flask-policy.S: $(BASEDIR)/tools/binfile FORCE
+       $(call if_changed,binfile,policy.bin xsm_flask_init_policy)
+targets += flask-policy.S
 
 FLASK_BUILD_DIR := $(CURDIR)
 POLICY_SRC := $(FLASK_BUILD_DIR)/xenpolicy-$(XEN_FULLVERSION)
-- 
Anthony PERARD




 


Rackspace

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