blob: af25c115cc9859bf0ad5b003e73d2a833081aebe [file] [log] [blame]
wdenke2211742002-11-02 23:30:20 +00001#
Wolfgang Denk1234ce72013-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 Denk1234ce72013-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
wdenkdbae5042003-06-21 00:17:24 +00009# clean the slate ...
10PLATFORM_RELFLAGS =
11PLATFORM_CPPFLAGS =
12PLATFORM_LDFLAGS =
13
wdenke2211742002-11-02 23:30:20 +000014#########################################################################
Wolfgang Denk979b4bd2008-05-03 22:25:00 +020015
Peter Tyserd53e8fd2010-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 Tyser29514c72010-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 Tyserd53e8fd2010-04-12 22:28:02 -050024
Peter Tysercede5d82010-04-12 22:28:04 -050025sinclude $(TOPDIR)/arch/$(ARCH)/config.mk # include architecture dependend rules
Peter Tyserd53e8fd2010-04-12 22:28:02 -050026sinclude $(TOPDIR)/$(CPUDIR)/config.mk # include CPU specific rules
27
Wolfgang Denk979b4bd2008-05-03 22:25:00 +020028ifdef SOC
Peter Tyserd53e8fd2010-04-12 22:28:02 -050029sinclude $(TOPDIR)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
Wolfgang Denk979b4bd2008-05-03 22:25:00 +020030endif
Masahiro Yamadab93b2132014-03-03 19:03:17 +090031ifneq ($(BOARD),)
Wolfgang Denk979b4bd2008-05-03 22:25:00 +020032ifdef VENDOR
33BOARDDIR = $(VENDOR)/$(BOARD)
34else
35BOARDDIR = $(BOARD)
36endif
Masahiro Yamadab93b2132014-03-03 19:03:17 +090037endif
Wolfgang Denk979b4bd2008-05-03 22:25:00 +020038ifdef BOARD
39sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules
40endif
41
42#########################################################################
43
wdenke2211742002-11-02 23:30:20 +000044RELFLAGS= $(PLATFORM_RELFLAGS)
Scott Wood34c6dd22011-04-06 13:31:37 +000045
Masahiro Yamadac9c83ba2014-02-24 11:12:12 +090046OBJCOPYFLAGS += --gap-fill=0xff
wdenke2211742002-11-02 23:30:20 +000047
Masahiro Yamada0d68fb12014-02-04 17:24:28 +090048CPPFLAGS = $(RELFLAGS)
49CPPFLAGS += -pipe $(PLATFORM_CPPFLAGS)
Tom Rinib7f34132012-02-20 13:50:10 +000050
Nobuhiro Iwamatsub859b8c2011-01-06 10:23:54 +090051LDFLAGS += $(PLATFORM_LDFLAGS)
Haiying Wang39358732011-02-22 16:38:05 -050052LDFLAGS_FINAL += -Bstatic