Enough time has passed since "make depend" was deprecated.
Nobody would be in trouble without this hint.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
This driver uses NAND_ECC_HW_SYNDROME mode. The nand_scan_tail()
function would not complain about missing ecc->calculate,
ecc->correct, ecc->hwctl handlers.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
This line converts PHYS_OFFSET into PHYS_PFN_OFFSET.
It is better to use PAGE_SHIFT rather than the magic number 12.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Nicolas Pitre <[email protected]>
Signed-off-by: Russell King <[email protected]>
This comment does not correspond to the actual code.
When zImage is loaded at a lower *OR* higher address of
the destination of Image, it won't overwrite itself.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Nicolas Pitre <[email protected]>
Signed-off-by: Russell King <[email protected]>
The current rounding of "size" is wrong:
- If "start" is sufficiently near the next page boundary, "size"
is decremented by more than enough and the last page is lost.
- If "size" is sufficiently small, it is wrapped around and gets
a bogus value.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]>
Acked-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Russell King <[email protected]>
CONFIG_GCOV_FORMAT_3_4 / _4_7 / _AUTODETECT are exclusive.
Compare the CC version only when _AUTODETECT is enabled.
This change should have no impact.
Signed-off-by: Masahiro Yamada <[email protected]>
Cc: Peter Oberparleiter <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
The macro "try-run" can have an argument for each of true and false
cases. Having an argument for the false case of cc-ifversion (and
ld-ifversion) would be useful too.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Kbuild descends into kernel/gcov/ directory only when
CONFIG_GCOV_KERNEL is enabled. (See kernel/Makefile)
CONFIG_GCOV_KERNEL check can be omitted in kernel/gcov/Makefile.
Signed-off-by: Masahiro Yamada <[email protected]>
Cc: Peter Oberparleiter <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Since commit 371fdc77af (kbuild: collect shorthands into
scripts/Kbuild.include), scripts/Makefile.clean includes
scripts/Kbuild.include.
The workaround and the comment block in kernel/gcov/Makefile
are no longer necessary.
Signed-off-by: Masahiro Yamada <[email protected]>
Cc: Peter Oberparleiter <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
The macros cc-version, cc-fullversion and ld-version take no argument.
It is not necessary to add $(call ...) to invoke them.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Helge Deller <[email protected]> [parisc]
Signed-off-by: Michal Marek <[email protected]>
The macro "cc-version" takes no argument. Drop $(CC) from the
"cc-ifversion" definition.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Now $(version_h) is include/generated/uapi/linux/version.h.
$(version_h) in MRPROPER_FILES is redundant because it is covered
by include/generated in MRPROPER_DIRS.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
"make kvmconfig" expects that the .config has already been created,
but some people might want to create the .config and run kvmconfig
in one shot command, like this:
$ make defconfig kvmconfig
To make sure this command works correctly even if -j* option is set,
we must handle them one by one.
This commit turns on mixed-targets when $(MAKECMDGOALS) includes
at least one config target and also includes another target.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Other than GCC, we have another choice, Clang for building the kernel
these days. It seems better to say "compiler" rather than "gcc".
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
This line produces an extra comment line for bounds.h and
asm-offsets.h.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
The rules "cmd_bounds" and "cmd_offsets" are almost the same.
(The difference is only the include guards.) They can be merged.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
A typo "header=y" was introduced by commit 7071cf7fc4
(uapi: add missing network related headers to kbuild).
Signed-off-by: Masahiro Yamada <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Passing -rR for "make headers_install" is redundant because
the top Makefile has already set -rR to MAKEFLAGS.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
The shorthand "clean" is defined in both the top Makefile and
scripts/Makefile.clean. Likewise, the "hdr-inst" is defined in
both the top Makefile and scripts/Makefile.headersinst.
To reduce code duplication, this commit collects them into
scripts/Kbuild.include like the "build" and "modbuiltin" shorthands.
It requires scripts/Makefile.clean to include scripts/Kbuild.include,
but its impact on the performance of "make clean" should be
negligible.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
$(if $(KBUILD_SRC),$(srctree)/) was a useful strategy
to omit a long absolute path for in-source-tree build
prior to commit 890676c65d
(kbuild: Use relative path when building in the source tree).
Now $(srctree) is "." when building in the source tree.
It would not be annoying to add "$(srctree)/" all the time.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
The definition of "comma" exists in scripts/Kbuild.include.
We should not double it.
Signed-off-by: Masahiro Yamada <[email protected]>
Cc: [email protected]
Signed-off-by: Michal Marek <[email protected]>
Kconfig never defines CONFIG_* as 'n'.
Now obj-n is only used in firmware/Makefile and it can be
replaced with obj-. No makefile uses lib-n.
Let's rip off obj-n and lib-n.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Peter Foley <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Clearing obj-y, obj-m, obj-n, obj- in each Makefile is
a useless habit.
They are non-exported variables; therefore they are always empty
whenever descending into each subdirectory.
(Moreorver, obj-y and obj-m are also set to empty at the beginning
of scripts/Makefile.build)
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Acked-by: Peter Foley <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
In these Makefiles, at least one of "obj-y" and "obj-" is non-empty,
hence built-in.o is always created without such a trick.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Peter Foley <[email protected]>
Acked-by: Mike Turquette <[email protected]>
Acked-by: Simon Horman <[email protected]> [shmobile]
Acked-by: David S. Miller <[email protected]> [networking]
Signed-off-by: Michal Marek <[email protected]>
This commit avoids processing C=... and M=... twice
when O=... is also given.
Besides, we can also remove KBUILD_EXTMOD="$(KBUILD_EXTMOD)"
in the sub-make target.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Peter Foley <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Since commit 066b7ed955
(kbuild: Do not print the build directory with make -s),
"Q" is defined above the sub-make target.
This commit takes advantage of that and replaces
"$(if $(KBUILD_VERBOSE:1=),@)" with "$(Q)".
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Peter Foley <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Commit c2e28dc975
(kbuild: Print the name of the build directory)
added a gimmick to show the "Entering directory ...".
Instead of echoing the hard-coded message (that is, we need to know
the exact message), moving --no-print-directory would be easier.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Peter Foley <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
- Fix indents
- Do not break a line unless it is longer than 80 columns
- Do not insert a whitespace before ';'
- Use whitespaces around operators
- Use braces for a "else" block where the "if" block uses ones.
Besides, eliminate all the warnings reported by checkpatch.pl:
- WARNING: quoted string split across lines
- WARNING: else is not generally useful after a break or return
- WARNING: Missing a blank line after declarations
- WARNING: Avoid line continuations in quoted strings
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
We should use parentheses only when they are necessary
or they really improve the readability.
Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
It looks like this header file is a concatenation of two headers.
Anyway, the include guard should be renamed and placed at the correct
postion and the license block in the middle should be deleted.
Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
The variable "retry" in wait_for_irq() is set, but not used.
Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
All of these variables are initialized to zero and then
set to a different value below.
Zero-initializing is redundant.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
We should use
/*
* Blah Blah ...
* ...
*/
for multi-line comment blocks.
In addition, refactor some comments where it seems reasonable and
remove some comments where the code is clear enough such as:
/* clear interrupts */
clear_interrupts(denali);
Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
MAP10 command with '0x2000' data sets up a read-ahead/write access.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
Now mconf, qconf, gconf, nconf are always added to hostprogs-y.
Files added to hostprogs-y are removed by "make clean".
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Now it is harmless to add all host programs to hostprogs-y.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Assume we have a Makefile like:
hostprogs-y := foo bar
foo-objs := foo1.o foo2.o
bar-objs := bar1.o bar2.o
Without this commit, the host program foo depends on all of
foo1.o foo2.o bar1.o bar2.o.
This commit allows to handle the dependency of each host program
separately.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
The comment in scripts/Makefile.build says as follows:
We would rather have a list of rules like
foo.o: $(foo-objs)
but that's not so easy, so we rather make all composite objects depend
on the set of all their parts
This commit makes it possible!
For example, assume a Makefile like this
obj-m = foo.o bar.o
foo-objs := foo1.o foo2.o
bar-objs := bar1.o bar2.o
Without this patch, foo.o depends on all of
foo1.o foo2.o bar1.o bar2.o.
It looks funny that foo.o is regenerated when bar1.c is updated.
Now we can handle the dependency of foo.o and bar.o separately.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
The specification of Python 3 is largely different from that of
Python 2.
For example, arch/ia64/scripts/unwcheck.py seems to be written
in Python 2, not compatible with Python 3.
It is not a good idea to invoke python scripts with the hard-coded
command name 'python'. The command 'python' could possibly be
Python 3 on some systems.
For that case, it is reasonable to allow to override the command name
by giving 'PYTHON=python2' from the command line.
The 'python' in arch/ia64/Makefile should be replaced with '$(PYTHON)'.
Signed-off-by: Masahiro Yamada <[email protected]>
Cc: [email protected]
Signed-off-by: Michal Marek <[email protected]>
Assume we have a Makefile like this:
hostprogs-y := foo
foo-cxxobjs := bar/baz.o
foo-objs := qux/quux.o
In this case, Kbuild creates bar/ directory,
but fails to create qux/ directory.
This commit re-writes directory creation more simply,
fixing that bug.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
The directory creation can be more simplified by two levels.
[1] Drop $(dir ...)
$(dir $(f)) always returns non-empty string.
So, $(if $(dir $(f)),$(dir $(f)) is equivalent to $(dir $(f)).
[2] Unroll $(foreach ...) loop
$(dir ...) can take one or more arguments and returns a list of
directories of them.
$(foreach f, $(progs), $(dir $(f))) can be unrolled as $(dir $(progs)).
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
The shared library feature in Makefile.host is no longer used.
Rip it off to keep the build infrastucture simple.
Update Documentation/kbuild/makefiles.txt too.
The section "4.3 Definition shared libraries" should be removed
and the following sections should be re-numbered.
Signed-off-by: Masahiro Yamada <[email protected]>
Suggested-by: Sam Ravnborg <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
The comment claims:
C++ executables compiled from at least one .cc file
and zero or more .c files
But C++ executables with zero .c file fail in build.
For example, assume we have a Makefile like this:
hostprogs-y := foo
foo-cxxobjs := bar.o
In this case, foo is treated as host-csingle
and Kbuild tries to search non-existing foo.c source.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Files added to hostprogs-y are cleaned. (See scripts/Makefile.clean)
Adding them to clean-files is redundant.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Paul Moore <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
For example,
$ scripts/objdiff record init drivers/usb
disassembles all the objects under init and drivers/usb directories.
This feature would be useful when we change various files under the
specific directory.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Jason Cooper <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Prior to this commit, the command "scripts/objdiff record path/to/*.o"
disassembled the given object into ".tmp_objdiff/path/to/*.o" file.
The problem here is that recorded disassemblies are lost if we run
"make clean" because it removes all the *.o files.
Disassembled code should be dumped into *.dis instead of *.o files.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Jason Cooper <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Prior to this commit, scripts/objdiff expected to be run at the top
directory and only the relative path of objects.
This commit provides more flexibility in terms of object path:
[1] scripts/objdiff can be run in any directory
For example,
$ scripts/objdiff record init/main.o
and
$ cd init; ../scripts/objdiff record main.o
produce the same result.
[2] Support absolute path for objects
$ scripts/objdiff record /home/foo/bar/linux/init/main.o
work as well.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Jason Cooper <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
The directories for objdump is created by the code
a few lines below:
[ ! -d "$OBJDIFFD/$dn" ] && mkdir -p "$OBJDIFFD/$dn"
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Jason Cooper <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
This commit is a minor refactoring.
Temporary files for objdiff are stored in .tmp_objdiff directory
which is located at the top directory.
To get the path to this directory,
SRCTREE=`git rev-parse --show-toplevel`
TMPD=$SRCTREE/.tmp_objdiff
seems easier to understand than
GIT_DIR=`git rev-parse --git-dir`
TMPD=${GIT_DIR%git}tmp_objdiff
Besides, it is not always necessary to create .tmp_objdiff dicrectory.
It should be created only for "record" command.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Jason Cooper <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
The directory include/config is used only for
silentoldconfig, localmodconfig, localyesconfig.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
There are no generated files under include/linux directory.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
scripts/Makefile adds "selinux" to subdir-y or subdir- twice.
subdir-$(CONFIG_MODVERSIONS) += genksyms
subdir-y += mod
subdir-$(CONFIG_SECURITY_SELINUX) += selinux <--- here
subdir-$(CONFIG_DTC) += dtc
# Let clean descend into subdirs
subdir- += basic kconfig package selinux <--- again
The latter is redundant.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Kbuild is supposed to support mixed targets. (%config and build targets)
But "make all" did nothing if it was run with configuration targets.
For example,
$ LANG=C make defconfig all
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
*** Default configuration is based on 'x86_64_defconfig'
#
# configuration written to .config
#
make: Nothing to be done for `all'.
This commits allows "make %config all" and makes sure
mixed targets are built one by one in the given order.
Signed-off-by: Masahiro Yamada <[email protected]>
Cc: Michal Marek <[email protected]>
CC: Sam Ravnborg <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
W=... provides extra gcc checks.
Having such code in scripts/Makefile.build results in the same flags
being added to KBUILD_CFLAGS multiple times becuase
scripts/Makefile.build is invoked every time Kbuild descends into
the subdirectories.
Since the top Makefile is already too cluttered, this commit moves
all of extra gcc check stuff to a new file scripts/Makefile.extrawarn,
which is included from the top Makefile.
Signed-off-by: Masahiro Yamada <[email protected]>
CC: Sam Ravnborg <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
When we build an already built kernel again, arch/x86/syscalls/Makefile
and arch/x86/tools/Makefile emits "Nothing to be done for ..."
messages.
Here is the command log:
$ make defconfig
[ snip ]
$ make
[ snip ]
$ make
make[1]: Nothing to be done for `all'. <-----
make[1]: Nothing to be done for `relocs'. <-----
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
Besides not emitting those, "all" and "relocs" should be added to PHONY as well.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Peter Foley <[email protected]>
Acked-by: Michal Marek <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Kbuild supports saving output files in a separate directory.
But the build directory must be created beforehand. For example,
$ mkdir -p dir/to/store/output/files
$ make O=dir/to/store/output/files defconfig
Creating a build directory automatically would be useful.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
'.*.cmd' files are cleaned-up by "make clean".
The same pattern in "make distclean" is unnecessary.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
It is not a good idea to describe
%.xml: %.tmpl FORCE
...
and
$(BOOKS): $(KERNELDOC)
separately. This cannot detect missing template files.
For example, add something to DOCBOOKS variable:
DOCBOOKS += foobar.xml
and run
make xmldocs
It will succeed even if Documention/DocBook/foobar.tmpl
does not exist.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
PHONY target is more suitable for "build_docproc" target.
Because PHONY targets are always executed, they do not
have to take FORCE as a prerequisite.
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>