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 23ARCH := $(CONFIG_SYS_ARCH:"%"=%) 24CPU := $(CONFIG_SYS_CPU:"%"=%) 25BOARD := $(CONFIG_SYS_BOARD:"%"=%) 26ifneq ($(CONFIG_SYS_VENDOR),) 27VENDOR := $(CONFIG_SYS_VENDOR:"%"=%) 28endif 29ifneq ($(CONFIG_SYS_SOC),) 30SOC := $(CONFIG_SYS_SOC:"%"=%) 31endif 32 33# Some architecture config.mk files need to know what CPUDIR is set to, 34# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files. 35# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains 36# CPU-specific code. 37CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),) 38 39sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules 40sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules 41 42ifdef SOC 43sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules 44endif 45ifneq ($(BOARD),) 46ifdef VENDOR 47BOARDDIR = $(VENDOR)/$(BOARD) 48else 49BOARDDIR = $(BOARD) 50endif 51endif 52ifdef BOARD 53sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules 54endif 55 56######################################################################### 57 58RELFLAGS := $(PLATFORM_RELFLAGS) 59 60OBJCOPYFLAGS += --gap-fill=0xff 61 62PLATFORM_CPPFLAGS += $(RELFLAGS) 63PLATFORM_CPPFLAGS += -pipe 64 65LDFLAGS += $(PLATFORM_LDFLAGS) 66LDFLAGS_FINAL += -Bstatic 67 68export PLATFORM_CPPFLAGS 69export RELFLAGS 70export LDFLAGS_FINAL 71export CONFIG_STANDALONE_LOAD_ADDR 72