Merge branch 'next'
[u-boot/qq2440-u-boot.git] / config.mk
blob05864aabb5a99c92864161b59b2fae3fdbb16a83
2 # (C) Copyright 2000-2013
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 # SPDX-License-Identifier: GPL-2.0+
7 #########################################################################
9 # This file is included from ./Makefile and spl/Makefile.
10 # Clean the state to avoid the same flags added twice.
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...)
15 PLATFORM_RELFLAGS :=
16 PLATFORM_CPPFLAGS :=
17 PLATFORM_LDFLAGS :=
18 LDFLAGS :=
19 LDFLAGS_FINAL :=
20 OBJCOPYFLAGS :=
21 #########################################################################
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.
27 CPUDIR=arch/$(ARCH)/cpu/$(CPU)
28 ifneq ($(srctree)/$(CPUDIR),$(wildcard $(srctree)/$(CPUDIR)))
29 CPUDIR=arch/$(ARCH)/cpu
30 endif
32 sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules
33 sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules
35 ifdef SOC
36 sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
37 endif
38 ifneq ($(BOARD),)
39 ifdef VENDOR
40 BOARDDIR = $(VENDOR)/$(BOARD)
41 else
42 BOARDDIR = $(BOARD)
43 endif
44 endif
45 ifdef BOARD
46 sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules
47 endif
49 #########################################################################
51 RELFLAGS := $(PLATFORM_RELFLAGS)
53 OBJCOPYFLAGS += --gap-fill=0xff
55 PLATFORM_CPPFLAGS += $(RELFLAGS)
56 PLATFORM_CPPFLAGS += -pipe
58 LDFLAGS += $(PLATFORM_LDFLAGS)
59 LDFLAGS_FINAL += -Bstatic
61 export PLATFORM_CPPFLAGS
62 export RELFLAGS
63 export LDFLAGS_FINAL
64 export CONFIG_STANDALONE_LOAD_ADDR