]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
build: remove TARGET_ARCH, a duplicate of SRCARCH
authorAnthony PERARD <anthony.perard@citrix.com>
Wed, 5 Jul 2023 06:29:49 +0000 (08:29 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 5 Jul 2023 06:31:23 +0000 (08:31 +0200)
The same command is used to generate the value of both $(TARGET_ARCH)
and $(SRCARCH), as $(ARCH) is an alias for $(XEN_TARGET_ARCH).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/Makefile
xen/Rules.mk
xen/arch/ppc/arch.mk
xen/arch/riscv/arch.mk
xen/build.mk

index 79b9704e2413c7f7dd964ad30e264ceebd62d752..e8aa66378168afa621e1dc94e616c0a5db1e41a7 100644 (file)
@@ -242,10 +242,6 @@ SRCARCH := $(shell echo $(ARCH) | \
         -e 's/riscv.*/riscv/g' -e 's/ppc.*/ppc/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' -e s'/ppc.*/ppc/g')
-
 export CONFIG_SHELL := $(SHELL)
 export CC CXX LD NM OBJCOPY OBJDUMP ADDR2LINE
 export YACC = $(if $(BISON),$(BISON),bison)
@@ -262,7 +258,7 @@ export XEN_TREEWIDE_CFLAGS := $(CFLAGS)
 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.
@@ -430,22 +426,22 @@ endif
 
 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)
@@ -589,8 +585,8 @@ $(TARGET): outputmakefile FORCE
        $(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 common crypto drivers lib test
index 59072ae8dff2fa85a67bb271438bcbb29dd996bd..8af3dd727729a833a6819b6e376f116098dd3307 100644 (file)
@@ -180,7 +180,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 $(srctree)/arch/$(TARGET_ARCH)/Rules.mk
+include $(srctree)/arch/$(SRCARCH)/Rules.mk
 
 c_flags += $(_c_flags)
 a_flags += $(_c_flags)
index 36830457c695ccd058fcc542044e68071f587425..ec2a6136f4f496ab9593a07b1b4f7c13f5288433 100644 (file)
@@ -8,5 +8,5 @@ CFLAGS += -m64 -mlittle-endian -mcpu=$(ppc-march-y)
 CFLAGS += -mstrict-align -mcmodel=large -mabi=elfv2 -mno-altivec -mno-vsx
 
 # TODO: Drop override when more of the build is working
-override ALL_OBJS-y = arch/$(TARGET_ARCH)/built_in.o
+override ALL_OBJS-y = arch/$(SRCARCH)/built_in.o
 override ALL_LIBS-y =
index 7448f759b44fbfd9ba215eeca3ea53959ec6277e..8403f96b6f0c2820e15956131ba146f0c903a9e3 100644 (file)
@@ -15,5 +15,5 @@ riscv-march-$(CONFIG_RISCV_ISA_C)       := $(riscv-march-y)c
 CFLAGS += -march=$(riscv-march-y) -mstrict-align -mcmodel=medany
 
 # TODO: Drop override when more of the build is working
-override ALL_OBJS-y = arch/$(TARGET_ARCH)/built_in.o
+override ALL_OBJS-y = arch/$(SRCARCH)/built_in.o
 override ALL_LIBS-y =
index 7e33e710fd50403d401a801c65fbf697206901f9..26dd5a8e87788b5f0a5dcca6c4d2aeeb197f0e34 100644 (file)
@@ -41,11 +41,11 @@ include/xen/compile.h: include/xen/compile.h.in .banner FORCE
 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."; \
@@ -87,4 +87,4 @@ endif
 targets += prelink.o
 
 $(TARGET): prelink.o FORCE
-       $(Q)$(MAKE) $(build)=arch/$(TARGET_ARCH) $@
+       $(Q)$(MAKE) $(build)=arch/$(SRCARCH) $@