wdenk | e221174 | 2002-11-02 23:30:20 +0000 | [diff] [blame] | 1 | # |
Wolfgang Denk | eca3aeb | 2013-06-21 10:22:36 +0200 | [diff] [blame] | 2 | # (C) Copyright 2000-2013 |
wdenk | e221174 | 2002-11-02 23:30:20 +0000 | [diff] [blame] | 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | # |
Wolfgang Denk | eca3aeb | 2013-06-21 10:22:36 +0200 | [diff] [blame] | 5 | # SPDX-License-Identifier: GPL-2.0+ |
wdenk | e221174 | 2002-11-02 23:30:20 +0000 | [diff] [blame] | 6 | # |
wdenk | e221174 | 2002-11-02 23:30:20 +0000 | [diff] [blame] | 7 | ######################################################################### |
| 8 | |
wdenk | 592c5ca | 2003-06-21 00:17:24 +0000 | [diff] [blame] | 9 | # clean the slate ... |
| 10 | PLATFORM_RELFLAGS = |
| 11 | PLATFORM_CPPFLAGS = |
| 12 | PLATFORM_LDFLAGS = |
| 13 | |
wdenk | e221174 | 2002-11-02 23:30:20 +0000 | [diff] [blame] | 14 | ######################################################################### |
Wolfgang Denk | c4e5f52 | 2008-05-03 22:25:00 +0200 | [diff] [blame] | 15 | |
Peter Tyser | 03b7004 | 2010-04-12 22:28:02 -0500 | [diff] [blame] | 16 | # 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 Tyser | 8d1f268 | 2010-04-12 22:28:09 -0500 | [diff] [blame] | 18 | # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains |
| 19 | # CPU-specific code. |
| 20 | CPUDIR=arch/$(ARCH)/cpu/$(CPU) |
| 21 | ifneq ($(SRCTREE)/$(CPUDIR),$(wildcard $(SRCTREE)/$(CPUDIR))) |
| 22 | CPUDIR=arch/$(ARCH)/cpu |
| 23 | endif |
Peter Tyser | 03b7004 | 2010-04-12 22:28:02 -0500 | [diff] [blame] | 24 | |
Peter Tyser | ea0364f | 2010-04-12 22:28:04 -0500 | [diff] [blame] | 25 | sinclude $(TOPDIR)/arch/$(ARCH)/config.mk # include architecture dependend rules |
Peter Tyser | 03b7004 | 2010-04-12 22:28:02 -0500 | [diff] [blame] | 26 | sinclude $(TOPDIR)/$(CPUDIR)/config.mk # include CPU specific rules |
| 27 | |
Wolfgang Denk | c4e5f52 | 2008-05-03 22:25:00 +0200 | [diff] [blame] | 28 | ifdef SOC |
Peter Tyser | 03b7004 | 2010-04-12 22:28:02 -0500 | [diff] [blame] | 29 | sinclude $(TOPDIR)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules |
Wolfgang Denk | c4e5f52 | 2008-05-03 22:25:00 +0200 | [diff] [blame] | 30 | endif |
| 31 | ifdef VENDOR |
| 32 | BOARDDIR = $(VENDOR)/$(BOARD) |
| 33 | else |
| 34 | BOARDDIR = $(BOARD) |
| 35 | endif |
| 36 | ifdef BOARD |
| 37 | sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules |
| 38 | endif |
| 39 | |
| 40 | ######################################################################### |
| 41 | |
wdenk | e221174 | 2002-11-02 23:30:20 +0000 | [diff] [blame] | 42 | RELFLAGS= $(PLATFORM_RELFLAGS) |
Scott Wood | 83b7e2a | 2011-04-06 13:31:37 +0000 | [diff] [blame] | 43 | |
wdenk | 6dd652f | 2003-06-19 23:40:20 +0000 | [diff] [blame] | 44 | OBJCFLAGS += --gap-fill=0xff |
wdenk | e221174 | 2002-11-02 23:30:20 +0000 | [diff] [blame] | 45 | |
Masahiro Yamada | 6825a95 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 46 | CPPFLAGS = $(RELFLAGS) |
| 47 | CPPFLAGS += -pipe $(PLATFORM_CPPFLAGS) |
Tom Rini | 4a30f1e | 2012-02-20 13:50:10 +0000 | [diff] [blame] | 48 | |
Simon Glass | 5c2aeac | 2013-06-11 11:14:41 -0700 | [diff] [blame] | 49 | BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%)) |
| 50 | |
Nobuhiro Iwamatsu | 8aba9dc | 2011-01-06 10:23:54 +0900 | [diff] [blame] | 51 | LDFLAGS += $(PLATFORM_LDFLAGS) |
Haiying Wang | 6dc1eceb | 2011-02-22 16:38:05 -0500 | [diff] [blame] | 52 | LDFLAGS_FINAL += -Bstatic |