#
Licenses: introduce SPDX Unique Lincense Identifiers
Like many other projects, U-Boot has a tradition of including big
blocks of License headers in all files. This not only blows up the
source code with mostly redundant information, but also makes it very
difficult to generate License Clearing Reports. An additional problem
is that even the same lincenses are referred to by a number of
slightly varying text blocks (full, abbreviated, different
indentation, line wrapping and/or white space, with obsolete address
information, ...) which makes automatic processing a nightmare.
To make this easier, such license headers in the source files will be
replaced with a single line reference to Unique Lincense Identifiers
as defined by the Linux Foundation's SPDX project [1]. For example,
in a source file the full "GPL v2.0 or later" header text will be
replaced by a single line:
SPDX-License-Identifier: GPL-2.0+
We use the SPDX Unique Lincense Identifiers here; these are available
at [2].
Note: From the legal point of view, this patch is supposed to be only
a change to the textual representation of the license information,
but in no way any change to the actual license terms. With this patch
applied, all files will still be licensed under the same terms they
were before.
Note 2: The apparent difference between the old "COPYING" and the new
"Licenses/gpl-2.0.txt" only results from switching to the upstream
version of the license which is differently formatted; there are not
any actual changes to the content.
Note 3: There are some recurring questions about linense issues, such
as:
- Is a "All Rights Reserved" clause a problem in GPL code?
- Are files without any license header a problem?
- Do we need license headers at all?
The following excerpt from an e-mail by Daniel B. Ravicher should help
with these:
| Message-ID: <4ADF8CAA.5030808@softwarefreedom.org>
| Date: Wed, 21 Oct 2009 18:35:22 -0400
| From: "Daniel B. Ravicher" <ravicher@softwarefreedom.org>
| To: Wolfgang Denk <wd@denx.de>
| Subject: Re: GPL and license cleanup questions
|
| Mr. Denk,
|
| Wolfgang Denk wrote:
| > - There are a number of files which do not include any specific
| > license information at all. Is it correct to assume that these files
| > are automatically covered by the "GPL v2 or later" clause as
| > specified by the COPYING file in the top level directory of the
| > U-Boot source tree?
|
| That is a very fact specific analysis and could be different across the
| various files. However, if the contributor could reasonably be expected
| to have known that the project was licensed GPLv2 or later at the time
| she made her contribution, then a reasonably implication is that she
| consented to her contributions being distributed under those terms.
|
| > - Do such files need any clean up, for example should we add GPL
| > headers to them, or is this not needed?
|
| If the project as a whole is licensed under clear terms, you need not
| identify those same terms in each file, although there is no harm in
| doing so.
|
| > - There are other files, which include both a GPL license header
| > _plus_ some copyright note with an "All Rights Reserved" clause. It
| > has been my understanding that this is a conflict, and me must ask
| > the copyright holders to remove such "All Rights Reserved" clauses.
| > But then, some people claim that "All Rights Reserved" is a no-op
| > nowadays. License checking tools (like OSLC) seem to indicate this is
| > a problem, but then we see quite a lot of "All rights reserved" in
| > BSD-licensed files in gcc and glibc. So what is the correct way to
| > deal with such files?
|
| It is not a conflict to grant a license and also reserve all rights, as
| implicit in that language is that you are reserving all "other" rights
| not granted in the license. Thus, a file with "Licensed under GPL, All
| Rights Reserved" would mean that it is licensed under the GPL, but no
| other rights are given to copy, modify or redistribute it.
|
| Warm regards,
| --Dan
|
| Daniel B. Ravicher, Legal Director
| Software Freedom Law Center (SFLC) and Moglen Ravicher LLC
| 1995 Broadway, 17th Fl., New York, NY 10023
| (212) 461-1902 direct (212) 580-0800 main (212) 580-0898 fax
| ravicher@softwarefreedom.org www.softwarefreedom.org
[1] http://spdx.org/
[2] http://spdx.org/licenses/
Signed-off-by: Wolfgang Denk <wd@denx.de>
12 years ago
# (C) Copyright 2000-2013
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
Licenses: introduce SPDX Unique Lincense Identifiers
Like many other projects, U-Boot has a tradition of including big
blocks of License headers in all files. This not only blows up the
source code with mostly redundant information, but also makes it very
difficult to generate License Clearing Reports. An additional problem
is that even the same lincenses are referred to by a number of
slightly varying text blocks (full, abbreviated, different
indentation, line wrapping and/or white space, with obsolete address
information, ...) which makes automatic processing a nightmare.
To make this easier, such license headers in the source files will be
replaced with a single line reference to Unique Lincense Identifiers
as defined by the Linux Foundation's SPDX project [1]. For example,
in a source file the full "GPL v2.0 or later" header text will be
replaced by a single line:
SPDX-License-Identifier: GPL-2.0+
We use the SPDX Unique Lincense Identifiers here; these are available
at [2].
Note: From the legal point of view, this patch is supposed to be only
a change to the textual representation of the license information,
but in no way any change to the actual license terms. With this patch
applied, all files will still be licensed under the same terms they
were before.
Note 2: The apparent difference between the old "COPYING" and the new
"Licenses/gpl-2.0.txt" only results from switching to the upstream
version of the license which is differently formatted; there are not
any actual changes to the content.
Note 3: There are some recurring questions about linense issues, such
as:
- Is a "All Rights Reserved" clause a problem in GPL code?
- Are files without any license header a problem?
- Do we need license headers at all?
The following excerpt from an e-mail by Daniel B. Ravicher should help
with these:
| Message-ID: <4ADF8CAA.5030808@softwarefreedom.org>
| Date: Wed, 21 Oct 2009 18:35:22 -0400
| From: "Daniel B. Ravicher" <ravicher@softwarefreedom.org>
| To: Wolfgang Denk <wd@denx.de>
| Subject: Re: GPL and license cleanup questions
|
| Mr. Denk,
|
| Wolfgang Denk wrote:
| > - There are a number of files which do not include any specific
| > license information at all. Is it correct to assume that these files
| > are automatically covered by the "GPL v2 or later" clause as
| > specified by the COPYING file in the top level directory of the
| > U-Boot source tree?
|
| That is a very fact specific analysis and could be different across the
| various files. However, if the contributor could reasonably be expected
| to have known that the project was licensed GPLv2 or later at the time
| she made her contribution, then a reasonably implication is that she
| consented to her contributions being distributed under those terms.
|
| > - Do such files need any clean up, for example should we add GPL
| > headers to them, or is this not needed?
|
| If the project as a whole is licensed under clear terms, you need not
| identify those same terms in each file, although there is no harm in
| doing so.
|
| > - There are other files, which include both a GPL license header
| > _plus_ some copyright note with an "All Rights Reserved" clause. It
| > has been my understanding that this is a conflict, and me must ask
| > the copyright holders to remove such "All Rights Reserved" clauses.
| > But then, some people claim that "All Rights Reserved" is a no-op
| > nowadays. License checking tools (like OSLC) seem to indicate this is
| > a problem, but then we see quite a lot of "All rights reserved" in
| > BSD-licensed files in gcc and glibc. So what is the correct way to
| > deal with such files?
|
| It is not a conflict to grant a license and also reserve all rights, as
| implicit in that language is that you are reserving all "other" rights
| not granted in the license. Thus, a file with "Licensed under GPL, All
| Rights Reserved" would mean that it is licensed under the GPL, but no
| other rights are given to copy, modify or redistribute it.
|
| Warm regards,
| --Dan
|
| Daniel B. Ravicher, Legal Director
| Software Freedom Law Center (SFLC) and Moglen Ravicher LLC
| 1995 Broadway, 17th Fl., New York, NY 10023
| (212) 461-1902 direct (212) 580-0800 main (212) 580-0898 fax
| ravicher@softwarefreedom.org www.softwarefreedom.org
[1] http://spdx.org/
[2] http://spdx.org/licenses/
Signed-off-by: Wolfgang Denk <wd@denx.de>
12 years ago
# SPDX-License-Identifier: GPL-2.0+
#
VERSION = 2014
PATCHLEVEL = 04
SUBLEVEL =
EXTRAVERSION = -rc1
NAME =
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
# More info can be located in ./README
# Comments in this file are targeted only to the developer, do not
# expect to learn how to build the kernel reading this file.
# Do not:
# o use make's built-in rules and variables
# (this increases performance and avoids hard-to-debug behaviour);
# o print "Entering directory ...";
MAKEFLAGS += -rR --no-print-directory
# Avoid funny character set dependencies
u n export LC_ALL
LC_COLLATE = C
LC_NUMERIC = C
export LC_COLLATE LC_NUMERIC
# We are using a recursive build, so we need to do a little thinking
# to get the ordering right.
#
# Most importantly: sub-Makefiles should only ever modify files in
# their own directory. If in some directory we have a dependency on
# a file in another dir (which doesn't happen often, but it's often
# unavoidable when linking the built-in.o targets which finally
# turn into vmlinux), we will call a sub make in that other dir, and
# after that we are sure that everything which is in that other dir
# is now up to date.
#
# The only cases where we need to modify files which have global
# effects are thus separated out and done before the recursive
# descending is started. They are now explicitly listed as the
# prepare rule.
# To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands
i f e q ( "$(origin V)" , "command line" )
KBUILD_VERBOSE = $( V)
e n d i f
i f n d e f K B U I L D _ V E R B O S E
KBUILD_VERBOSE = 0
e n d i f
# Call a source code checker (by default, "sparse") as part of the
# C compilation.
#
# Use 'make C=1' to enable checking of only re-compiled files.
# Use 'make C=2' to enable checking of *all* source files, regardless
# of whether they are re-compiled or not.
#
# See the file "Documentation/sparse.txt" for more details, including
# where to get the "sparse" utility.
i f e q ( "$(origin C)" , "command line" )
KBUILD_CHECKSRC = $( C)
e n d i f
i f n d e f K B U I L D _ C H E C K S R C
KBUILD_CHECKSRC = 0
e n d i f
# Use make M=dir to specify directory of external module to build
# Old syntax make ... SUBDIRS=$PWD is still supported
# Setting the environment variable KBUILD_EXTMOD take precedence
i f d e f S U B D I R S
KBUILD_EXTMOD ?= $( SUBDIRS)
e n d i f
i f e q ( "$(origin M)" , "command line" )
KBUILD_EXTMOD := $( M)
e n d i f
# kbuild supports saving output files in a separate directory.
# To locate output files in a separate directory two syntaxes are supported.
# In both cases the working directory must be the root of the kernel src.
# 1) O=
# Use "make O=dir/to/store/output/files/"
#
# 2) Set KBUILD_OUTPUT
# Set the environment variable KBUILD_OUTPUT to point to the directory
# where the output files shall be placed.
# export KBUILD_OUTPUT=dir/to/store/output/files/
# make
#
# The O= assignment takes precedence over the KBUILD_OUTPUT environment
# variable.
# KBUILD_SRC is set on invocation of make in OBJ directory
# KBUILD_SRC is not intended to be used by the regular user (for now)
i f e q ( $( KBUILD_SRC ) , )
# OK, Make called in directory where kernel src resides
# Do we want to locate output files in a separate directory?
i f e q ( "$(origin O)" , "command line" )
KBUILD_OUTPUT := $( O)
e n d i f
i f e q ( "$(origin W)" , "command line" )
export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $( W)
e n d i f
# That's our default target when none is given on the command line
PHONY := _all
_all :
# Cancel implicit rules on top Makefile
$(CURDIR)/Makefile Makefile : ;
i f n e q ( $( KBUILD_OUTPUT ) , )
# Invoke a second make in the output directory, passing relevant variables
# check that the output directory actually exists
saved-output := $( KBUILD_OUTPUT)
KBUILD_OUTPUT := $( shell cd $( KBUILD_OUTPUT) && /bin/pwd)
$( if $ ( KBUILD_OUTPUT ) ,, \
$( error output directory " $( saved-output) " does not exist) )
PHONY += $( MAKECMDGOALS) sub-make
$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all : sub -make
@:
sub-make : FORCE
$( if $( KBUILD_VERBOSE:1= ) ,@) $( MAKE) -C $( KBUILD_OUTPUT) \
KBUILD_SRC = $( CURDIR) \
KBUILD_EXTMOD = " $( KBUILD_EXTMOD) " -f $( CURDIR) /Makefile \
$( filter-out _all sub-make,$( MAKECMDGOALS) )
# Leave processing to above invocation of make
skip-makefile := 1
e n d i f # ifneq ($(KBUILD_OUTPUT),)
e n d i f # ifeq ($(KBUILD_SRC),)
# We process the rest of the Makefile if this is the final invocation of make
i f e q ( $( skip -makefile ) , )
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
# If building an external module we do not care about the all: rule
# but instead _all depend on modules
PHONY += all
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
i f e q ( $( KBUILD_EXTMOD ) , )
_all : all
e l s e
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
_all : modules
e n d i f
srctree := $( if $( KBUILD_SRC) ,$( KBUILD_SRC) ,$( CURDIR) )
objtree := $( CURDIR)
src := $( srctree)
obj := $( objtree)
VPATH := $( srctree) $( if $( KBUILD_EXTMOD) ,:$( KBUILD_EXTMOD) )
export srctree objtree VPATH
OBJTREE := $( objtree)
SPLTREE := $( OBJTREE) /spl
TPLTREE := $( OBJTREE) /tpl
SRCTREE := $( srctree)
TOPDIR := $( SRCTREE)
export TOPDIR SRCTREE OBJTREE SPLTREE TPLTREE
MKCONFIG := $( SRCTREE) /mkconfig
export MKCONFIG
# Make sure CDPATH settings don't interfere
u n export CDPATH
#########################################################################
HOSTARCH := $( shell uname -m | \
sed -e s/i.86/x86/ \
-e s/sun4u/sparc64/ \
-e s/arm.*/arm/ \
-e s/sa110/arm/ \
-e s/ppc64/powerpc/ \
-e s/ppc/powerpc/ \
-e s/macppc/powerpc/\
-e s/sh.*/sh/)
HOSTOS := $( shell uname -s | tr '[:upper:]' '[:lower:]' | \
sed -e 's/\(cygwin\).*/cygwin/' )
export HOSTARCH HOSTOS
# Deal with colliding definitions from tcsh etc.
VENDOR =
#########################################################################
# set default to nothing for native builds
i f e q ( $( HOSTARCH ) , $( ARCH ) )
CROSS_COMPILE ?=
e n d i f
# SHELL used by kbuild
CONFIG_SHELL := $( shell if [ -x " $$ BASH " ] ; then echo $$ BASH; \
else if [ -x /bin/bash ] ; then echo /bin/bash; \
else echo sh; fi ; fi )
HOSTCC = gcc
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
i f e q ( $( HOSTOS ) , c y g w i n )
HOSTCFLAGS += -ansi
e n d i f
# Mac OS X / Darwin's C preprocessor is Apple specific. It
# generates numerous errors and warnings. We want to bypass it
# and use GNU C's cpp. To do this we pass the -traditional-cpp
# option to the compiler. Note that the -traditional-cpp flag
# DOES NOT have the same semantics as GNU C's flag, all it does
# is invoke the GNU preprocessor in stock ANSI/ISO C fashion.
#
# Apple's linker is similar, thanks to the new 2 stage linking
# multiple symbol definitions are treated as errors, hence the
# -multiply_defined suppress option to turn off this error.
#
i f e q ( $( HOSTOS ) , d a r w i n )
# get major and minor product version (e.g. '10' and '6' for Snow Leopard)
DARWIN_MAJOR_VERSION = $( shell sw_vers -productVersion | cut -f 1 -d '.' )
DARWIN_MINOR_VERSION = $( shell sw_vers -productVersion | cut -f 2 -d '.' )
os_x_before = $( shell if [ $( DARWIN_MAJOR_VERSION) -le $( 1) -a \
$( DARWIN_MINOR_VERSION) -le $( 2) ] ; then echo " $( 3) " ; else echo " $( 4) " ; fi ; )
# Snow Leopards build environment has no longer restrictions as described above
HOSTCC = $( call os_x_before, 10, 5, "cc" , "gcc" )
HOSTCFLAGS += $( call os_x_before, 10, 4, "-traditional-cpp" )
HOSTLDFLAGS += $( call os_x_before, 10, 5, "-multiply_defined suppress" )
e n d i f
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
# Decide whether to build built-in, modular, or both.
# Normally, just do built-in.
KBUILD_MODULES :=
KBUILD_BUILTIN := 1
# If we have only "make modules", don't compile built-in objects.
# When we're building modules with modversions, we need to consider
# the built-in objects during the descend as well, in order to
# make sure the checksums are up to date before we record them.
i f e q ( $( MAKECMDGOALS ) , m o d u l e s )
KBUILD_BUILTIN := $( if $( CONFIG_MODVERSIONS) ,1)
e n d i f
# If we have "make <whatever> modules", compile modules
# in addition to whatever we do anyway.
# Just "make" or "make all" shall build modules as well
# U-Boot does not need modules
#ifneq ($(filter all _all modules,$(MAKECMDGOALS)),)
# KBUILD_MODULES := 1
#endif
#ifeq ($(MAKECMDGOALS),)
# KBUILD_MODULES := 1
#endif
export KBUILD_MODULES KBUILD_BUILTIN
export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
# Beautify output
# ---------------------------------------------------------------------------
#
# Normally, we echo the whole command before executing it. By making
# that echo $($(quiet)$(cmd)), we now have the possibility to set
# $(quiet) to choose other forms of output instead, e.g.
#
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
# quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
# cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
#
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
# If $(quiet) is empty, the whole command will be printed.
# If it is set to "quiet_", only the short version will be printed.
# If it is set to "silent_", nothing will be printed at all, since
# the variable $(silent_cmd_cc_o_c) doesn't exist.
#
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
# A simple variant is to prefix commands with $(Q) - that's useful
# for commands that shall be hidden in non-verbose mode.
#
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
# $(Q)ln $@ :<
#
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
# If KBUILD_VERBOSE equals 0 then the above command will be hidden.
# If KBUILD_VERBOSE equals 1 then the above command is displayed.
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
i f e q ( $( KBUILD_VERBOSE ) , 1 )
quiet =
Q =
e l s e
quiet = quiet_
Q = @
e n d i f
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
# If the user is running make -s (silent mode), suppress echoing of
# commands
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
i f n e q ( $( filter s % -s %,$ ( MAKEFLAGS ) ) , )
quiet = silent_
e n d i f
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
export quiet Q KBUILD_VERBOSE
# Look for make include files relative to root of kernel src
MAKEFLAGS += --include-dir= $( srctree)
# We need some generic definitions (do not try to remake the file).
$(srctree)/scripts/Kbuild.include : ;
i n c l u d e $( srctree ) / s c r i p t s / K b u i l d . i n c l u d e
# Make variables (CC, etc...)
AS = $( CROSS_COMPILE) as
# Always use GNU ld
i f n e q ( $( shell $ ( CROSS_COMPILE ) ld .bfd -v 2> /dev /null ) , )
LD = $( CROSS_COMPILE) ld.bfd
e l s e
LD = $( CROSS_COMPILE) ld
e n d i f
CC = $( CROSS_COMPILE) gcc
CPP = $( CC) -E
AR = $( CROSS_COMPILE) ar
NM = $( CROSS_COMPILE) nm
LDR = $( CROSS_COMPILE) ldr
STRIP = $( CROSS_COMPILE) strip
OBJCOPY = $( CROSS_COMPILE) objcopy
OBJDUMP = $( CROSS_COMPILE) objdump
AWK = awk
RANLIB = $( CROSS_COMPILE) RANLIB
DTC = dtc
CHECK = sparse
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $( CF)
KBUILD_CPPFLAGS := -D__KERNEL__
KBUILD_CFLAGS := -Wall -Wstrict-prototypes \
-Wno-format-security \
-fno-builtin -ffreestanding
KBUILD_AFLAGS := -D__ASSEMBLY__
# Read UBOOTRELEASE from include/config/uboot.release (if it exists)
UBOOTRELEASE = $( shell cat include/config/uboot.release 2> /dev/null)
UBOOTVERSION = $( VERSION) $( if $( PATCHLEVEL) ,.$( PATCHLEVEL) $( if $( SUBLEVEL) ,.$( SUBLEVEL) ) ) $( EXTRAVERSION)
export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION
export ARCH CPU BOARD VENDOR SOC
export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
export MAKE AWK
export DTC CHECK CHECKFLAGS
export KBUILD_CPPFLAGS NOSTDINC_FLAGS UBOOTINCLUDE
export KBUILD_CFLAGS KBUILD_AFLAGS
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
# When compiling out-of-tree modules, put MODVERDIR in the module
# tree rather than in the kernel tree. The kernel tree might
# even be read-only.
export MODVERDIR := $( if $( KBUILD_EXTMOD) ,$( firstword $( KBUILD_EXTMOD) ) /) .tmp_versions
# Files to ignore in find ... statements
RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
-o -name .pc -o -name .hg -o -name .git \) -prune -o
export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
--exclude CVS --exclude .pc --exclude .hg --exclude .git
# ===========================================================================
# Rules shared between *config targets and build targets
# Basic helpers built in scripts/
PHONY += scripts_basic
scripts_basic :
$( Q) $( MAKE) $( build) = scripts/basic
$( Q) rm -f .tmp_quiet_recordmcount
# To avoid any implicit rule to kick in, define an empty command.
scripts/basic/% : scripts_basic ;
PHONY += outputmakefile
# outputmakefile generates a Makefile in the output directory, if using a
# separate output directory. This allows convenient use of make in the
# output directory.
outputmakefile :
i f n e q ( $( KBUILD_SRC ) , )
$( Q) ln -fsn $( srctree) source
$( Q) $( CONFIG_SHELL) $( srctree) /scripts/mkmakefile \
$( srctree) $( objtree) $( VERSION) $( PATCHLEVEL)
e n d i f
# To make sure we do not include .config for any of the *config targets
# catch them early, and hand them over to scripts/kconfig/Makefile
# It is allowed to specify more targets when calling make, including
# mixing *config targets and build targets.
# For example 'make oldconfig all'.
# Detect when mixed targets is specified, and make a second invocation
# of make so .config is not included in this case either (for *config).
version_h := include/generated/version_autogenerated.h
timestamp_h := include/generated/timestamp_autogenerated.h
no-dot-config-targets := clean clobber mrproper distclean \
help %docs check% coccicheck \
backup
config-targets := 0
mixed-targets := 0
dot-config := 1
i f n e q ( $( filter $ ( no -dot -config -targets ) , $ ( MAKECMDGOALS ) ) , )
ifeq ( $( filter-out $( no-dot-config-targets) , $( MAKECMDGOALS) ) ,)
dot-config := 0
endif
e n d i f
i f e q ( $( KBUILD_EXTMOD ) , )
ifneq ( $( filter config %config,$( MAKECMDGOALS) ) ,)
config-targets := 1
ifneq ( $( filter-out config %config,$( MAKECMDGOALS) ) ,)
mixed-targets := 1
endif
endif
e n d i f
i f e q ( $( mixed -targets ) , 1 )
# ===========================================================================
# We're called with mixed targets (*config and build targets).
# Handle them one by one.
PHONY += $( MAKECMDGOALS) build-one-by-one
$(MAKECMDGOALS) : build -one -by -one
@:
build-one-by-one :
$( Q) set -e; \
for i in $( MAKECMDGOALS) ; do \
$( MAKE) -f $( srctree) /Makefile $$ i; \
done
e l s e
i f e q ( $( config -targets ) , 1 )
# ===========================================================================
# *config targets only - make sure prerequisites are updated, and descend
# in scripts/kconfig to make the *config target
# Read arch specific Makefile to set KBUILD_DEFCONFIG as needed.
# KBUILD_DEFCONFIG may point out an alternative default configuration
# used for 'make defconfig'
%_config :: outputmakefile
@$( MKCONFIG) -A $( @:_config= )
e l s e
# ===========================================================================
# Build targets only - this includes vmlinux, arch specific targets, clean
# targets and others. In general all targets except *config targets.
# load ARCH, BOARD, and CPU configuration
- i n c l u d e i n c l u d e / c o n f i g . m k
i f e q ( $( dot -config ) , 1 )
# Read in config
- i n c l u d e i n c l u d e / a u t o c o n f . m k
- i n c l u d e i n c l u d e / a u t o c o n f . m k . d e p
# load other configuration
i n c l u d e $( srctree ) / c o n f i g . m k
i f e q ( $( wildcard include /config .mk ) , )
$( error "System not configured - see README ")
e n d i f
i f e q ( $( __HAVE_ARCH_GENERIC_BOARD ) , )
i f n e q ( $( CONFIG_SYS_GENERIC_BOARD ) , )
$( error Your architecture does not support generic board . \
P l e a s e u n d e f i n e d C O N F I G _ S Y S _ G E N E R I C _ B O A R D i n y o u r b o a r d c o n f i g f i l e )
e n d i f
e n d i f
# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
# that (or fail if absent). Otherwise, search for a linker script in a
# standard location.
LDSCRIPT_MAKEFILE_DIR = $( dir $( LDSCRIPT) )
i f n d e f L D S C R I P T
#LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
ifdef CONFIG_SYS_LDSCRIPT
# need to strip off double quotes
LDSCRIPT := $( CONFIG_SYS_LDSCRIPT:"%" = %)
endif
e n d i f
# If there is no specified link script, we look in a number of places for it
i f n d e f L D S C R I P T
ifeq ( $( CONFIG_NAND_U_BOOT) ,y)
LDSCRIPT := $( TOPDIR) /board/$( BOARDDIR) /u-boot-nand.lds
ifeq ( $( wildcard $( LDSCRIPT) ) ,)
LDSCRIPT := $( TOPDIR) /$( CPUDIR) /u-boot-nand.lds
endif
endif
ifeq ( $( wildcard $( LDSCRIPT) ) ,)
LDSCRIPT := $( TOPDIR) /board/$( BOARDDIR) /u-boot.lds
endif
ifeq ( $( wildcard $( LDSCRIPT) ) ,)
LDSCRIPT := $( TOPDIR) /$( CPUDIR) /u-boot.lds
endif
ifeq ( $( wildcard $( LDSCRIPT) ) ,)
LDSCRIPT := $( TOPDIR) /arch/$( ARCH) /cpu/u-boot.lds
# We don't expect a Makefile here
LDSCRIPT_MAKEFILE_DIR =
endif
ifeq ( $( wildcard $( LDSCRIPT) ) ,)
$( error could not find linker script )
endif
e n d i f
e l s e
e n d i f # $(dot-config)
KBUILD_CFLAGS += -Os #-fomit-frame-pointer
i f d e f B U I L D _ T A G
KBUILD_CFLAGS += -DBUILD_TAG= '"$(BUILD_TAG)"'
e n d i f
KBUILD_CFLAGS += $( call cc-option,-fno-stack-protector)
KBUILD_CFLAGS += -g
# $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
# option to the assembler.
KBUILD_AFLAGS += -g
# Report stack usage if supported
i f e q ( $( shell $ ( CONFIG_SHELL ) $ ( srctree ) /scripts /gcc -stack -usage .sh $ ( CC ) ) , y )
KBUILD_CFLAGS += -fstack-usage
e n d i f
KBUILD_CFLAGS += $( call cc-option,-Wno-format-nonliteral)
# turn jbsr into jsr for m68k
i f e q ( $( ARCH ) , m 6 8 k )
i f e q ( $( findstring 3.4,$ ( shell $ ( CC ) --version ) ) , 3 . 4 )
KBUILD_AFLAGS += -Wa,-gstabs,-S
e n d i f
e n d i f
i f n e q ( $( CONFIG_SYS_TEXT_BASE ) , )
KBUILD_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE= $( CONFIG_SYS_TEXT_BASE)
e n d i f
export CONFIG_SYS_TEXT_BASE
# Use UBOOTINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
UBOOTINCLUDE :=
i f n e q ( $( OBJTREE ) , $( SRCTREE ) )
UBOOTINCLUDE += -I$( OBJTREE) /include
e n d i f
UBOOTINCLUDE += -I$( srctree) /include \
-I$( srctree) /arch/$( ARCH) /include
NOSTDINC_FLAGS += -nostdinc -isystem $( shell $( CC) -print-file-name= include)
CHECKFLAGS += $( NOSTDINC_FLAGS)
# FIX ME
cpp_flags := $( KBUILD_CPPFLAGS) $( CPPFLAGS) $( UBOOTINCLUDE) $( NOSTDINC_FLAGS)
c_flags := $( KBUILD_CFLAGS) $( cpp_flags)
#########################################################################
# U-Boot objects....order is important (i.e. start must be first)
head-y := $( CPUDIR) /start.o
head-$(CONFIG_4xx) += arch/powerpc/cpu/ppc4xx/resetvec.o
head-$(CONFIG_MPC85xx) += arch/powerpc/cpu/mpc85xx/resetvec.o
HAVE_VENDOR_COMMON_LIB = $( if $( wildcard $( srctree) /board/$( VENDOR) /common/Makefile) ,y,n)
libs-y += lib/
libs-$(HAVE_VENDOR_COMMON_LIB) += board/$( VENDOR) /common/
libs-y += $( CPUDIR) /
i f d e f S O C
libs-y += $( CPUDIR) /$( SOC) /
e n d i f
libs-$(CONFIG_OF_EMBED) += dts/
libs-y += arch/$( ARCH) /lib/
libs-y += fs/
libs-y += net/
libs-y += disk/
libs-y += drivers/
libs-y += drivers/dma/
libs-y += drivers/gpio/
libs-y += drivers/i2c/
libs-y += drivers/input/
libs-y += drivers/mmc/
libs-y += drivers/mtd/
libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/
libs-y += drivers/mtd/onenand/
libs-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
libs-y += drivers/mtd/spi/
libs-y += drivers/net/
libs-y += drivers/net/phy/
libs-y += drivers/pci/
libs-y += drivers/power/ \
drivers/power/fuel_gauge/ \
drivers/power/mfd/ \
drivers/power/pmic/ \
drivers/power/battery/
libs-y += drivers/spi/
libs-$(CONFIG_FMAN_ENET) += drivers/net/fm/
libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
libs-y += drivers/serial/
libs-y += drivers/usb/eth/
libs-y += drivers/usb/gadget/
libs-y += drivers/usb/host/
libs-y += drivers/usb/musb/
libs-y += drivers/usb/musb-new/
libs-y += drivers/usb/phy/
libs-y += drivers/usb/ulpi/
libs-y += common/
libs-y += lib/libfdt/
libs-$(CONFIG_API) += api/
libs-$(CONFIG_HAS_POST) += post/
libs-y += test/
i f n e q ( , $( filter $ ( SOC ) , mx 25 mx 27 mx 5 mx 6 mx 31 mx 35 mxs vf 610) )
libs-y += arch/$( ARCH) /imx-common/
e n d i f
libs-$(CONFIG_ARM) += arch/arm/cpu/
libs-$(CONFIG_PPC) += arch/powerpc/cpu/
libs-y += board/$( BOARDDIR) /
libs-y := $( sort $( libs-y) )
u-boot-dirs := $( patsubst %/,%,$( filter %/, $( libs-y) ) ) tools examples
u-boot-alldirs := $( sort $( u-boot-dirs) $( patsubst %/,%,$( filter %/, $( libs-) ) ) )
libs-y := $( patsubst %/, %/built-in.o, $( libs-y) )
u-boot-init := $( head-y)
u-boot-main := $( libs-y)
# Add GCC lib
i f d e f U S E _ P R I V A T E _ L I B G C C
i f e q ( "$(USE_PRIVATE_LIBGCC)" , "yes" )
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
PLATFORM_LIBGCC = $( OBJTREE) /arch/$( ARCH) /lib/lib.a
e l s e
PLATFORM_LIBGCC = -L $( USE_PRIVATE_LIBGCC) -lgcc
e n d i f
e l s e
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
PLATFORM_LIBGCC := -L $( shell dirname ` $( CC) $( c_flags) -print-libgcc-file-name` ) -lgcc
e n d i f
PLATFORM_LIBS += $( PLATFORM_LIBGCC)
export PLATFORM_LIBS
# Special flags for CPP when processing the linker script.
# Pass the version down so we can handle backwards compatibility
# on the fly.
LDPPFLAGS += \
-include $( TOPDIR) /include/u-boot/u-boot.lds.h \
-DCPUDIR= $( CPUDIR) \
$( shell $( LD) --version | \
sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p' )
#########################################################################
#########################################################################
i f n e q ( $( CONFIG_BOARD_SIZE_LIMIT ) , )
BOARD_SIZE_CHECK = \
@actual= ` wc -c $@ | awk '{print $$1}' ` ; \
limit = ` printf "%d" $( CONFIG_BOARD_SIZE_LIMIT) ` ; \
if test $$ actual -gt $$ limit; then \
echo " $@ exceeds file size limit: " >& 2 ; \
echo " limit: $$ limit bytes " >& 2 ; \
echo " actual: $$ actual bytes " >& 2 ; \
echo " excess: $$ ((actual - limit)) bytes " >& 2; \
exit 1; \
fi
e l s e
BOARD_SIZE_CHECK =
e n d i f
# Statically apply RELA-style relocations (currently arm64 only)
i f n e q ( $( CONFIG_STATIC_RELA ) , )
# $(1) is u-boot ELF, $(2) is u-boot bin, $(3) is text base
DO_STATIC_RELA = \
start = $$ ( $( NM) $( 1) | grep __rel_dyn_start | cut -f 1 -d ' ' ) ; \
end = $$ ( $( NM) $( 1) | grep __rel_dyn_end | cut -f 1 -d ' ' ) ; \
tools/relocate-rela $( 2) $( 3) $$ start $$ end
e l s e
DO_STATIC_RELA =
e n d i f
# Always append ALL so that arch config.mk's can add custom ones
ALL-y += u-boot.srec u-boot.bin System.map
ALL-$(CONFIG_NAND_U_BOOT) += u-boot-nand.bin
ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin
ALL-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl
ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin
ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img
ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.bin
i f n e q ( $( CONFIG_SPL_TARGET ) , )
ALL-$(CONFIG_SPL) += $( CONFIG_SPL_TARGET:"%" = %)
e n d i f
ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf
# enable combined SPL/u-boot/dtb rules for tegra
i f n e q ( $( CONFIG_TEGRA ) , )
i f e q ( $( CONFIG_SPL ) , y )
i f e q ( $( CONFIG_OF_SEPARATE ) , y )
ALL-y += u-boot-dtb-tegra.bin
e l s e
ALL-y += u-boot-nodtb-tegra.bin
e n d i f
e n d i f
e n d i f
LDFLAGS_u-boot += -T u-boot.lds $( LDFLAGS_FINAL)
i f n e q ( $( CONFIG_SYS_TEXT_BASE ) , )
LDFLAGS_u-boot += -Ttext $( CONFIG_SYS_TEXT_BASE)
e n d i f
quiet_cmd_objcopy = OBJCOPY $@
cmd_objcopy = $( OBJCOPY) $( OBJCOPYFLAGS) $( OBJCOPYFLAGS_$( @F) ) $< $@
quiet_cmd_mkimage = UIMAGE $@
cmd_mkimage = $( objtree) /tools/mkimage $( MKIMAGEFLAGS_$( @F) ) -d $< $@ \
$( if $( KBUILD_VERBOSE:1= ) , >/dev/null)
quiet_cmd_cat = CAT $@
cmd_cat = cat $( filter-out $( PHONY) , $^) > $@
all : $( ALL -y )
PHONY += dtbs
dtbs dts/dt.dtb : checkdtc u -boot
$( Q) $( MAKE) $( build) = dts dtbs
u-boot-dtb.bin : u -boot .bin dts /dt .dtb FORCE
$( call if_changed,cat)
OBJCOPYFLAGS_u-boot.hex := -O ihex
OBJCOPYFLAGS_u-boot.srec := -O srec
u-boot.hex u-boot.srec : u -boot FORCE
$( call if_changed,objcopy)
OBJCOPYFLAGS_u-boot.bin := -O binary
u-boot.bin : u -boot FORCE
$( call if_changed,objcopy)
$( call DO_STATIC_RELA,$<,$@ ,$( CONFIG_SYS_TEXT_BASE) )
$( BOARD_SIZE_CHECK)
u-boot.ldr : u -boot
$( CREATE_LDR_ENV)
$( LDR) -T $( CONFIG_BFIN_CPU) -c $@ $< $( LDR_FLAGS)
$( BOARD_SIZE_CHECK)
OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex
OBJCOPYFLAGS_u-boot.ldr.srec := -I binary -O srec
u-boot.ldr.hex u-boot.ldr.srec : u -boot .ldr FORCE
$( call if_changed,objcopy)
#
# U-Boot entry point, needed for booting of full-blown U-Boot
# from the SPL U-Boot version.
#
i f n d e f C O N F I G _ S Y S _ U B O O T _ S T A R T
CONFIG_SYS_UBOOT_START := 0
e n d i f
MKIMAGEFLAGS_u-boot.img = -A $( ARCH) -T firmware -C none -O u-boot \
-a $( CONFIG_SYS_TEXT_BASE) -e $( CONFIG_SYS_UBOOT_START) \
-n " U-Boot $( UBOOTRELEASE) for $( BOARD) board "
MKIMAGEFLAGS_u-boot.kwb = -n $( CONFIG_SYS_KWD_CONFIG) -T kwbimage \
-a $( CONFIG_SYS_TEXT_BASE) -e $( CONFIG_SYS_TEXT_BASE)
MKIMAGEFLAGS_u-boot.pbl = -n $( CONFIG_SYS_FSL_PBL_RCW) \
-R $( CONFIG_SYS_FSL_PBL_PBI) -T pblimage
u-boot.img u-boot.kwb u-boot.pbl : u -boot .bin FORCE
$( call if_changed,mkimage)
u-boot.imx : u -boot .bin
$( Q) $( MAKE) $( build) = arch/arm/imx-common $( objtree) /$@
u-boot.sha1 : u -boot .bin
tools/ubsha1 u-boot.bin
u-boot.dis : u -boot
$( OBJDUMP) -d $< > $@
# $@ is output, $(1) and $(2) are inputs, $(3) is padded intermediate,
# $(4) is pad-to
SPL_PAD_APPEND = \
$( OBJCOPY) $( OBJCOPYFLAGS) --pad-to= $( 4) -I binary -O binary \
$( 1) $( 3) ; \
cat $( 3) $( 2) > $@ ; \
rm $( 3)
i f d e f C O N F I G _ T P L
SPL_PAYLOAD := tpl/u-boot-with-tpl.bin
e l s e
SPL_PAYLOAD := u-boot.bin
e n d i f
u-boot-with-spl.bin : spl /u -boot -spl .bin $( SPL_PAYLOAD )
$( call SPL_PAD_APPEND,$<,$( SPL_PAYLOAD) ,spl/u-boot-spl-pad.bin,$( CONFIG_SPL_PAD_TO) )
tpl/u-boot-with-tpl.bin : tpl /u -boot -tpl .bin u -boot .bin
$( call SPL_PAD_APPEND,$<,u-boot.bin,tpl/u-boot-tpl-pad.bin,$( CONFIG_TPL_PAD_TO) )
u-boot-with-spl.imx u-boot-with-nand-spl.imx : spl /u -boot -spl .bin u -boot .bin
$( Q) $( MAKE) $( build) = arch/arm/imx-common $( objtree) /$@
MKIMAGEFLAGS_u-boot.ubl = -n $( UBL_CONFIG) -T ublimage -e $( CONFIG_SYS_TEXT_BASE)
u-boot.ubl : u -boot -with -spl .bin FORCE
$( call if_changed,mkimage)
u-boot.ais : spl /u -boot -spl .bin u -boot .img
tools/mkimage -s -n $( if $( CONFIG_AIS_CONFIG_FILE) ,$( srctree) /$( CONFIG_AIS_CONFIG_FILE:"%" = %) ,"/dev/null" ) \
-T aisimage \
-e $( CONFIG_SPL_TEXT_BASE) \
-d spl/u-boot-spl.bin \
spl/u-boot-spl.ais
$( OBJCOPY) $( OBJCOPYFLAGS) -I binary \
--pad-to= $( CONFIG_SPL_MAX_SIZE) -O binary \
spl/u-boot-spl.ais spl/u-boot-spl-pad.ais
cat spl/u-boot-spl-pad.ais u-boot.img > u-boot.ais
u-boot.sb : u -boot .bin spl /u -boot -spl .bin
$( Q) $( MAKE) $( build) = arch/arm/cpu/arm926ejs/mxs $( objtree) /u-boot.sb
# On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
# Both images are created using mkimage (crc etc), so that the ROM
# bootloader can check its integrity. Padding needs to be done to the
# SPL image (with mkimage header) and not the binary. Otherwise the resulting image
# which is loaded/copied by the ROM bootloader to SRAM doesn't fit.
# The resulting image containing both U-Boot images is called u-boot.spr
u-boot.spr : u -boot .img spl /u -boot -spl .bin
tools/mkimage -A $( ARCH) -T firmware -C none \
-a $( CONFIG_SPL_TEXT_BASE) -e $( CONFIG_SPL_TEXT_BASE) -n XLOADER \
-d spl/u-boot-spl.bin $@
$( OBJCOPY) -I binary -O binary \
--pad-to= $( CONFIG_SPL_PAD_TO) --gap-fill= 0xff $@
cat u-boot.img >> $@
i f n e q ( $( CONFIG_TEGRA ) , )
u-boot-nodtb-tegra.bin : spl /u -boot -spl .bin u -boot .bin
$( OBJCOPY) $( OBJCOPYFLAGS) --pad-to= $( CONFIG_SYS_TEXT_BASE) -O binary spl/u-boot-spl spl/u-boot-spl-pad.bin
cat spl/u-boot-spl-pad.bin u-boot.bin > $@
rm spl/u-boot-spl-pad.bin
i f e q ( $( CONFIG_OF_SEPARATE ) , y )
u-boot-dtb-tegra.bin : u -boot -nodtb -tegra .bin dts /dt .dtb FORCE
$( call if_changed,cat)
e n d i f
e n d i f
u-boot-img.bin : spl /u -boot -spl .bin u -boot .img FORCE
$( call if_changed,cat)
# PPC4xx needs the SPL at the end of the image, since the reset vector
# is located at 0xfffffffc. So we can't use the "u-boot-img.bin" target
# and need to introduce a new build target with the full blown U-Boot
# at the start padded up to the start of the SPL image. And then concat
# the SPL image to the end.
u-boot-img-spl-at-end.bin : spl /u -boot -spl .bin u -boot .img
$( OBJCOPY) -I binary -O binary --pad-to= $( CONFIG_UBOOT_PAD_TO) \
--gap-fill= 0xff u-boot.img $@
cat spl/u-boot-spl.bin >> $@
# Create a new ELF from a raw binary file. This is useful for arm64
# where static relocation needs to be performed on the raw binary,
# but certain simulators only accept an ELF file (but don't do the
# relocation).
# FIXME refactor dts/Makefile to share target/arch detection
u-boot.elf : u -boot .bin
@$( OBJCOPY) -B aarch64 -I binary -O elf64-littleaarch64 \
$< u-boot-elf.o
@$( LD) u-boot-elf.o -o $@ \
--defsym= _start = $( CONFIG_SYS_TEXT_BASE) \
-Ttext= $( CONFIG_SYS_TEXT_BASE)
i f e q ( $( CONFIG_SANDBOX ) , y )
GEN_UBOOT = \
$( CC) $( SYMS) -T u-boot.lds \
-Wl,--start-group $( u-boot-main) -Wl,--end-group \
$( PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot
e l s e
GEN_UBOOT = \
$( LD) $( LDFLAGS) $( LDFLAGS_$( @F) ) \
$( u-boot-init) \
--start-group $( u-boot-main) --end-group $( PLATFORM_LIBS) \
-Map u-boot.map -o u-boot
e n d i f
u-boot : $( u -boot -init ) $( u -boot -main ) u -boot .lds
$( GEN_UBOOT)
i f e q ( $( CONFIG_KALLSYMS ) , y )
smap = ` $( call SYSTEM_MAP,u-boot) | \
awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\\\000"}' ` ; \
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
$( CC) $( c_flags) -DSYSTEM_MAP= " \" $$ {smap}\" " \
-c $( srctree) /common/system_map.c -o common/system_map.o
$( GEN_UBOOT) common/system_map.o
e n d i f
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
$(sort $(u-boot-init) $(u-boot-main)) : $( u -boot -dirs ) ;
# Handle descending into subdirectories listed in $(vmlinux-dirs)
# Preset locale variables to speed up the build process. Limit locale
# tweaks to this spot to avoid wrong language settings when running
# make menuconfig etc.
# Error messages still appears in the original language
PHONY += $( u-boot-dirs)
$(u-boot-dirs) : prepare scripts
$( Q) $( MAKE) $( build) = $@
tools : prepare
# The "tools" are needed early
$(filter-out tools, $(u-boot-dirs)) : tools
# The "examples" conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
# is "yes"), so compile examples after U-Boot is compiled.
examples : $( filter -out examples , $ ( u -boot -dirs ) )
d e f i n e f i l e c h k _ u b o o t . r e l e a s e
echo " $( UBOOTVERSION) $$ ( $( CONFIG_SHELL) $( srctree) /scripts/setlocalversion $( srctree) ) "
e n d e f
# Store (new) UBOOTRELEASE string in include/config/uboot.release
include/config/uboot.release : Makefile FORCE
$( call filechk,uboot.release)
# Things we need to do before we recursively start building the kernel
# or the modules are listed in "prepare".
# A multi level approach is used. prepareN is processed before prepareN-1.
# archprepare is used in arch Makefiles and when processed asm symlink,
# version.h and scripts_basic is processed / created.
# Listed in dependency order
PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
# prepare3 is used to check if we are building in a separate output directory,
# and if so do:
# 1) Check that make has not been executed in the kernel src $(srctree)
prepare3 : include /config /uboot .release
i f n e q ( $( KBUILD_SRC ) , )
@$( kecho) ' Using $(srctree) as source for u-boot'
$( Q) if [ -f $( srctree) /include/config.mk ] ; then \
echo >& 2 " $( srctree) is not clean, please run 'make mrproper' " ; \
echo >& 2 " in the ' $( srctree) ' directory. " ; \
/bin/false; \
fi ;
e n d i f
# prepare2 creates a makefile if using a separate output directory
prepare2 : prepare 3 outputmakefile
prepare1 : prepare 2 $( version_h ) $( timestamp_h )
@:
archprepare : prepare 1 scripts_basic
prepare0 : archprepare FORCE
$( Q) $( MAKE) $( build) = .
# All the preparing..
prepare : prepare 0
# Generate some files
# ---------------------------------------------------------------------------
d e f i n e f i l e c h k _ v e r s i o n . h
( echo \# define PLAIN_VERSION \" $( UBOOTRELEASE) \" ; \
echo \# define U_BOOT_VERSION \" U-Boot \" PLAIN_VERSION; \
echo \# define CC_VERSION_STRING \" $$ ( $( CC) --version | head -n 1) \" ; \
echo \# define LD_VERSION_STRING \" $$ ( $( LD) --version | head -n 1) \" ; )
e n d e f
d e f i n e f i l e c h k _ t i m e s t a m p . h
( LC_ALL = C date +'#define U_BOOT_DATE "%b %d %C%y"' ; \
LC_ALL = C date +'#define U_BOOT_TIME "%T"' )
e n d e f
$(version_h) : $( srctree ) /Makefile FORCE
$( call filechk,version.h)
$(timestamp_h) : $( srctree ) /Makefile FORCE
$( call filechk,timestamp.h)
#
# Auto-generate the autoconf.mk file (which is included by all makefiles)
#
# This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
# the dep file is only include in this top level makefile to determine when
# to regenerate the autoconf.mk file.
quiet_cmd_autoconf_dep = GEN $@
cmd_autoconf_dep = $( CC) -x c -DDO_DEPS_ONLY -M $( c_flags) \
-MQ include/autoconf.mk $( srctree) /include/common.h > $@ || rm $@
include/autoconf.mk.dep : include /config .h include /common .h
$( call cmd,autoconf_dep)
quiet_cmd_autoconf = GEN $@
cmd_autoconf = \
$( CPP) $( c_flags) -DDO_DEPS_ONLY -dM $( srctree) /include/common.h > $@ .tmp && \
sed -n -f $( srctree) /tools/scripts/define2mk.sed $@ .tmp > $@ ; \
rm $@ .tmp
include/autoconf.mk : include /config .h
$( call cmd,autoconf)
# ---------------------------------------------------------------------------
PHONY += depend dep
depend dep :
@echo '*** Warning: make $@ is unnecessary now.'
# ---------------------------------------------------------------------------
u-boot.lds : $( LDSCRIPT ) prepare
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
11 years ago
$( CPP) $( cpp_flags) $( LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@
PHONY += nand_spl
nand_spl : prepare
$( Q) $( MAKE) $( build) = nand_spl/board/$( BOARDDIR) all
nand_spl/u-boot-spl-16k.bin : nand_spl
@:
u-boot-nand.bin : nand_spl /u -boot -spl -16k .bin u -boot .bin FORCE
$( call if_changed,cat)
spl/u-boot-spl.bin : tools prepare
$( Q) $( MAKE) obj = spl -f $( srctree) /spl/Makefile all
tpl/u-boot-tpl.bin : tools prepare
$( Q) $( MAKE) obj = tpl -f $( srctree) /spl/Makefile all CONFIG_TPL_BUILD = y
TAG_SUBDIRS := $( u-boot-dirs) include
FIND := find
FINDFLAGS := -L
PHONY += checkstack
checkstack :
$( OBJDUMP) -d u-boot $$ ( find . -name u-boot-spl) | \
$( PERL) $( src) /scripts/checkstack.pl $( ARCH)
tags ctags :
ctags -w -o ctags ` $( FIND) $( FINDFLAGS) $( TAG_SUBDIRS) \
-name '*.[chS]' -print`
etags :
etags -a -o $( obj) etags ` $( FIND) $( FINDFLAGS) $( TAG_SUBDIRS) \
-name '*.[chS]' -print`
cscope :
$( FIND) $( FINDFLAGS) $( TAG_SUBDIRS) -name '*.[chS]' -print > \
cscope.files
cscope -b -q -k
SYSTEM_MAP = \
$( NM) $1 | \
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
LC_ALL = C sort
System.map : u -boot
@$( call SYSTEM_MAP,$<) > $@
checkthumb :
@if test $( call cc-version) -lt 0404; then \
echo -n '*** Your GCC does not produce working ' ; \
echo 'binaries in THUMB mode.' ; \
echo '*** Your board is configured for THUMB mode.' ; \
false; \
fi
# GCC 3.x is reported to have problems generating the type of relocation
# that U-Boot wants.
# See http://lists.denx.de/pipermail/u-boot/2012-September/135156.html
checkgcc4 :
@if test $( call cc-version) -lt 0400; then \
echo -n '*** Your GCC is too old, please upgrade to GCC 4.x or newer' ; \
false; \
fi
checkdtc :
@if test $( call dtc-version) -lt 0104; then \
echo '*** Your dtc is too old, please upgrade to dtc 1.4 or newer' ; \
false; \
fi
#########################################################################
# ARM relocations should all be R_ARM_RELATIVE (32-bit) or
# R_AARCH64_RELATIVE (64-bit).
checkarmreloc : u -boot
@RELOC= " ` $( CROSS_COMPILE) readelf -r -W $< | cut -d ' ' -f 4 | \
grep R_A | sort -u` " ; \
if test " $$ RELOC " != "R_ARM_RELATIVE" -a \
" $$ RELOC " != "R_AARCH64_RELATIVE" ; then \
echo " $< contains unexpected relocations: $$ RELOC " ; \
false; \
fi
env : scripts_basic
$( Q) $( MAKE) $( build) = tools/$@
tools-all : HOST_TOOLS_ALL =y
tools-all : env tools ;
.PHONY : CHANGELOG
CHANGELOG :
git log --no-merges U-Boot-1_1_5.. | \
unexpand -a | sed -e 's/\s\s*$$//' > $@
include/license.h : tools /bin 2header COPYING
cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip > include/license.h
#########################################################################
###
# Cleaning is done on three levels.
# make clean Delete most generated files
# Leave enough to build external modules
# make mrproper Delete the current configuration, and all generated files
# make distclean Remove editor backup files, patch leftover files and the like
# Directories & files removed with 'make clean'
CLEAN_DIRS += $( MODVERDIR)
CLEAN_FILES += u-boot.lds include/bmp_logo.h include/bmp_logo_data.h \
board/*/config.tmp board/*/*/config.tmp \
include/autoconf.mk* include/spl-autoconf.mk \
include/tpl-autoconf.mk
# Directories & files removed with 'make clobber'
CLOBBER_DIRS += $( patsubst %,spl/%, $( filter-out Makefile, \
$( shell ls -1 spl 2>/dev/null) ) ) \
tpl
CLOBBER_FILES += u-boot* MLO* SPL System.map nand_spl/u-boot*
# Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config include/generated
MRPROPER_FILES += .config .config.old \
tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
include/config.h include/config.mk
# clean - Delete most, but leave enough to build external modules
#
clean : rm -dirs := $( CLEAN_DIRS )
clean : rm -files := $( CLEAN_FILES )
clean-dirs := $( foreach f,$( u-boot-alldirs) ,$( if $( wildcard $f /Makefile) ,$f ) )
clean-dirs := $( addprefix _clean_, $( clean-dirs) doc/DocBook)
PHONY += $( clean-dirs) clean archclean
$(clean-dirs) :
$( Q) $( MAKE) $( clean) = $( patsubst _clean_%,%,$@ )
# TODO: Do not use *.cfgtmp
clean : $( clean -dirs )
$( call cmd,rmdirs)
$( call cmd,rmfiles)
@find $( if $( KBUILD_EXTMOD) , $( KBUILD_EXTMOD) , .) $( RCS_FIND_IGNORE) \
\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
-o -name '*.ko.*' -o -name '*.su' -o -name '*.cfgtmp' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
-o -name '*.symtypes' -o -name 'modules.order' \
-o -name modules.builtin -o -name '.tmp_*.o.*' \
-o -name '*.gcno' \) -type f -print | xargs rm -f
@find $( if $( KBUILD_EXTMOD) , $( KBUILD_EXTMOD) , .) $( RCS_FIND_IGNORE) \
-path './nand_spl/*' -type l -print | xargs rm -f
# clobber
#
clobber : rm -dirs := $( CLOBBER_DIRS )
clobber : rm -files := $( CLOBBER_FILES )
PHONY += clobber
clobber : clean
$( call cmd,rmdirs)
$( call cmd,rmfiles)
# mrproper - Delete all generated files, including .config
#
mrproper : rm -dirs := $( wildcard $ ( MRPROPER_DIRS ) )
mrproper : rm -files := $( wildcard $ ( MRPROPER_FILES ) )
mrproper-dirs := $( addprefix _mrproper_,scripts)
PHONY += $( mrproper-dirs) mrproper archmrproper
$(mrproper-dirs) :
$( Q) $( MAKE) $( clean) = $( patsubst _mrproper_%,%,$@ )
mrproper : clobber $( mrproper -dirs )
$( call cmd,rmdirs)
$( call cmd,rmfiles)
@rm -f arch/*/include/asm/arch arch/*/include/asm/proc
# distclean
#
PHONY += distclean
distclean : mrproper
@find $( srctree) $( RCS_FIND_IGNORE) \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' \
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
-type f -print | xargs rm -f
backup :
F = ` basename $( TOPDIR) ` ; cd .. ; \
gtar --force-local -zcvf ` LC_ALL = C date " + $$ F-%Y-%m-%d-%T.tar.gz " ` $$ F
# Documentation targets
# ---------------------------------------------------------------------------
%docs : scripts_basic FORCE
$( Q) $( MAKE) $( build) = scripts build_docproc
$( Q) $( MAKE) $( build) = doc/DocBook $@
# Dummies...
PHONY += prepare scripts
prepare : ;
scripts : ;
e n d i f #ifeq ($(config-targets),1)
e n d i f #ifeq ($(mixed-targets),1)
quiet_cmd_rmdirs = $( if $( wildcard $( rm-dirs) ) ,CLEAN $( wildcard $( rm-dirs) ) )
cmd_rmdirs = rm -rf $( rm-dirs)
quiet_cmd_rmfiles = $( if $( wildcard $( rm-files) ) ,CLEAN $( wildcard $( rm-files) ) )
cmd_rmfiles = rm -f $( rm-files)
# read all saved command lines
targets := $( wildcard $( sort $( targets) ) )
cmd_files := $( wildcard .*.cmd $( foreach f,$( targets) ,$( dir $( f) ) .$( notdir $( f) ) .cmd) )
i f n e q ( $( cmd_files ) , )
$( cmd_files) : ; # Do not try to update included dependency files
include $( cmd_files)
e n d i f
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
# Usage:
# $(Q)$(MAKE) $(clean)=dir
clean := -f $( if $( KBUILD_SRC) ,$( srctree) /) scripts/Makefile.clean obj
e n d i f # skip-makefile
PHONY += FORCE
FORCE :
# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable so we can use it in if_changed and friends.
.PHONY : $( PHONY )