2 # (C) Copyright 2000-2013
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 # SPDX-License-Identifier: GPL-2.0+
7 #########################################################################
14 #########################################################################
16 # Load generated board configuration
17 ifeq ($(CONFIG_TPL_BUILD),y)
18 # Include TPL autoconf
19 sinclude include/tpl-autoconf.mk
21 ifeq ($(CONFIG_SPL_BUILD),y)
22 # Include SPL autoconf
23 sinclude include/spl-autoconf.mk
25 # Include normal autoconf
26 sinclude include/autoconf.mk
29 sinclude $(OBJTREE)/include/config.mk
31 # Some architecture config.mk files need to know what CPUDIR is set to,
32 # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
33 # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
35 CPUDIR=arch/$(ARCH)/cpu/$(CPU)
36 ifneq ($(SRCTREE)/$(CPUDIR),$(wildcard $(SRCTREE)/$(CPUDIR)))
37 CPUDIR=arch/$(ARCH)/cpu
40 sinclude $(TOPDIR)/arch/$(ARCH)/config.mk # include architecture dependend rules
41 sinclude $(TOPDIR)/$(CPUDIR)/config.mk # include CPU specific rules
44 sinclude $(TOPDIR)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
47 BOARDDIR = $(VENDOR)/$(BOARD)
52 sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules
55 #########################################################################
57 RELFLAGS= $(PLATFORM_RELFLAGS)
59 OBJCFLAGS += --gap-fill=0xff
61 CPPFLAGS = $(KBUILD_CPPFLAGS) $(RELFLAGS)
62 CPPFLAGS += $(UBOOTINCLUDE)
63 CPPFLAGS += $(NOSTDINC_FLAGS) -pipe $(PLATFORM_CPPFLAGS)
65 CFLAGS := $(KBUILD_CFLAGS) $(CPPFLAGS)
67 BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
69 AFLAGS := $(KBUILD_AFLAGS) $(CPPFLAGS)
71 LDFLAGS += $(PLATFORM_LDFLAGS)
72 LDFLAGS_FINAL += -Bstatic
74 #########################################################################
76 export PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS