History

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

Linus Torvalds committed 8 years ago

Commit 5e2fda42 parents f61ec2c 10aaa3b29 files · +58 −113Browse files

Showing the changes to scripts (5 of 29 files). Show all

Unified · Split

5 files
  1. scripts/Makefile.build +2 −2
  2. scripts/Makefile.lib +1 −1
  3. scripts/coccicheck +9 −6
  4. scripts/kconfig/symbol.c +1 −1
  5. scripts/package/Makefile +3 −4
scripts/Makefile.build+2−2
@@ -76,7 +76,7 @@ lib-target := $(obj)/lib.a · 75 unmodified lines
76obj-y += $(obj)/lib-ksyms.o76obj-y += $(obj)/lib-ksyms.o
77endif77endif
78 78
79ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),)79ifneq ($(strip $(obj-y) $(need-builtin)),)
80builtin-target := $(obj)/built-in.o80builtin-target := $(obj)/built-in.o
81endif81endif
82 82
@@ -566,7 +566,7 @@ targets := $(filter-out $(PHONY), $(targets)) · 483 unmodified lines
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# ---------------------------------------------------------------------------
scripts/Makefile.lib+1−1
@@ -57,7 +57,7 @@ multi-objs-m := $(foreach m, $(multi-used-m), $($(m:.o=-objs)) $($(m:.o=-y))) · 56 unmodified lines
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 only59# 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# DTB63# DTB
scripts/coccicheck+9−6
@@ -30,12 +30,6 @@ else · 29 unmodified lines
30 VERBOSE=030 VERBOSE=0
31fi31fi
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 any35# You can use SPFLAGS to append extra arguments to coccicheck or override any
@@ -70,6 +64,9 @@ if [ "$C" = "1" -o "$C" = "2" ]; then · 28 unmodified lines
70 # Take only the last argument, which is the C file to test64 # 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
73else70else
74 ONLINE=071 ONLINE=0
75 if [ "$KBUILD_EXTMOD" = "" ] ; then72 if [ "$KBUILD_EXTMOD" = "" ] ; then
@@ -77,6 +74,12 @@ else · 1 unmodified line
77 else74 else
78 OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE"75 OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE"
79 fi76 fi
77
78 if [ -z "$J" ]; then
79 NPROC=$(getconf _NPROCESSORS_ONLN)
80 else
81 NPROC="$J"
82 fi
80fi83fi
81 84
82if [ "$KBUILD_EXTMOD" != "" ] ; then85if [ "$KBUILD_EXTMOD" != "" ] ; then
scripts/kconfig/symbol.c+1−1
@@ -1061,7 +1061,7 @@ struct symbol **sym_re_search(const char *pattern) · 1060 unmodified lines
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++)
scripts/package/Makefile+3−4
@@ -39,14 +39,13 @@ if test "$(objtree)" != "$(srctree)"; then \ · 38 unmodified lines
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)/.scmversion44rm -f $(objtree)/.scmversion
46 45
47# rpm-pkg46# rpm-pkg
48# ---------------------------------------------------------------------------47# ---------------------------------------------------------------------------
49rpm-pkg rpm: FORCE48rpm-pkg: FORCE
50 $(MAKE) clean49 $(MAKE) clean
51 $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec50 $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
52 $(call cmd,src_tar,$(KERNELPATH),kernel.spec)51 $(call cmd,src_tar,$(KERNELPATH),kernel.spec)