blob: bd74732d48d2bb71aae66aab3f106029bb95698a [file] [log] [blame]
wdenke2211742002-11-02 23:30:20 +00001#
Wolfgang Denk1234ce72013-06-21 10:22:36 +02002# (C) Copyright 2000-2013
wdenke2211742002-11-02 23:30:20 +00003# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
Wolfgang Denk1234ce72013-06-21 10:22:36 +02005# SPDX-License-Identifier: GPL-2.0+
wdenke2211742002-11-02 23:30:20 +00006#
wdenke2211742002-11-02 23:30:20 +00007#########################################################################
8
Masahiro Yamada958fe8f2014-03-05 16:59:40 +09009# This file is included from ./Makefile and spl/Makefile.
10# Clean the state to avoid the same flags added twice.
11#
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...)
15PLATFORM_RELFLAGS :=
16PLATFORM_CPPFLAGS :=
17PLATFORM_LDFLAGS :=
18LDFLAGS :=
19LDFLAGS_FINAL :=
20OBJCOPYFLAGS :=
wdenke2211742002-11-02 23:30:20 +000021#########################################################################
Wolfgang Denk979b4bd2008-05-03 22:25:00 +020022
Peter Tyserd53e8fd2010-04-12 22:28:02 -050023# Some architecture config.mk files need to know what CPUDIR is set to,
24# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
Peter Tyser29514c72010-04-12 22:28:09 -050025# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
26# CPU-specific code.
Masahiro Yamadac5b2a002014-06-24 22:10:52 +090027CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
Peter Tyserd53e8fd2010-04-12 22:28:02 -050028
Masahiro Yamadae7944942014-03-11 11:05:19 +090029sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules
30sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules
Peter Tyserd53e8fd2010-04-12 22:28:02 -050031
Wolfgang Denk979b4bd2008-05-03 22:25:00 +020032ifdef SOC
Masahiro Yamadae7944942014-03-11 11:05:19 +090033sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
Wolfgang Denk979b4bd2008-05-03 22:25:00 +020034endif
Masahiro Yamadab93b2132014-03-03 19:03:17 +090035ifneq ($(BOARD),)
Wolfgang Denk979b4bd2008-05-03 22:25:00 +020036ifdef VENDOR
37BOARDDIR = $(VENDOR)/$(BOARD)
38else
39BOARDDIR = $(BOARD)
40endif
Masahiro Yamadab93b2132014-03-03 19:03:17 +090041endif
Wolfgang Denk979b4bd2008-05-03 22:25:00 +020042ifdef BOARD
Masahiro Yamadae7944942014-03-11 11:05:19 +090043sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules
Wolfgang Denk979b4bd2008-05-03 22:25:00 +020044endif
45
46#########################################################################
47
Masahiro Yamada958fe8f2014-03-05 16:59:40 +090048RELFLAGS := $(PLATFORM_RELFLAGS)
Scott Wood34c6dd22011-04-06 13:31:37 +000049
Masahiro Yamadac9c83ba2014-02-24 11:12:12 +090050OBJCOPYFLAGS += --gap-fill=0xff
wdenke2211742002-11-02 23:30:20 +000051
Masahiro Yamada958fe8f2014-03-05 16:59:40 +090052PLATFORM_CPPFLAGS += $(RELFLAGS)
53PLATFORM_CPPFLAGS += -pipe
Tom Rinib7f34132012-02-20 13:50:10 +000054
Nobuhiro Iwamatsub859b8c2011-01-06 10:23:54 +090055LDFLAGS += $(PLATFORM_LDFLAGS)
Haiying Wang39358732011-02-22 16:38:05 -050056LDFLAGS_FINAL += -Bstatic
Masahiro Yamada958fe8f2014-03-05 16:59:40 +090057
58export PLATFORM_CPPFLAGS
59export RELFLAGS
60export LDFLAGS_FINAL
61export CONFIG_STANDALONE_LOAD_ADDR