]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
build: always use BASEDIR for xen sub-directory
authorBertrand Marquis <bertrand.marquis@arm.com>
Wed, 7 Oct 2020 14:57:51 +0000 (15:57 +0100)
committerWei Liu <wl@xen.org>
Tue, 13 Oct 2020 14:49:35 +0000 (14:49 +0000)
Modify Makefiles using $(XEN_ROOT)/xen to use $(BASEDIR) instead.

This is removing the dependency to xen subdirectory preventing using a
wrong configuration file when xen subdirectory is duplicated for
compilation tests.

BASEDIR is set in xen/lib/x86/Makefile as this Makefile is directly
called from the tools build and install process and BASEDIR is not set
there.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Liu <wl@xen.org>
xen/common/Makefile
xen/include/xen/lib/x86/Makefile
xen/tools/kconfig/Makefile.kconfig
xen/xsm/flask/Makefile

index b3b60a1ba25bb84c19c731375c06a3d7effa7c65..083f62acb6342bd03bf0d214a8e3c485fbd7d1f4 100644 (file)
@@ -78,14 +78,14 @@ obj-$(CONFIG_UBSAN) += ubsan/
 obj-$(CONFIG_NEEDS_LIBELF) += libelf/
 obj-$(CONFIG_HAS_DEVICE_TREE) += libfdt/
 
-CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(XEN_ROOT)/xen/)$(KCONFIG_CONFIG)
+CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(BASEDIR)/)$(KCONFIG_CONFIG)
 config.gz: $(CONF_FILE)
        gzip -c $< >$@
 
 config_data.o: config.gz
 
-config_data.S: $(XEN_ROOT)/xen/tools/binfile
-       $(SHELL) $(XEN_ROOT)/xen/tools/binfile $@ config.gz xen_config_data
+config_data.S: $(BASEDIR)/tools/binfile
+       $(SHELL) $(BASEDIR)/tools/binfile $@ config.gz xen_config_data
 
 clean::
        rm -f config_data.S config.gz 2>/dev/null
index 408d69c99eccb03fba81aa8e2cf31c9ea07b2edf..c3b9ebe96174dbb58ddb33fe40c50ec12266233c 100644 (file)
@@ -1,8 +1,10 @@
 include $(XEN_ROOT)/Config.mk
 
+BASEDIR = $(XEN_ROOT)/xen
+
 .PHONY: all
 all: cpuid-autogen.h
 
-cpuid-autogen.h: $(XEN_ROOT)/xen/include/public/arch-x86/cpufeatureset.h $(XEN_ROOT)/xen/tools/gen-cpuid.py
-       $(PYTHON) $(XEN_ROOT)/xen/tools/gen-cpuid.py -i $< -o $@.new
+cpuid-autogen.h: $(BASEDIR)/include/public/arch-x86/cpufeatureset.h $(BASEDIR)/tools/gen-cpuid.py
+       $(PYTHON) $(BASEDIR)/tools/gen-cpuid.py -i $< -o $@.new
        $(call move-if-changed,$@.new,$@)
index 065f4b84716f0dc5fc3cda2bc44954f78e2f3d13..799321ec4d0766a024da293f04fe9a15db0ad79b 100644 (file)
@@ -9,7 +9,7 @@ Q :=
 kecho := :
 
 # eventually you'll want to do out of tree builds
-srctree := $(XEN_ROOT)/xen
+srctree := $(BASEDIR)
 objtree := $(srctree)
 src := tools/kconfig
 obj := $(src)
index 50bec20a1e8f25602a97d1643c2ee275975f9ece..637159ad82769b84f5483e0610594fa3dd45e1d3 100644 (file)
@@ -35,8 +35,8 @@ $(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: $(XEN_ROOT)/xen/tools/binfile
-       $(SHELL) $(XEN_ROOT)/xen/tools/binfile -i $@ policy.bin xsm_flask_init_policy
+flask-policy.S: $(BASEDIR)/tools/binfile
+       $(SHELL) $(BASEDIR)/tools/binfile -i $@ policy.bin xsm_flask_init_policy
 
 FLASK_BUILD_DIR := $(CURDIR)
 POLICY_SRC := $(FLASK_BUILD_DIR)/xenpolicy-$(XEN_FULLVERSION)