]> git.ipfire.org Git - thirdparty/u-boot.git/blame - config.mk
Subtree merge tag 'v6.8-dts' of devicetree-rebasing repo [1] into dts/upstream
[thirdparty/u-boot.git] / config.mk
CommitLineData
83d290c5 1# SPDX-License-Identifier: GPL-2.0+
e2211743 2#
eca3aeb3 3# (C) Copyright 2000-2013
e2211743 4# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
e2211743
WD
5#########################################################################
6
026f9cf2
MY
7# This file is included from ./Makefile and spl/Makefile.
8# Clean the state to avoid the same flags added twice.
9#
10# (Tegra needs different flags for SPL.
11# That's the reason why this file must be included from spl/Makefile too.
12# If we did not have Tegra SoCs, build system would be much simpler...)
13PLATFORM_RELFLAGS :=
14PLATFORM_CPPFLAGS :=
026f9cf2 15LDFLAGS_FINAL :=
1d3b97c9 16LDFLAGS_STANDALONE :=
026f9cf2 17OBJCOPYFLAGS :=
5b3ee386
MY
18# clear VENDOR for tcsh
19VENDOR :=
c4e5f52a
WD
20#########################################################################
21
51148790
MY
22ARCH := $(CONFIG_SYS_ARCH:"%"=%)
23CPU := $(CONFIG_SYS_CPU:"%"=%)
e02ee254 24ifdef CONFIG_SPL_BUILD
18138ab2 25ifdef CONFIG_ARCH_TEGRA
e02ee254
MY
26CPU := arm720t
27endif
28endif
51148790
MY
29BOARD := $(CONFIG_SYS_BOARD:"%"=%)
30ifneq ($(CONFIG_SYS_VENDOR),)
31VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
32endif
33ifneq ($(CONFIG_SYS_SOC),)
34SOC := $(CONFIG_SYS_SOC:"%"=%)
35endif
36
03b7004d
PT
37# Some architecture config.mk files need to know what CPUDIR is set to,
38# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
8d1f2682
PT
39# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
40# CPU-specific code.
a8b0f9b6 41CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
03b7004d 42
4379ac61
MY
43sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules
44sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules
03b7004d 45
c4e5f52a 46ifdef SOC
4379ac61 47sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
c4e5f52a 48endif
33a02da0 49ifneq ($(BOARD),)
c4e5f52a
WD
50ifdef VENDOR
51BOARDDIR = $(VENDOR)/$(BOARD)
86b9c3e4 52ENVDIR=${vendor}/env
c4e5f52a
WD
53else
54BOARDDIR = $(BOARD)
86b9c3e4 55ENVDIR=${board}/env
c4e5f52a 56endif
33a02da0 57endif
c4e5f52a 58ifdef BOARD
4379ac61 59sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules
c4e5f52a
WD
60endif
61
b8450521
SG
62ifdef FTRACE
63PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE
64endif
65
c4e5f52a
WD
66#########################################################################
67
026f9cf2 68RELFLAGS := $(PLATFORM_RELFLAGS)
83b7e2a7 69
026f9cf2
MY
70PLATFORM_CPPFLAGS += $(RELFLAGS)
71PLATFORM_CPPFLAGS += -pipe
4a30f1e8 72
6dc1eceb 73LDFLAGS_FINAL += -Bstatic
026f9cf2
MY
74
75export PLATFORM_CPPFLAGS
76export RELFLAGS
77export LDFLAGS_FINAL
1d3b97c9 78export LDFLAGS_STANDALONE
026f9cf2 79export CONFIG_STANDALONE_LOAD_ADDR