Commit d6005ed1 authored by Christopher Covington's avatar Christopher Covington Committed by Pavel Emelyanov

Use SRCARCH internally

ARCH is a user-facing variable and setting it on the command line
clobbers any manipulation attempted in the makefile. Following
the example of the Linux kernel makefiles, use a SRCARCH variable
instead for the internal, potentially fixed-up, architecture name.
This fixes the following error.

make ARCH=x86_64
Makefile:69: *** "The architecture x86_64 isn't supported".  Stop.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 89bb170a
......@@ -46,20 +46,19 @@ ARCH ?= $(shell uname -m | sed \
-e s/sh[234].*/sh/)
ifeq ($(ARCH),i386)
ARCH := x86-32
SRCARCH := x86-32
DEFINES := -DCONFIG_X86_32
endif
ifeq ($(ARCH),x86_64)
ARCH := x86
SRCARCH := x86
DEFINES := -DCONFIG_X86_64
LDARCH := i386:x86-64
endif
ifeq ($(shell echo $(ARCH) | sed -e 's/arm.*/arm/'),arm)
ARMV := $(shell echo $(ARCH) | sed -r -e 's/armv([[:digit:]]).*/\1/')
ARCH := arm
SRCARCH := arm
DEFINES := -DCONFIG_ARM -DCONFIG_ARMV$(ARMV)
LDARCH := arm
ifeq ($(ARMV),6)
CFLAGS += -march=armv6
......@@ -70,10 +69,10 @@ ifeq ($(shell echo $(ARCH) | sed -e 's/arm.*/arm/'),arm)
endif
endif
LDARCH ?= $(ARCH)
LDARCH ?= $(SRCARCH)
SRC_DIR ?= $(CURDIR)
ARCH_DIR := arch/$(ARCH)
ARCH_DIR := arch/$(SRCARCH)
$(if $(wildcard $(ARCH_DIR)),,$(error "The architecture $(ARCH) isn't supported"))
......
......@@ -9,15 +9,17 @@ ARCH ?= $(shell uname -m | sed \
-e s/mips.*/mips/ \
-e s/sh[234].*/sh/)
SRCARCH := $(ARCH)
ifeq ($(ARCH),i386)
ARCH := x86
SRCARCH := x86
endif
ifeq ($(ARCH),x86_64)
ARCH := x86
SRCARCH := x86
endif
CPPFLAGS += -iquote $(LIBDIR)/arch/$(ARCH)/include
CPPFLAGS += -iquote $(LIBDIR)/arch/$(SRCARCH)/include
ifeq ($(strip $(V)),)
E = @echo
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment