]> git.ipfire.org Git - thirdparty/u-boot.git/blob - config.mk
Merge tag 'v2022.01-rc4' into next
[thirdparty/u-boot.git] / config.mk
1 # SPDX-License-Identifier: GPL-2.0+
2 #
3 # (C) Copyright 2000-2013
4 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 #########################################################################
6
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...)
13 PLATFORM_RELFLAGS :=
14 PLATFORM_CPPFLAGS :=
15 KBUILD_LDFLAGS :=
16 LDFLAGS_FINAL :=
17 LDFLAGS_STANDALONE :=
18 OBJCOPYFLAGS :=
19 # clear VENDOR for tcsh
20 VENDOR :=
21 #########################################################################
22
23 ARCH := $(CONFIG_SYS_ARCH:"%"=%)
24 CPU := $(CONFIG_SYS_CPU:"%"=%)
25 ifdef CONFIG_SPL_BUILD
26 ifdef CONFIG_ARCH_TEGRA
27 CPU := arm720t
28 endif
29 endif
30 BOARD := $(CONFIG_SYS_BOARD:"%"=%)
31 ifneq ($(CONFIG_SYS_VENDOR),)
32 VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
33 endif
34 ifneq ($(CONFIG_SYS_SOC),)
35 SOC := $(CONFIG_SYS_SOC:"%"=%)
36 endif
37
38 # Some architecture config.mk files need to know what CPUDIR is set to,
39 # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
40 # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
41 # CPU-specific code.
42 CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
43
44 sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules
45 sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules
46
47 ifdef SOC
48 sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
49 endif
50 ifneq ($(BOARD),)
51 ifdef VENDOR
52 BOARDDIR = $(VENDOR)/$(BOARD)
53 ENVDIR=${vendor}/env
54 else
55 BOARDDIR = $(BOARD)
56 ENVDIR=${board}/env
57 endif
58 endif
59 ifdef BOARD
60 sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules
61 endif
62
63 ifdef FTRACE
64 PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE
65 endif
66
67 #########################################################################
68
69 RELFLAGS := $(PLATFORM_RELFLAGS)
70
71 PLATFORM_CPPFLAGS += $(RELFLAGS)
72 PLATFORM_CPPFLAGS += -pipe
73
74 LDFLAGS_FINAL += -Bstatic
75
76 export PLATFORM_CPPFLAGS
77 export RELFLAGS
78 export LDFLAGS_FINAL
79 export LDFLAGS_STANDALONE
80 export CONFIG_STANDALONE_LOAD_ADDR