blob: 9897f20538af3dac162de740632d7120a9c7dae9 [file] [log] [blame]
wdenke2211742002-11-02 23:30:20 +00001#
Wolfgang Denkeca3aeb2013-06-21 10:22:36 +02002# (C) Copyright 2000-2013
wdenke2211742002-11-02 23:30:20 +00003# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
Wolfgang Denkeca3aeb2013-06-21 10:22:36 +02005# SPDX-License-Identifier: GPL-2.0+
wdenke2211742002-11-02 23:30:20 +00006#
wdenke2211742002-11-02 23:30:20 +00007#########################################################################
8
wdenk592c5ca2003-06-21 00:17:24 +00009# clean the slate ...
10PLATFORM_RELFLAGS =
11PLATFORM_CPPFLAGS =
12PLATFORM_LDFLAGS =
13
wdenke2211742002-11-02 23:30:20 +000014#########################################################################
Wolfgang Denkc4e5f522008-05-03 22:25:00 +020015
Peter Tyser03b70042010-04-12 22:28:02 -050016# Some architecture config.mk files need to know what CPUDIR is set to,
17# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
Peter Tyser8d1f2682010-04-12 22:28:09 -050018# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
19# CPU-specific code.
20CPUDIR=arch/$(ARCH)/cpu/$(CPU)
21ifneq ($(SRCTREE)/$(CPUDIR),$(wildcard $(SRCTREE)/$(CPUDIR)))
22CPUDIR=arch/$(ARCH)/cpu
23endif
Peter Tyser03b70042010-04-12 22:28:02 -050024
Peter Tyserea0364f2010-04-12 22:28:04 -050025sinclude $(TOPDIR)/arch/$(ARCH)/config.mk # include architecture dependend rules
Peter Tyser03b70042010-04-12 22:28:02 -050026sinclude $(TOPDIR)/$(CPUDIR)/config.mk # include CPU specific rules
27
Wolfgang Denkc4e5f522008-05-03 22:25:00 +020028ifdef SOC
Peter Tyser03b70042010-04-12 22:28:02 -050029sinclude $(TOPDIR)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
Wolfgang Denkc4e5f522008-05-03 22:25:00 +020030endif
31ifdef VENDOR
32BOARDDIR = $(VENDOR)/$(BOARD)
33else
34BOARDDIR = $(BOARD)
35endif
36ifdef BOARD
37sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules
38endif
39
40#########################################################################
41
wdenke2211742002-11-02 23:30:20 +000042RELFLAGS= $(PLATFORM_RELFLAGS)
Scott Wood83b7e2a2011-04-06 13:31:37 +000043
Masahiro Yamada95ddcd62014-02-24 11:12:12 +090044OBJCOPYFLAGS += --gap-fill=0xff
wdenke2211742002-11-02 23:30:20 +000045
Masahiro Yamada6825a952014-02-04 17:24:28 +090046CPPFLAGS = $(RELFLAGS)
47CPPFLAGS += -pipe $(PLATFORM_CPPFLAGS)
Tom Rini4a30f1e2012-02-20 13:50:10 +000048
Simon Glass5c2aeac2013-06-11 11:14:41 -070049BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
50
Nobuhiro Iwamatsu8aba9dc2011-01-06 10:23:54 +090051LDFLAGS += $(PLATFORM_LDFLAGS)
Haiying Wang6dc1eceb2011-02-22 16:38:05 -050052LDFLAGS_FINAL += -Bstatic