2 # (C) Copyright 2000-2013
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 # SPDX-License-Identifier: GPL-2.0+
7 #########################################################################
9 # This file is included from ./Makefile and spl/Makefile.
10 # Clean the state to avoid the same flags added twice.
12 # (Tegra needs different flags for SPL.
13 # That's the reason why this file must be included from spl/Makefile too.
14 # If we did not have Tegra SoCs, build system would be much simpler...)
21 # clear VENDOR for tcsh
23 #########################################################################
25 ARCH
:= $(CONFIG_SYS_ARCH
:"%"=%)
26 CPU
:= $(CONFIG_SYS_CPU
:"%"=%)
27 BOARD
:= $(CONFIG_SYS_BOARD
:"%"=%)
28 ifneq ($(CONFIG_SYS_VENDOR
),)
29 VENDOR
:= $(CONFIG_SYS_VENDOR
:"%"=%)
31 ifneq ($(CONFIG_SYS_SOC
),)
32 SOC
:= $(CONFIG_SYS_SOC
:"%"=%)
35 # Some architecture config.mk files need to know what CPUDIR is set to,
36 # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
37 # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
39 CPUDIR
=arch
/$(ARCH
)/cpu
$(if
$(CPU
),/$(CPU
),)
41 sinclude
$(srctree
)/arch
/$(ARCH
)/config.mk
# include architecture dependend rules
42 sinclude
$(srctree
)/$(CPUDIR
)/config.mk
# include CPU specific rules
45 sinclude
$(srctree
)/$(CPUDIR
)/$(SOC
)/config.mk
# include SoC specific rules
49 BOARDDIR
= $(VENDOR
)/$(BOARD
)
55 sinclude
$(srctree
)/board
/$(BOARDDIR
)/config.mk
# include board specific rules
59 PLATFORM_CPPFLAGS
+= -finstrument-functions
-DFTRACE
62 # Allow use of stdint.h if available
63 ifneq ($(USE_STDINT
),)
64 PLATFORM_CPPFLAGS
+= -DCONFIG_USE_STDINT
67 #########################################################################
69 RELFLAGS
:= $(PLATFORM_RELFLAGS
)
71 OBJCOPYFLAGS
+= --gap-fill
=0xff
73 PLATFORM_CPPFLAGS
+= $(RELFLAGS
)
74 PLATFORM_CPPFLAGS
+= -pipe
76 LDFLAGS
+= $(PLATFORM_LDFLAGS
)
77 LDFLAGS_FINAL
+= -Bstatic
79 export PLATFORM_CPPFLAGS
82 export CONFIG_STANDALONE_LOAD_ADDR