Merge branch '2019-10-28-azure-ci-support'
[oweals/u-boot.git] / config.mk
index 05864aabb5a99c92864161b59b2fae3fdbb16a83..caf0dd9b81829bc166b0b88719c977ad2acfce7b 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -1,9 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
 #
 # (C) Copyright 2000-2013
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
 #########################################################################
 
 # This file is included from ./Makefile and spl/Makefile.
@@ -17,17 +15,32 @@ PLATFORM_CPPFLAGS :=
 PLATFORM_LDFLAGS :=
 LDFLAGS :=
 LDFLAGS_FINAL :=
+LDFLAGS_STANDALONE :=
 OBJCOPYFLAGS :=
+# clear VENDOR for tcsh
+VENDOR :=
 #########################################################################
 
+ARCH := $(CONFIG_SYS_ARCH:"%"=%)
+CPU := $(CONFIG_SYS_CPU:"%"=%)
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_TEGRA
+CPU := arm720t
+endif
+endif
+BOARD := $(CONFIG_SYS_BOARD:"%"=%)
+ifneq ($(CONFIG_SYS_VENDOR),)
+VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
+endif
+ifneq ($(CONFIG_SYS_SOC),)
+SOC := $(CONFIG_SYS_SOC:"%"=%)
+endif
+
 # Some architecture config.mk files need to know what CPUDIR is set to,
 # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
 # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
 # CPU-specific code.
-CPUDIR=arch/$(ARCH)/cpu/$(CPU)
-ifneq ($(srctree)/$(CPUDIR),$(wildcard $(srctree)/$(CPUDIR)))
-CPUDIR=arch/$(ARCH)/cpu
-endif
+CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
 
 sinclude $(srctree)/arch/$(ARCH)/config.mk     # include architecture dependend rules
 sinclude $(srctree)/$(CPUDIR)/config.mk                # include  CPU  specific rules
@@ -46,12 +59,14 @@ ifdef       BOARD
 sinclude $(srctree)/board/$(BOARDDIR)/config.mk        # include board specific rules
 endif
 
+ifdef FTRACE
+PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE
+endif
+
 #########################################################################
 
 RELFLAGS := $(PLATFORM_RELFLAGS)
 
-OBJCOPYFLAGS += --gap-fill=0xff
-
 PLATFORM_CPPFLAGS += $(RELFLAGS)
 PLATFORM_CPPFLAGS += -pipe
 
@@ -61,4 +76,5 @@ LDFLAGS_FINAL += -Bstatic
 export PLATFORM_CPPFLAGS
 export RELFLAGS
 export LDFLAGS_FINAL
+export LDFLAGS_STANDALONE
 export CONFIG_STANDALONE_LOAD_ADDR