aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRaef Coles <raef.coles@arm.com>2020-07-16 11:49:26 +0100
committerTamas Ban <tamas.ban@arm.com>2020-07-17 10:24:46 +0000
commit43a28b249eddda73d91c1cbbe3697e6f281e8468 (patch)
tree4ee8fac46db96bb2e2d66e5b7e07ad14b1f1bbad /lib
parentc5781480b8bbc2c3aae494d6e81f37ac12ef21d6 (diff)
downloadtrusted-firmware-m-43a28b249eddda73d91c1cbbe3697e6f281e8468.tar.gz
Build: fix configuration issue with CC312 makefile
Now correctly loads proj.cfg so that the variables are set before any other configuration in makefile.defs Change-Id: I5a4061988ee78d86991b49ad75c582b8d261b7c1 Signed-off-by: Raef Coles <raef.coles@arm.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/ext/cryptocell-312-runtime/host/Makefile.defs71
1 files changed, 33 insertions, 38 deletions
diff --git a/lib/ext/cryptocell-312-runtime/host/Makefile.defs b/lib/ext/cryptocell-312-runtime/host/Makefile.defs
index 857f71f93..14b03b48a 100644
--- a/lib/ext/cryptocell-312-runtime/host/Makefile.defs
+++ b/lib/ext/cryptocell-312-runtime/host/Makefile.defs
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2001-2019, Arm Limited. All rights reserved.
+# Copyright (c) 2001-2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -104,6 +104,16 @@ RELEASE_SCRDIR = $(HOST_PROJ_ROOT)/bin
# DATDIR for data/binary files
RELEASE_DATDIR = $(HOST_PROJ_ROOT)/dat
+################################################
+### Handle project configuration definitions ###
+################################################
+PROJ_CFG_FNAME = proj.cfg
+PROJ_EXT_CFG_FNAME = proj.ext.cfg
+PROJ_CFG_PATH = $(HOST_PROJ_ROOT)/$(PROJ_CFG_FNAME)
+PROJ_EXT_CFG_PATH = $(HOST_PROJ_ROOT)/../$(PROJ_EXT_CFG_FNAME)
+CONFIGS_PATH = src/configs
+PROJ_CONFIGS_DIR = $(HOST_PROJ_ROOT)/$(CONFIGS_PATH)
+
#Test directories
ifeq ($(TEE_OS),freertos)
KERNEL_LIB_DIR := $(KERNEL_DIR)/lib
@@ -127,6 +137,12 @@ endif
#initiate variable to avoid concatinatation at every target level
CFLAGS =
+ifeq ($(ARCH),arm64)
+ # aarch64-linux-gnu-
+ CROSS_COMPILE := $(if $(filter aarch64-%,$(CROSS_COMPILE)),$(CROSS_COMPILE),aarch64-linux-gnu-)
+ ARCH_ENDIAN = LITTLE
+endif
+
# The following statements would be executed only if ARCH is one of the supported ones.
ifeq ($(ARCH),powerpc)
CROSS_COMPILE := ppc_4xx-
@@ -134,6 +150,20 @@ ifeq ($(ARCH),powerpc)
CFLAGS += -isystem /opt/eldk/ppc_4xx/usr/include
endif
+ifeq ($(ARCH),x86win)
+ # Compiling for x86-windows - using MinGW toolchain.
+ CROSS_COMPILE ?= i586-mingw32msvc-
+endif
+
+# subfolder for compilation/generation outcome/objects/binaries
+BUILDDIR = $(PWD)/build-$(CROSS_COMPILE:%-=%)
+
+### proj.cfg exists. Include it to get project configuration definitions ###
+ifeq ($(wildcard $(PROJ_CFG_PATH)),$(PROJ_CFG_PATH))
+include $(PROJ_EXT_CFG_PATH)
+include $(PROJ_CFG_PATH)
+endif
+
ifeq ($(ARCH),arm)
# For android NDK must define -ffreestanding to be able to build with Bionic library, etc.
CFLAGS += $(if $(filter arm-linux-androideabi-,$(CROSS_COMPILE)),-ffreestanding)
@@ -150,9 +180,7 @@ ifeq ($(ARCH),arm)
CFLAGS += -mcmse
CFLAGS += -DARCH_V8M
else
- # For arm-none-eabi assume cortex-m3
- ARM_CPU ?= cortex-m3
- CFLAGS += -mcpu=$(ARM_CPU)
+ $(error unrecognized ARM_CPU "$(ARM_CPU)")
endif
CFLAGS += -mthumb
TEE_OS = no_os
@@ -167,8 +195,7 @@ ifeq ($(ARCH),arm)
CFLAGS += -mfpu=none
CFLAGS += -DARCH_V8M
else
- ARM_CPU ?= cortex-m3
- CFLAGS += -mcpu=$(ARM_CPU)
+ $(error unrecognized ARM_CPU "$(ARM_CPU)")
endif
CFLAGS += --target=arm-arm-none-eabi -mlittle-endian
CFLAGS += -mthumb
@@ -189,21 +216,10 @@ ifeq ($(ARCH),arm)
export ARM_CPU
endif #arm
-ifeq ($(ARCH),arm64)
- # aarch64-linux-gnu-
- CROSS_COMPILE := $(if $(filter aarch64-%,$(CROSS_COMPILE)),$(CROSS_COMPILE),aarch64-linux-gnu-)
- ARCH_ENDIAN = LITTLE
-endif
-
ifneq ($(filter i686 x86 x86win x86_64,$(ARCH)),) # x86* Arch.
ARCH_ENDIAN = LITTLE
endif
-ifeq ($(ARCH),x86win)
- # Compiling for x86-windows - using MinGW toolchain.
- CROSS_COMPILE ?= i586-mingw32msvc-
-endif
-
ifeq ($(filter arm arm-dsm- armcc ,$(CROSS_COMPILE)),$(CROSS_COMPILE))
CC_DEF = 1
CC = armcc
@@ -221,9 +237,6 @@ LD = armlink
AR = armar
endif
-# subfolder for compilation/generation outcome/objects/binaries
-BUILDDIR = $(PWD)/build-$(CROSS_COMPILE:%-=%)
-
# Object file suffix
OBJEXT = .o
@@ -269,17 +282,6 @@ exec_logged_and_echo = $(ECHO) $(1) ; $(exec_logged)
DEPENDENCY_ON_EXISTENCE_OF = $(filter-out $(wildcard $(1)),$(1))
-################################################
-### Handle project configuration definitions ###
-################################################
-
-PROJ_CFG_FNAME = proj.cfg
-PROJ_EXT_CFG_FNAME = proj.ext.cfg
-PROJ_CFG_PATH = $(HOST_PROJ_ROOT)/$(PROJ_CFG_FNAME)
-PROJ_EXT_CFG_PATH = $(HOST_PROJ_ROOT)/../$(PROJ_EXT_CFG_FNAME)
-CONFIGS_PATH = src/configs
-PROJ_CONFIGS_DIR = $(HOST_PROJ_ROOT)/$(CONFIGS_PATH)
-
############ Special rules for project configuration selection ##############
ifneq ($(wildcard $(PROJ_CFG_PATH)),$(PROJ_CFG_PATH)) # No proj.cfg linked
@@ -301,13 +303,6 @@ clrconfig:
.PHONY: all setconfig_% clrconfig
else
-### proj.cfg exists. Include it to get project configuration definitions ###
-
-# The includes order is important here:
-# External configurations in proj.ext.cfg may be overriden by those in host proj.cfg
-include $(PROJ_EXT_CFG_PATH)
-include $(PROJ_CFG_PATH)
-
# default TEE_OS
REE_OS ?= linux
TEE_OS ?= cc_linux