aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-25 13:06:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-25 13:06:30 -0500
commit5e2fda4776bb94ee47314e71cefaa8a104f8f4ab (patch)
tree56b316ddbd27ccf63c470f84dd9f0fad39b5100f /scripts
parentf61ec2c97cf8a517cd5714efc919138a9d8991cf (diff)
parent10aaa3b7e95b9649fd658ac7e9075093316425d8 (diff)
Merge tag 'kbuild-v4.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull more Kbuild updates from Masahiro Yamada: - use 'pwd' instead of '/bin/pwd' for portability - clean up Makefiles - fix ld-option for clang - fix malloc'ed data size in Kconfig - fix parallel building along with coccicheck - fix a minor issue of package building - prompt to use "rpm-pkg" instead of "rpm" - clean up *.i and *.lst patterns by "make clean" * tag 'kbuild-v4.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: drop $(extra-y) from real-objs-y kbuild: clean up *.i and *.lst patterns by make clean kbuild: rpm: prompt to use "rpm-pkg" if "rpm" target is used kbuild: pkg: use --transform option to prefix paths in tar coccinelle: fix parallel build with CHECK=scripts/coccicheck kconfig/symbol.c: use correct pointer type argument for sizeof kbuild: Set KBUILD_CFLAGS before incl. arch Makefile kbuild: remove all dummy assignments to obj- kbuild: create built-in.o automatically if parent directory wants it kbuild: /bin/pwd -> pwd
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build4
-rw-r--r--scripts/Makefile.lib2
-rwxr-xr-xscripts/coccicheck15
-rw-r--r--scripts/kconfig/symbol.c2
-rw-r--r--scripts/package/Makefile7
5 files changed, 16 insertions, 14 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 65ea1e6aaaf6..cb8997ed0149 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -76,7 +76,7 @@ lib-target := $(obj)/lib.a
76obj-y += $(obj)/lib-ksyms.o 76obj-y += $(obj)/lib-ksyms.o
77endif 77endif
78 78
79ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),) 79ifneq ($(strip $(obj-y) $(need-builtin)),)
80builtin-target := $(obj)/built-in.o 80builtin-target := $(obj)/built-in.o
81endif 81endif
82 82
@@ -566,7 +566,7 @@ targets := $(filter-out $(PHONY), $(targets))
566 566
567PHONY += $(subdir-ym) 567PHONY += $(subdir-ym)
568$(subdir-ym): 568$(subdir-ym):
569 $(Q)$(MAKE) $(build)=$@ 569 $(Q)$(MAKE) $(build)=$@ need-builtin=$(if $(findstring $@,$(subdir-obj-y)),1)
570 570
571# Add FORCE to the prequisites of a target to force it to be always rebuilt. 571# Add FORCE to the prequisites of a target to force it to be always rebuilt.
572# --------------------------------------------------------------------------- 572# ---------------------------------------------------------------------------
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 08eb40a7729f..1ca4dcd2d500 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -57,7 +57,7 @@ multi-objs-m := $(foreach m, $(multi-used-m), $($(m:.o=-objs)) $($(m:.o=-y)))
57subdir-obj-y := $(filter %/built-in.o, $(obj-y)) 57subdir-obj-y := $(filter %/built-in.o, $(obj-y))
58 58
59# Replace multi-part objects by their individual parts, look at local dir only 59# Replace multi-part objects by their individual parts, look at local dir only
60real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y) 60real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
61real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) 61real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m)))
62 62
63# DTB 63# DTB
diff --git a/scripts/coccicheck b/scripts/coccicheck
index d5f28d5044e7..ecfac64b39fe 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -30,12 +30,6 @@ else
30 VERBOSE=0 30 VERBOSE=0
31fi 31fi
32 32
33if [ -z "$J" ]; then
34 NPROC=$(getconf _NPROCESSORS_ONLN)
35else
36 NPROC="$J"
37fi
38
39FLAGS="--very-quiet" 33FLAGS="--very-quiet"
40 34
41# You can use SPFLAGS to append extra arguments to coccicheck or override any 35# You can use SPFLAGS to append extra arguments to coccicheck or override any
@@ -70,6 +64,9 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
70 # Take only the last argument, which is the C file to test 64 # Take only the last argument, which is the C file to test
71 shift $(( $# - 1 )) 65 shift $(( $# - 1 ))
72 OPTIONS="$COCCIINCLUDE $1" 66 OPTIONS="$COCCIINCLUDE $1"
67
68 # No need to parallelize Coccinelle since this mode takes one input file.
69 NPROC=1
73else 70else
74 ONLINE=0 71 ONLINE=0
75 if [ "$KBUILD_EXTMOD" = "" ] ; then 72 if [ "$KBUILD_EXTMOD" = "" ] ; then
@@ -77,6 +74,12 @@ else
77 else 74 else
78 OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE" 75 OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE"
79 fi 76 fi
77
78 if [ -z "$J" ]; then
79 NPROC=$(getconf _NPROCESSORS_ONLN)
80 else
81 NPROC="$J"
82 fi
80fi 83fi
81 84
82if [ "$KBUILD_EXTMOD" != "" ] ; then 85if [ "$KBUILD_EXTMOD" != "" ] ; then
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 20136ffefb23..3c8bd9bb4267 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -1061,7 +1061,7 @@ struct symbol **sym_re_search(const char *pattern)
1061 } 1061 }
1062 if (sym_match_arr) { 1062 if (sym_match_arr) {
1063 qsort(sym_match_arr, cnt, sizeof(struct sym_match), sym_rel_comp); 1063 qsort(sym_match_arr, cnt, sizeof(struct sym_match), sym_rel_comp);
1064 sym_arr = malloc((cnt+1) * sizeof(struct symbol)); 1064 sym_arr = malloc((cnt+1) * sizeof(struct symbol *));
1065 if (!sym_arr) 1065 if (!sym_arr)
1066 goto sym_re_search_free; 1066 goto sym_re_search_free;
1067 for (i = 0; i < cnt; i++) 1067 for (i = 0; i < cnt; i++)
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 9ed96aefc72d..c23534925b38 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -39,14 +39,13 @@ if test "$(objtree)" != "$(srctree)"; then \
39 false; \ 39 false; \
40fi ; \ 40fi ; \
41$(srctree)/scripts/setlocalversion --save-scmversion; \ 41$(srctree)/scripts/setlocalversion --save-scmversion; \
42ln -sf $(srctree) $(2); \
43tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \ 42tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \
44 $(addprefix $(2)/,$(TAR_CONTENT) $(3)); \ 43 --transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \
45rm -f $(2) $(objtree)/.scmversion 44rm -f $(objtree)/.scmversion
46 45
47# rpm-pkg 46# rpm-pkg
48# --------------------------------------------------------------------------- 47# ---------------------------------------------------------------------------
49rpm-pkg rpm: FORCE 48rpm-pkg: FORCE
50 $(MAKE) clean 49 $(MAKE) clean
51 $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec 50 $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
52 $(call cmd,src_tar,$(KERNELPATH),kernel.spec) 51 $(call cmd,src_tar,$(KERNELPATH),kernel.spec)