@@ -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
@@ -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
@@ -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)
This will allow to detect command line changes and allow to regenerate the file in that case. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> --- 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(-)