]> git.ipfire.org Git - thirdparty/u-boot.git/blob - config.mk
env: mmc: print MMC device being read
[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 PLATFORM_LDFLAGS :=
16 LDFLAGS :=
17 LDFLAGS_FINAL :=
18 LDFLAGS_STANDALONE :=
19 OBJCOPYFLAGS :=
20 # clear VENDOR for tcsh
21 VENDOR :=
22 #########################################################################
23
24 ARCH := $(CONFIG_SYS_ARCH:"%"=%)
25 CPU := $(CONFIG_SYS_CPU:"%"=%)
26 ifdef CONFIG_SPL_BUILD
27 ifdef CONFIG_TEGRA
28 CPU := arm720t
29 endif
30 endif
31 BOARD := $(CONFIG_SYS_BOARD:"%"=%)
32 ifneq ($(CONFIG_SYS_VENDOR),)
33 VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
34 endif
35 ifneq ($(CONFIG_SYS_SOC),)
36 SOC := $(CONFIG_SYS_SOC:"%"=%)
37 endif
38
39 # Some architecture config.mk files need to know what CPUDIR is set to,
40 # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
41 # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
42 # CPU-specific code.
43 CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
44
45 sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules
46 sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules
47
48 ifdef SOC
49 sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
50 endif
51 ifneq ($(BOARD),)
52 ifdef VENDOR
53 BOARDDIR = $(VENDOR)/$(BOARD)
54 else
55 BOARDDIR = $(BOARD)
56 endif
57 endif
58 ifdef BOARD
59 sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules
60 endif
61
62 ifdef FTRACE
63 PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE
64 endif
65
66 #########################################################################
67
68 RELFLAGS := $(PLATFORM_RELFLAGS)
69
70 PLATFORM_CPPFLAGS += $(RELFLAGS)
71 PLATFORM_CPPFLAGS += -pipe
72
73 LDFLAGS += $(PLATFORM_LDFLAGS)
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