@@ -14,14 +14,14 @@ config CC_IS_GCC
config GCC_VERSION
int
- default $(shell,$(BASEDIR)/scripts/gcc-version.sh $(CC))
+ default $(shell,$(srctree)/scripts/gcc-version.sh $(CC))
config CC_IS_CLANG
def_bool $(success,$(CC) --version | head -n 1 | grep -q clang)
config CLANG_VERSION
int
- default $(shell,$(BASEDIR)/scripts/clang-version.sh $(CC))
+ default $(shell,$(srctree)/scripts/clang-version.sh $(CC))
# -fvisibility=hidden reduces -fpic cost, if it's available
config CC_HAS_VISIBILITY_ATTRIBUTE
@@ -17,8 +17,7 @@ export XEN_BUILD_HOST ?= $(shell hostname)
PYTHON_INTERPRETER := $(word 1,$(shell which python3 python python2 2>/dev/null) python)
export PYTHON ?= $(PYTHON_INTERPRETER)
-export BASEDIR := $(CURDIR)
-export XEN_ROOT := $(BASEDIR)/..
+export XEN_ROOT := $(CURDIR)/..
srctree := .
objtree := .
@@ -183,7 +182,7 @@ ifeq ($(TARGET_ARCH),x86)
t1 = $(call as-insn,$(CC),".L0: .L1: .skip (.L1 - .L0)",,-no-integrated-as)
# Check whether clang asm()-s support .include.
-t2 = $(call as-insn,$(CC) -I$(BASEDIR)/arch/x86/include,".include \"asm/asm-defns.h\"",,-no-integrated-as)
+t2 = $(call as-insn,$(CC) -I$(srctree)/arch/x86/include,".include \"asm/asm-defns.h\"",,-no-integrated-as)
# Check whether clang keeps .macro-s between asm()-s:
# https://bugs.llvm.org/show_bug.cgi?id=36110
@@ -311,7 +310,7 @@ ALL_OBJS-$(CONFIG_CRYPTO) += crypto/built_in.o
ALL_LIBS-y := lib/lib.a
-include $(BASEDIR)/arch/$(TARGET_ARCH)/arch.mk
+include $(srctree)/arch/$(TARGET_ARCH)/arch.mk
export ALL_OBJS := $(ALL_OBJS-y)
export ALL_LIBS := $(ALL_LIBS-y)
@@ -15,7 +15,7 @@ include $(XEN_ROOT)/Config.mk
# Don't try to remake this file included by Config.mk.
$(XEN_ROOT)/.config: ;
-include $(BASEDIR)/scripts/Kbuild.include
+include $(srctree)/scripts/Kbuild.include
ifndef obj
$(warning kbuild: Rules.mk is included improperly)
@@ -63,7 +63,7 @@ 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)
+cmd_binfile = $(SHELL) $(srctree)/tools/binfile $(BINFILE_FLAGS) $@ $(2)
# Figure out what we need to build from the various variables
# ===========================================================================
@@ -182,7 +182,7 @@ cpp_flags = $(filter-out -Wa$(comma)% -flto,$(1))
c_flags = -MMD -MP -MF $(depfile) $(XEN_CFLAGS)
a_flags = -MMD -MP -MF $(depfile) $(XEN_AFLAGS)
-include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
+include $(srctree)/arch/$(TARGET_ARCH)/Rules.mk
c_flags += $(_c_flags)
a_flags += $(_c_flags)
@@ -80,7 +80,7 @@ $(obj)/config.gz: $(CONF_FILE)
$(obj)/config_data.o: $(obj)/config.gz
-$(obj)/config_data.S: $(BASEDIR)/tools/binfile FORCE
+$(obj)/config_data.S: $(srctree)/tools/binfile FORCE
$(call if_changed,binfile,$(obj)/config.gz xen_config_data)
targets += config_data.S
@@ -6,7 +6,7 @@ OBJCOPYFLAGS := $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s))
obj-y += libfdt.o
nocov-y += libfdt.o
-CFLAGS-y += -I$(BASEDIR)/include/xen/libfdt/
+CFLAGS-y += -I$(srctree)/include/xen/libfdt/
$(obj)/libfdt.o: $(obj)/libfdt-temp.o FORCE
$(call if_changed,objcopy)
@@ -42,22 +42,22 @@ endif
.PHONY: all
all: $(addprefix $(obj)/,$(headers-y))
-$(obj)/compat/%.h: $(obj)/compat/%.i $(src)/Makefile $(BASEDIR)/tools/compat-build-header.py
- $(PYTHON) $(BASEDIR)/tools/compat-build-header.py <$< $(patsubst $(obj)/%,%,$@) >>$@.new; \
+$(obj)/compat/%.h: $(obj)/compat/%.i $(src)/Makefile $(srctree)/tools/compat-build-header.py
+ $(PYTHON) $(srctree)/tools/compat-build-header.py <$< $(patsubst $(obj)/%,%,$@) >>$@.new; \
mv -f $@.new $@
$(obj)/compat/%.i: $(obj)/compat/%.c $(src)/Makefile
$(CPP) $(filter-out -Wa$(comma)% -include %/include/xen/config.h,$(XEN_CFLAGS)) $(cppflags-y) -o $@ $<
-$(obj)/compat/%.c: $(src)/public/%.h $(src)/xlat.lst $(src)/Makefile $(BASEDIR)/tools/compat-build-source.py
+$(obj)/compat/%.c: $(src)/public/%.h $(src)/xlat.lst $(src)/Makefile $(srctree)/tools/compat-build-source.py
mkdir -p $(@D)
- $(PYTHON) $(BASEDIR)/tools/compat-build-source.py $(srctree)/$(src)/xlat.lst <$< >$@.new
+ $(PYTHON) $(srctree)/tools/compat-build-source.py $(srctree)/$(src)/xlat.lst <$< >$@.new
mv -f $@.new $@
-$(obj)/compat/.xlat/%.h: $(obj)/compat/%.h $(obj)/compat/.xlat/%.lst $(BASEDIR)/tools/get-fields.sh $(src)/Makefile
+$(obj)/compat/.xlat/%.h: $(obj)/compat/%.h $(obj)/compat/.xlat/%.lst $(srctree)/tools/get-fields.sh $(src)/Makefile
export PYTHON=$(PYTHON); \
while read what name; do \
- $(SHELL) $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $< || exit $$?; \
+ $(SHELL) $(srctree)/tools/get-fields.sh "$$what" compat_$$name $< || exit $$?; \
done <$(patsubst $(obj)/compat/%,$(obj)/compat/.xlat/%,$(basename $<)).lst >$@.new
mv -f $@.new $@
@@ -93,12 +93,12 @@ cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || e
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
# Usage:
# $(Q)$(MAKE) $(build)=dir
-build := -f $(BASEDIR)/Rules.mk obj
+build := -f $(srctree)/Rules.mk obj
# Shorthand for $(MAKE) clean
# Usage:
# $(MAKE) $(clean) dir
-clean := -f $(BASEDIR)/scripts/Makefile.clean clean -C
+clean := -f $(abs_srctree)/scripts/Makefile.clean clean -C
# echo command.
# Short version is used, if $(quiet) equals `quiet_', otherwise full one.
@@ -40,4 +40,4 @@ $(error-if,$(failure,command -v $(CC)),compiler '$(CC)' not found)
$(error-if,$(failure,command -v $(LD)),linker '$(LD)' not found)
# gcc version including patch level
-gcc-version := $(shell,$(BASEDIR)/scripts/gcc-version.sh $(CC))
+gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh $(CC))
@@ -8,7 +8,7 @@ src := $(obj)
clean::
-include $(BASEDIR)/scripts/Kbuild.include
+include $(abs_srctree)/scripts/Kbuild.include
include $(src)/Makefile
@@ -36,7 +36,7 @@ obj-bin-$(CONFIG_XSM_FLASK_POLICY) += flask-policy.o
$(obj)/flask-policy.o: $(obj)/policy.bin
$(obj)/flask-policy.S: BINFILE_FLAGS := -i
-$(obj)/flask-policy.S: $(BASEDIR)/tools/binfile FORCE
+$(obj)/flask-policy.S: $(srctree)/tools/binfile FORCE
$(call if_changed,binfile,$(obj)/policy.bin xsm_flask_init_policy)
targets += flask-policy.S
$(srctree) is a better description for the source directory than $(BASEDIR) that has been used for both source and build directory (which where the same). "clean" is still changing directory, so we need to use absolute path for it. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> --- xen/Kconfig | 4 ++-- xen/Makefile | 7 +++---- xen/Rules.mk | 6 +++--- xen/common/Makefile | 2 +- xen/common/libfdt/Makefile | 2 +- xen/include/Makefile | 12 ++++++------ xen/scripts/Kbuild.include | 4 ++-- xen/scripts/Kconfig.include | 2 +- xen/scripts/Makefile.clean | 2 +- xen/xsm/flask/Makefile | 2 +- 10 files changed, 21 insertions(+), 22 deletions(-)