Merge branch 'master' of git://git.denx.de/u-boot-tegra
[people/ms/u-boot.git] / config.mk
CommitLineData
e2211743 1#
eca3aeb3 2# (C) Copyright 2000-2013
e2211743
WD
3# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
eca3aeb3 5# SPDX-License-Identifier: GPL-2.0+
e2211743 6#
e2211743
WD
7#########################################################################
8
026f9cf2
MY
9# 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 :=
c4e5f52a
WD
21#########################################################################
22
51148790
MY
23ARCH := $(CONFIG_SYS_ARCH:"%"=%)
24CPU := $(CONFIG_SYS_CPU:"%"=%)
25BOARD := $(CONFIG_SYS_BOARD:"%"=%)
26ifneq ($(CONFIG_SYS_VENDOR),)
27VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
28endif
29ifneq ($(CONFIG_SYS_SOC),)
30SOC := $(CONFIG_SYS_SOC:"%"=%)
31endif
32
03b7004d
PT
33# Some architecture config.mk files need to know what CPUDIR is set to,
34# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
8d1f2682
PT
35# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
36# CPU-specific code.
a8b0f9b6 37CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
03b7004d 38
4379ac61
MY
39sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules
40sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules
03b7004d 41
c4e5f52a 42ifdef SOC
4379ac61 43sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
c4e5f52a 44endif
33a02da0 45ifneq ($(BOARD),)
c4e5f52a
WD
46ifdef VENDOR
47BOARDDIR = $(VENDOR)/$(BOARD)
48else
49BOARDDIR = $(BOARD)
50endif
33a02da0 51endif
c4e5f52a 52ifdef BOARD
4379ac61 53sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules
c4e5f52a
WD
54endif
55
b8450521
SG
56ifdef FTRACE
57PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE
58endif
59
c4e5f52a
WD
60#########################################################################
61
026f9cf2 62RELFLAGS := $(PLATFORM_RELFLAGS)
83b7e2a7 63
95ddcd68 64OBJCOPYFLAGS += --gap-fill=0xff
e2211743 65
026f9cf2
MY
66PLATFORM_CPPFLAGS += $(RELFLAGS)
67PLATFORM_CPPFLAGS += -pipe
4a30f1e8 68
8aba9dce 69LDFLAGS += $(PLATFORM_LDFLAGS)
6dc1eceb 70LDFLAGS_FINAL += -Bstatic
026f9cf2
MY
71
72export PLATFORM_CPPFLAGS
73export RELFLAGS
74export LDFLAGS_FINAL
75export CONFIG_STANDALONE_LOAD_ADDR