-e 's/riscv.*/riscv/g')
export ARCH SRCARCH
-export TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \
- sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g' \
- -e s'/riscv.*/riscv/g')
-
export CONFIG_SHELL := $(SHELL)
export CC CXX LD NM OBJCOPY OBJDUMP ADDR2LINE
export YACC = $(if $(BISON),$(BISON),bison)
ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
CLANG_FLAGS :=
-ifeq ($(TARGET_ARCH),x86)
+ifeq ($(SRCARCH),x86)
# The tests to select whether the integrated assembler is usable need to happen
# before testing any assembler features, or else the result of the tests would
# be stale if the integrated assembler is not used.
ifdef building_out_of_srctree
CFLAGS += -I$(objtree)/include
- CFLAGS += -I$(objtree)/arch/$(TARGET_ARCH)/include
+ CFLAGS += -I$(objtree)/arch/$(SRCARCH)/include
endif
CFLAGS += -I$(srctree)/include
-CFLAGS += -I$(srctree)/arch/$(TARGET_ARCH)/include
+CFLAGS += -I$(srctree)/arch/$(SRCARCH)/include
# Note that link order matters!
ALL_OBJS-y := common/built_in.o
ALL_OBJS-y += drivers/built_in.o
ALL_OBJS-y += lib/built_in.o
ALL_OBJS-y += xsm/built_in.o
-ALL_OBJS-y += arch/$(TARGET_ARCH)/built_in.o
+ALL_OBJS-y += arch/$(SRCARCH)/built_in.o
ALL_OBJS-$(CONFIG_CRYPTO) += crypto/built_in.o
ALL_LIBS-y := lib/lib.a
-include $(srctree)/arch/$(TARGET_ARCH)/arch.mk
+include $(srctree)/arch/$(SRCARCH)/arch.mk
# define new variables to avoid the ones defined in Config.mk
export XEN_CFLAGS := $(CFLAGS)
$(Q)$(MAKE) $(build)=tools
$(Q)$(MAKE) $(build)=. include/xen/compile.h
$(Q)$(MAKE) $(build)=include all
- $(Q)$(MAKE) $(build)=arch/$(TARGET_ARCH) include
- $(Q)$(MAKE) $(build)=. arch/$(TARGET_ARCH)/include/asm/asm-offsets.h
+ $(Q)$(MAKE) $(build)=arch/$(SRCARCH) include
+ $(Q)$(MAKE) $(build)=. arch/$(SRCARCH)/include/asm/asm-offsets.h
$(Q)$(MAKE) $(build)=. MKRELOC=$(MKRELOC) 'ALL_OBJS=$(ALL_OBJS-y)' 'ALL_LIBS=$(ALL_LIBS-y)' $@
-SUBDIRS = xsm arch/$(TARGET_ARCH) common drivers lib test
+SUBDIRS = xsm arch/$(SRCARCH) common drivers lib test
define all_sources
( find include -type f -name '*.h' -print; \
find $(SUBDIRS) -type f -name '*.[chS]' -print )
targets += include/xen/compile.h
-include $(wildcard .asm-offsets.s.d)
-asm-offsets.s: arch/$(TARGET_ARCH)/$(ARCH)/asm-offsets.c
+asm-offsets.s: arch/$(SRCARCH)/$(ARCH)/asm-offsets.c
$(CC) $(call cpp_flags,$(c_flags)) -S -g0 -o $@.new -MQ $@ $<
$(call move-if-changed,$@.new,$@)
-arch/$(TARGET_ARCH)/include/asm/asm-offsets.h: asm-offsets.s
+arch/$(SRCARCH)/include/asm/asm-offsets.h: asm-offsets.s
@(set -e; \
echo "/*"; \
echo " * DO NOT MODIFY."; \
targets += prelink.o
$(TARGET): prelink.o FORCE
- $(Q)$(MAKE) $(build)=arch/$(TARGET_ARCH) $@
+ $(Q)$(MAKE) $(build)=arch/$(SRCARCH) $@