wdenk | e221174 | 2002-11-02 23:30:20 +0000 | [diff] [blame] | 1 | # |
Wolfgang Denk | 1234ce7 | 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 | 1234ce7 | 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 | dbae504 | 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 | 979b4bd | 2008-05-03 22:25:00 +0200 | [diff] [blame] | 15 | |
Peter Tyser | d53e8fd | 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 | 29514c7 | 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 | d53e8fd | 2010-04-12 22:28:02 -0500 | [diff] [blame] | 24 | |
Peter Tyser | cede5d8 | 2010-04-12 22:28:04 -0500 | [diff] [blame] | 25 | sinclude $(TOPDIR)/arch/$(ARCH)/config.mk # include architecture dependend rules |
Peter Tyser | d53e8fd | 2010-04-12 22:28:02 -0500 | [diff] [blame] | 26 | sinclude $(TOPDIR)/$(CPUDIR)/config.mk # include CPU specific rules |
| 27 | |
Wolfgang Denk | 979b4bd | 2008-05-03 22:25:00 +0200 | [diff] [blame] | 28 | ifdef SOC |
Peter Tyser | d53e8fd | 2010-04-12 22:28:02 -0500 | [diff] [blame] | 29 | sinclude $(TOPDIR)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules |
Wolfgang Denk | 979b4bd | 2008-05-03 22:25:00 +0200 | [diff] [blame] | 30 | endif |
Masahiro Yamada | b93b213 | 2014-03-03 19:03:17 +0900 | [diff] [blame] | 31 | ifneq ($(BOARD),) |
Wolfgang Denk | 979b4bd | 2008-05-03 22:25:00 +0200 | [diff] [blame] | 32 | ifdef VENDOR |
| 33 | BOARDDIR = $(VENDOR)/$(BOARD) |
| 34 | else |
| 35 | BOARDDIR = $(BOARD) |
| 36 | endif |
Masahiro Yamada | b93b213 | 2014-03-03 19:03:17 +0900 | [diff] [blame] | 37 | endif |
Wolfgang Denk | 979b4bd | 2008-05-03 22:25:00 +0200 | [diff] [blame] | 38 | ifdef BOARD |
| 39 | sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules |
| 40 | endif |
| 41 | |
| 42 | ######################################################################### |
| 43 | |
wdenk | e221174 | 2002-11-02 23:30:20 +0000 | [diff] [blame] | 44 | RELFLAGS= $(PLATFORM_RELFLAGS) |
Scott Wood | 34c6dd2 | 2011-04-06 13:31:37 +0000 | [diff] [blame] | 45 | |
Masahiro Yamada | c9c83ba | 2014-02-24 11:12:12 +0900 | [diff] [blame] | 46 | OBJCOPYFLAGS += --gap-fill=0xff |
wdenk | e221174 | 2002-11-02 23:30:20 +0000 | [diff] [blame] | 47 | |
Masahiro Yamada | 0d68fb1 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 48 | CPPFLAGS = $(RELFLAGS) |
| 49 | CPPFLAGS += -pipe $(PLATFORM_CPPFLAGS) |
Tom Rini | b7f3413 | 2012-02-20 13:50:10 +0000 | [diff] [blame] | 50 | |
Nobuhiro Iwamatsu | b859b8c | 2011-01-06 10:23:54 +0900 | [diff] [blame] | 51 | LDFLAGS += $(PLATFORM_LDFLAGS) |
Haiying Wang | 3935873 | 2011-02-22 16:38:05 -0500 | [diff] [blame] | 52 | LDFLAGS_FINAL += -Bstatic |