blob: 5b886aa70069de1e54339356f99c819b799faf28 [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
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 Wood34c6dd22011-04-06 13:31:37 +000043
wdenkb00ec162003-06-19 23:40:20 +000044OBJCFLAGS += --gap-fill=0xff
wdenke2211742002-11-02 23:30:20 +000045
Masahiro Yamada0d68fb12014-02-04 17:24:28 +090046CPPFLAGS = $(RELFLAGS)
47CPPFLAGS += -pipe $(PLATFORM_CPPFLAGS)
Tom Rinib7f34132012-02-20 13:50:10 +000048
Simon Glass831aa542013-06-11 11:14:41 -070049BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
50
Nobuhiro Iwamatsub859b8c2011-01-06 10:23:54 +090051LDFLAGS += $(PLATFORM_LDFLAGS)
Haiying Wang39358732011-02-22 16:38:05 -050052LDFLAGS_FINAL += -Bstatic