1# SPDX-License-Identifier: GPL-2.0+ 2# 3# (C) Copyright 2000-2013 4# Wolfgang Denk, DENX Software Engineering, wd@denx.de. 5######################################################################### 6 7# This file is included from ./Makefile and spl/Makefile. 8# Clean the state to avoid the same flags added twice. 9# 10# (Tegra needs different flags for SPL. 11# That's the reason why this file must be included from spl/Makefile too. 12# If we did not have Tegra SoCs, build system would be much simpler...) 13PLATFORM_RELFLAGS := 14PLATFORM_CPPFLAGS := 15KBUILD_LDFLAGS := 16LDFLAGS_FINAL := 17LDFLAGS_STANDALONE := 18OBJCOPYFLAGS := 19# clear VENDOR for tcsh 20VENDOR := 21######################################################################### 22 23ARCH := $(CONFIG_SYS_ARCH:"%"=%) 24CPU := $(CONFIG_SYS_CPU:"%"=%) 25ifdef CONFIG_SPL_BUILD 26ifdef CONFIG_ARCH_TEGRA 27CPU := arm720t 28endif 29endif 30BOARD := $(CONFIG_SYS_BOARD:"%"=%) 31ifneq ($(CONFIG_SYS_VENDOR),) 32VENDOR := $(CONFIG_SYS_VENDOR:"%"=%) 33endif 34ifneq ($(CONFIG_SYS_SOC),) 35SOC := $(CONFIG_SYS_SOC:"%"=%) 36endif 37 38# Some architecture config.mk files need to know what CPUDIR is set to, 39# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files. 40# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains 41# CPU-specific code. 42CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),) 43 44sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules 45sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules 46 47ifdef SOC 48sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules 49endif 50ifneq ($(BOARD),) 51ifdef VENDOR 52BOARDDIR = $(VENDOR)/$(BOARD) 53ENVDIR=${vendor}/env 54else 55BOARDDIR = $(BOARD) 56ENVDIR=${board}/env 57endif 58endif 59ifdef BOARD 60sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules 61endif 62 63ifdef FTRACE 64PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE 65endif 66 67######################################################################### 68 69RELFLAGS := $(PLATFORM_RELFLAGS) 70 71PLATFORM_CPPFLAGS += $(RELFLAGS) 72PLATFORM_CPPFLAGS += -pipe 73 74LDFLAGS_FINAL += -Bstatic 75 76export PLATFORM_CPPFLAGS 77export RELFLAGS 78export LDFLAGS_FINAL 79export LDFLAGS_STANDALONE 80export CONFIG_STANDALONE_LOAD_ADDR 81