blob: 4657577f9d0e5958a9618d8d62a7c4df8e6a0a4c [file] [log] [blame]
wdenke2211742002-11-02 23:30:20 +00001#
Wolfgang Denkeca3aeb2013-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 Denkeca3aeb2013-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 Yamada026f9cf2014-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 Denkc4e5f522008-05-03 22:25:00 +020022
Peter Tyser03b70042010-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 Tyser8d1f2682010-04-12 22:28:09 -050025# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
26# CPU-specific code.
27CPUDIR=arch/$(ARCH)/cpu/$(CPU)
28ifneq ($(SRCTREE)/$(CPUDIR),$(wildcard $(SRCTREE)/$(CPUDIR)))
29CPUDIR=arch/$(ARCH)/cpu
30endif
Peter Tyser03b70042010-04-12 22:28:02 -050031
Peter Tyserea0364f2010-04-12 22:28:04 -050032sinclude $(TOPDIR)/arch/$(ARCH)/config.mk # include architecture dependend rules
Peter Tyser03b70042010-04-12 22:28:02 -050033sinclude $(TOPDIR)/$(CPUDIR)/config.mk # include CPU specific rules
34
Wolfgang Denkc4e5f522008-05-03 22:25:00 +020035ifdef SOC
Peter Tyser03b70042010-04-12 22:28:02 -050036sinclude $(TOPDIR)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
Wolfgang Denkc4e5f522008-05-03 22:25:00 +020037endif
Masahiro Yamada33a02da2014-03-03 19:03:17 +090038ifneq ($(BOARD),)
Wolfgang Denkc4e5f522008-05-03 22:25:00 +020039ifdef VENDOR
40BOARDDIR = $(VENDOR)/$(BOARD)
41else
42BOARDDIR = $(BOARD)
43endif
Masahiro Yamada33a02da2014-03-03 19:03:17 +090044endif
Wolfgang Denkc4e5f522008-05-03 22:25:00 +020045ifdef BOARD
46sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules
47endif
48
49#########################################################################
50
Masahiro Yamada026f9cf2014-03-05 16:59:40 +090051RELFLAGS := $(PLATFORM_RELFLAGS)
Scott Wood83b7e2a2011-04-06 13:31:37 +000052
Masahiro Yamada95ddcd62014-02-24 11:12:12 +090053OBJCOPYFLAGS += --gap-fill=0xff
wdenke2211742002-11-02 23:30:20 +000054
Masahiro Yamada026f9cf2014-03-05 16:59:40 +090055PLATFORM_CPPFLAGS += $(RELFLAGS)
56PLATFORM_CPPFLAGS += -pipe
Tom Rini4a30f1e2012-02-20 13:50:10 +000057
Nobuhiro Iwamatsu8aba9dc2011-01-06 10:23:54 +090058LDFLAGS += $(PLATFORM_LDFLAGS)
Haiying Wang6dc1eceb2011-02-22 16:38:05 -050059LDFLAGS_FINAL += -Bstatic
Masahiro Yamada026f9cf2014-03-05 16:59:40 +090060
61export PLATFORM_CPPFLAGS
62export RELFLAGS
63export LDFLAGS_FINAL
64export CONFIG_STANDALONE_LOAD_ADDR