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# clean the slate ... 10PLATFORM_RELFLAGS = 11PLATFORM_CPPFLAGS = 12PLATFORM_LDFLAGS = 13 14######################################################################### 15 16# Load generated board configuration 17ifeq ($(CONFIG_TPL_BUILD),y) 18# Include TPL autoconf 19sinclude include/tpl-autoconf.mk 20else 21ifeq ($(CONFIG_SPL_BUILD),y) 22# Include SPL autoconf 23sinclude include/spl-autoconf.mk 24else 25# Include normal autoconf 26sinclude include/autoconf.mk 27endif 28endif 29sinclude $(OBJTREE)/include/config.mk 30 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 34# CPU-specific code. 35CPUDIR=arch/$(ARCH)/cpu/$(CPU) 36ifneq ($(SRCTREE)/$(CPUDIR),$(wildcard $(SRCTREE)/$(CPUDIR))) 37CPUDIR=arch/$(ARCH)/cpu 38endif 39 40sinclude $(TOPDIR)/arch/$(ARCH)/config.mk # include architecture dependend rules 41sinclude $(TOPDIR)/$(CPUDIR)/config.mk # include CPU specific rules 42 43ifdef SOC 44sinclude $(TOPDIR)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules 45endif 46ifdef VENDOR 47BOARDDIR = $(VENDOR)/$(BOARD) 48else 49BOARDDIR = $(BOARD) 50endif 51ifdef BOARD 52sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules 53endif 54 55######################################################################### 56 57RELFLAGS= $(PLATFORM_RELFLAGS) 58 59OBJCFLAGS += --gap-fill=0xff 60 61CPPFLAGS = $(RELFLAGS) 62CPPFLAGS += -pipe $(PLATFORM_CPPFLAGS) 63 64BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%)) 65 66LDFLAGS += $(PLATFORM_LDFLAGS) 67LDFLAGS_FINAL += -Bstatic 68