xref: /openbmc/u-boot/config.mk (revision 9f2ec3f5)
1#
2# (C) Copyright 2000-2013
3# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
5# SPDX-License-Identifier:	GPL-2.0+
6#
7#########################################################################
8
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 :=
21#########################################################################
22
23# Some architecture config.mk files need to know what CPUDIR is set to,
24# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
25# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
26# CPU-specific code.
27CPUDIR=arch/$(ARCH)/cpu/$(CPU)
28ifneq ($(srctree)/$(CPUDIR),$(wildcard $(srctree)/$(CPUDIR)))
29CPUDIR=arch/$(ARCH)/cpu
30endif
31
32sinclude $(srctree)/arch/$(ARCH)/config.mk	# include architecture dependend rules
33sinclude $(srctree)/$(CPUDIR)/config.mk		# include  CPU	specific rules
34
35ifdef	SOC
36sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk	# include  SoC	specific rules
37endif
38ifneq ($(BOARD),)
39ifdef	VENDOR
40BOARDDIR = $(VENDOR)/$(BOARD)
41else
42BOARDDIR = $(BOARD)
43endif
44endif
45ifdef	BOARD
46sinclude $(srctree)/board/$(BOARDDIR)/config.mk	# include board specific rules
47endif
48
49#########################################################################
50
51RELFLAGS := $(PLATFORM_RELFLAGS)
52
53OBJCOPYFLAGS += --gap-fill=0xff
54
55PLATFORM_CPPFLAGS += $(RELFLAGS)
56PLATFORM_CPPFLAGS += -pipe
57
58LDFLAGS += $(PLATFORM_LDFLAGS)
59LDFLAGS_FINAL += -Bstatic
60
61export PLATFORM_CPPFLAGS
62export RELFLAGS
63export LDFLAGS_FINAL
64export CONFIG_STANDALONE_LOAD_ADDR
65