kconfig: Adjust ordering so that defaults work as expected
[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 :=
5b3ee386
MY
21# clear VENDOR for tcsh
22VENDOR :=
c4e5f52a
WD
23#########################################################################
24
51148790
MY
25ARCH := $(CONFIG_SYS_ARCH:"%"=%)
26CPU := $(CONFIG_SYS_CPU:"%"=%)
27BOARD := $(CONFIG_SYS_BOARD:"%"=%)
28ifneq ($(CONFIG_SYS_VENDOR),)
29VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
30endif
31ifneq ($(CONFIG_SYS_SOC),)
32SOC := $(CONFIG_SYS_SOC:"%"=%)
33endif
34
03b7004d
PT
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.
8d1f2682
PT
37# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
38# CPU-specific code.
a8b0f9b6 39CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
03b7004d 40
4379ac61
MY
41sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules
42sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules
03b7004d 43
c4e5f52a 44ifdef SOC
4379ac61 45sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
c4e5f52a 46endif
33a02da0 47ifneq ($(BOARD),)
c4e5f52a
WD
48ifdef VENDOR
49BOARDDIR = $(VENDOR)/$(BOARD)
50else
51BOARDDIR = $(BOARD)
52endif
33a02da0 53endif
c4e5f52a 54ifdef BOARD
4379ac61 55sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules
c4e5f52a
WD
56endif
57
b8450521
SG
58ifdef FTRACE
59PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE
60endif
61
0d296cc2
GB
62# Allow use of stdint.h if available
63ifneq ($(USE_STDINT),)
64PLATFORM_CPPFLAGS += -DCONFIG_USE_STDINT
65endif
66
c4e5f52a
WD
67#########################################################################
68
026f9cf2 69RELFLAGS := $(PLATFORM_RELFLAGS)
83b7e2a7 70
95ddcd68 71OBJCOPYFLAGS += --gap-fill=0xff
e2211743 72
026f9cf2
MY
73PLATFORM_CPPFLAGS += $(RELFLAGS)
74PLATFORM_CPPFLAGS += -pipe
4a30f1e8 75
8aba9dce 76LDFLAGS += $(PLATFORM_LDFLAGS)
6dc1eceb 77LDFLAGS_FINAL += -Bstatic
026f9cf2
MY
78
79export PLATFORM_CPPFLAGS
80export RELFLAGS
81export LDFLAGS_FINAL
82export CONFIG_STANDALONE_LOAD_ADDR