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