efi_loader: type of efi_secure_mode
[oweals/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 else
54 BOARDDIR = $(BOARD)
55 endif
56 endif
57 ifdef   BOARD
58 sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules
59 endif
60
61 ifdef FTRACE
62 PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE
63 endif
64
65 #########################################################################
66
67 RELFLAGS := $(PLATFORM_RELFLAGS)
68
69 PLATFORM_CPPFLAGS += $(RELFLAGS)
70 PLATFORM_CPPFLAGS += -pipe
71
72 LDFLAGS_FINAL += -Bstatic
73
74 export PLATFORM_CPPFLAGS
75 export RELFLAGS
76 export LDFLAGS_FINAL
77 export LDFLAGS_STANDALONE
78 export CONFIG_STANDALONE_LOAD_ADDR