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