1
0
Fork 0
forked from len0rd/rockbox

build system: completely autodetect target cpu architecture.

The existing ARCH Makefile variable is exported to the C code as well.
Additionally the version (arm-only for now) is detected as well. This
allows to for complete autodetection, i.e. that optimized ASM is picked up
if determined by preprocessor (CPU_ARM, etc).

Building a sim/raaa on a arm host will now automatically generate a arm
optmized build like we have for native targets.

Change-Id: I0b35393f8fb3ebd20beaa9e7371fa57bf3782107
This commit is contained in:
Thomas Martitz 2012-03-28 22:57:13 +02:00
parent c56950ea3a
commit 7b1a369cf7
10 changed files with 69 additions and 39 deletions

View file

@ -10,8 +10,9 @@
# Collect dummy C files in firmware/asm
ASM_DUMMY_SRC := $(notdir $(call preprocess, $(FIRMDIR)/asm/SOURCES))
ASM_ARCH := $(subst arch_,,$(ARCH)) # strip arch_ prefix from $(ARCH)
# Get the corresponding real source files under firmware/asm/$ARCH (C or ASM)
ASM_C_SRC := $(addprefix $(FIRMDIR)/asm/$(ARCH)/,$(ASM_DUMMY_SRC))
ASM_C_SRC := $(addprefix $(FIRMDIR)/asm/$(ASM_ARCH)/,$(ASM_DUMMY_SRC))
ASM_S_SRC := $(ASM_C_SRC:.c=.S)
# ASM_SRC now contains only files that exist under $ARCH

View file

@ -526,12 +526,12 @@ Lyre prototype 1 */
#ifndef __PCTOOL__
/* define for all cpus from SH family */
#if (CONFIG_CPU == SH7034)
#if (ARCH == ARCH_SH) && (CONFIG_CPU == SH7034)
#define CPU_SH
#endif
/* define for all cpus from coldfire family */
#if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)
#if (ARCH == ARCH_M68K) && ((CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250))
#define CPU_COLDFIRE
#endif
@ -565,31 +565,13 @@ Lyre prototype 1 */
#endif
/* define for all cpus from ARM family */
#if ((CONFIG_PLATFORM & PLATFORM_MAEMO5) && defined(MAEMO_ARM_BUILD)) \
|| (CONFIG_PLATFORM & PLATFORM_PANDORA)
#if ARCH == ARCH_ARM
#define CPU_ARM
#define ARM_ARCH 7 /* ARMv7 */
#elif (CONFIG_CPU == IMX31L) || defined(SAMSUNG_YPR0) \
|| ((CONFIG_PLATFORM & PLATFORM_MAEMO4) && defined(MAEMO_ARM_BUILD))
#define CPU_ARM
#define ARM_ARCH 6 /* ARMv6 */
#elif defined(CPU_TCC77X) || defined(CPU_TCC780X) || (CONFIG_CPU == DM320) \
|| (CONFIG_CPU == AT91SAM9260) || (CONFIG_CPU == AS3525v2) \
|| (CONFIG_CPU == S5L8702) || (CONFIG_CPU == IMX233) \
|| (CONFIG_CPU == RK27XX) ||(CONFIG_PLATFORM & PLATFORM_ANDROID)
#define CPU_ARM
#define ARM_ARCH 5 /* ARMv5 */
#elif defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
|| (CONFIG_CPU == DSC25) || defined(CPU_S5L870X) || (CONFIG_CPU == AS3525)
#define CPU_ARM
#define ARM_ARCH 4 /* ARMv4 */
#define ARM_ARCH ARCH_VERSION /* ARMv{4,5,6,7} */
#endif
#if (CONFIG_CPU == JZ4732)
#define CPU_MIPS 32
#if ARCH == ARCH_MIPS
#define CPU_MIPS ARCH_VERSION /* 32, 64 */
#endif
#endif /*__PCTOOL__*/