]>
Commit | Line | Data |
---|---|---|
e2211743 | 1 | # |
eca3aeb3 | 2 | # (C) Copyright 2000-2013 |
e2211743 WD |
3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
4 | # | |
eca3aeb3 | 5 | # SPDX-License-Identifier: GPL-2.0+ |
e2211743 | 6 | # |
e2211743 WD |
7 | ######################################################################### |
8 | ||
026f9cf2 MY |
9 | # This file is included from ./Makefile and spl/Makefile. |
10 | # Clean the state to avoid the same flags added twice. | |
11 | # | |
12 | # (Tegra needs different flags for SPL. | |
13 | # That's the reason why this file must be included from spl/Makefile too. | |
14 | # If we did not have Tegra SoCs, build system would be much simpler...) | |
15 | PLATFORM_RELFLAGS := | |
16 | PLATFORM_CPPFLAGS := | |
17 | PLATFORM_LDFLAGS := | |
18 | LDFLAGS := | |
19 | LDFLAGS_FINAL := | |
20 | OBJCOPYFLAGS := | |
5b3ee386 MY |
21 | # clear VENDOR for tcsh |
22 | VENDOR := | |
c4e5f52a WD |
23 | ######################################################################### |
24 | ||
51148790 MY |
25 | ARCH := $(CONFIG_SYS_ARCH:"%"=%) |
26 | CPU := $(CONFIG_SYS_CPU:"%"=%) | |
e02ee254 MY |
27 | ifdef CONFIG_SPL_BUILD |
28 | ifdef CONFIG_TEGRA | |
29 | CPU := arm720t | |
30 | endif | |
31 | endif | |
51148790 MY |
32 | BOARD := $(CONFIG_SYS_BOARD:"%"=%) |
33 | ifneq ($(CONFIG_SYS_VENDOR),) | |
34 | VENDOR := $(CONFIG_SYS_VENDOR:"%"=%) | |
35 | endif | |
36 | ifneq ($(CONFIG_SYS_SOC),) | |
37 | SOC := $(CONFIG_SYS_SOC:"%"=%) | |
38 | endif | |
39 | ||
03b7004d PT |
40 | # Some architecture config.mk files need to know what CPUDIR is set to, |
41 | # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files. | |
8d1f2682 PT |
42 | # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains |
43 | # CPU-specific code. | |
a8b0f9b6 | 44 | CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),) |
03b7004d | 45 | |
4379ac61 MY |
46 | sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules |
47 | sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules | |
03b7004d | 48 | |
c4e5f52a | 49 | ifdef SOC |
4379ac61 | 50 | sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules |
c4e5f52a | 51 | endif |
33a02da0 | 52 | ifneq ($(BOARD),) |
c4e5f52a WD |
53 | ifdef VENDOR |
54 | BOARDDIR = $(VENDOR)/$(BOARD) | |
55 | else | |
56 | BOARDDIR = $(BOARD) | |
57 | endif | |
33a02da0 | 58 | endif |
c4e5f52a | 59 | ifdef BOARD |
4379ac61 | 60 | sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules |
c4e5f52a WD |
61 | endif |
62 | ||
b8450521 SG |
63 | ifdef FTRACE |
64 | PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE | |
65 | endif | |
66 | ||
0d296cc2 GB |
67 | # Allow use of stdint.h if available |
68 | ifneq ($(USE_STDINT),) | |
69 | PLATFORM_CPPFLAGS += -DCONFIG_USE_STDINT | |
70 | endif | |
71 | ||
c4e5f52a WD |
72 | ######################################################################### |
73 | ||
026f9cf2 | 74 | RELFLAGS := $(PLATFORM_RELFLAGS) |
83b7e2a7 | 75 | |
026f9cf2 MY |
76 | PLATFORM_CPPFLAGS += $(RELFLAGS) |
77 | PLATFORM_CPPFLAGS += -pipe | |
4a30f1e8 | 78 | |
8aba9dce | 79 | LDFLAGS += $(PLATFORM_LDFLAGS) |
6dc1eceb | 80 | LDFLAGS_FINAL += -Bstatic |
026f9cf2 MY |
81 | |
82 | export PLATFORM_CPPFLAGS | |
83 | export RELFLAGS | |
84 | export LDFLAGS_FINAL | |
85 | export CONFIG_STANDALONE_LOAD_ADDR |