aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-07 10:59:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-07 10:59:19 -0400
commitb9e306e07ed58fc354bbd58124b281dd7dc697b7 (patch)
tree2fb12d74fad1396ada7d8baf5b5c378b4363e9e5 /scripts
parent685e56d2943bb8bf3b641d85b1b6c69d24f7965f (diff)
parenta0f9c6f202962d4ca8150730e55bc34021dfebcc (diff)
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull misc kbuild updates from Michal Marek: "Non-critical kbuild changes: - make coccicheck improvements, but no new semantic patches this time - make rpm improvements - make tar-pkg change to include the architecture in the filename. This is a deliberate incompatibility, but nobody has complained so far and it is useful if you build for different architectures. It also matches what the deb-pkg and rpm-pkg targets produce. - kbuild documentation fix" * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: rpm-pkg: Remove pointless set -e statements rpm-pkg: Always regenerate the specfile rpm-pkg: Do not write to the parent directory rpm-pkg: Do not package the whole source directory buildtar: Add ARCH to the archive name Coccinelle: Fix patch output when coccicheck is used with M= and C= Coccinelle: Add support to the SPFLAGS variable Coccinelle: Cleanup the setting of the FLAGS and OPTIONS variables Coccinelle: Restore coccicheck verbosity in ONLINE mode (C=1 or C=2) scripts/package/Makefile: compare objtree with srctree instead of test KBUILD_OUTPUT doc: change example to existing Makefile fragment scripts/tags.sh: Add magic for OFFSET and DEFINE
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/coccicheck31
-rw-r--r--scripts/package/Makefile39
-rw-r--r--scripts/package/buildtar2
-rwxr-xr-xscripts/tags.sh4
4 files changed, 37 insertions, 39 deletions
diff --git a/scripts/coccicheck b/scripts/coccicheck
index 85d31899ad98..06fcb3333247 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2 2
3SPATCH="`which ${SPATCH:=spatch}`" 3SPATCH="`which ${SPATCH:=spatch}`"
4 4
@@ -11,27 +11,32 @@ else
11 VERBOSE=0 11 VERBOSE=0
12fi 12fi
13 13
14FLAGS="$SPFLAGS -very_quiet"
15
16# spatch only allows include directories with the syntax "-I include"
17# while gcc also allows "-Iinclude" and "-include include"
18COCCIINCLUDE=${LINUXINCLUDE//-I/-I }
19COCCIINCLUDE=${COCCIINCLUDE//-include/-I}
20
14if [ "$C" = "1" -o "$C" = "2" ]; then 21if [ "$C" = "1" -o "$C" = "2" ]; then
15 ONLINE=1 22 ONLINE=1
16 23
17# This requires Coccinelle >= 0.2.3 24 # Take only the last argument, which is the C file to test
18# FLAGS="-ignore_unknown_options -very_quiet" 25 shift $(( $# - 1 ))
19# OPTIONS=$* 26 OPTIONS="$COCCIINCLUDE $1"
20
21# Workaround for Coccinelle < 0.2.3
22 FLAGS="-I $srctree/include -very_quiet"
23 shift $(( $# - 1 ))
24 OPTIONS=$1
25else 27else
26 ONLINE=0 28 ONLINE=0
27 FLAGS="-very_quiet"
28 if [ "$KBUILD_EXTMOD" = "" ] ; then 29 if [ "$KBUILD_EXTMOD" = "" ] ; then
29 OPTIONS="-dir $srctree" 30 OPTIONS="-dir $srctree $COCCIINCLUDE"
30 else 31 else
31 OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree -I $srctree/include -I $KBUILD_EXTMOD/include" 32 OPTIONS="-dir $KBUILD_EXTMOD $COCCIINCLUDE"
32 fi 33 fi
33fi 34fi
34 35
36if [ "$KBUILD_EXTMOD" != "" ] ; then
37 OPTIONS="-patch $srctree $OPTIONS"
38fi
39
35if [ ! -x "$SPATCH" ]; then 40if [ ! -x "$SPATCH" ]; then
36 echo 'spatch is part of the Coccinelle project and is available at http://coccinelle.lip6.fr/' 41 echo 'spatch is part of the Coccinelle project and is available at http://coccinelle.lip6.fr/'
37 exit 1 42 exit 1
@@ -72,7 +77,7 @@ coccinelle () {
72# 77#
73# $SPATCH -D $MODE $FLAGS -parse_cocci $COCCI $OPT > /dev/null 78# $SPATCH -D $MODE $FLAGS -parse_cocci $COCCI $OPT > /dev/null
74 79
75 if [ $VERBOSE -ne 0 ] ; then 80 if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then
76 81
77 FILE=`echo $COCCI | sed "s|$srctree/||"` 82 FILE=`echo $COCCI | sed "s|$srctree/||"`
78 83
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 87bf08076b11..84a406070f6f 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -27,53 +27,44 @@ RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
27 27
28# Remove hyphens since they have special meaning in RPM filenames 28# Remove hyphens since they have special meaning in RPM filenames
29KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) 29KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
30# Include only those top-level files that are needed by make, plus the GPL copy
31TAR_CONTENT := $(KBUILD_ALLDIRS) kernel.spec .config .scmversion Makefile \
32 Kbuild Kconfig COPYING $(wildcard localversion*)
33TAR_CONTENT := $(addprefix $(KERNELPATH)/,$(TAR_CONTENT))
30MKSPEC := $(srctree)/scripts/package/mkspec 34MKSPEC := $(srctree)/scripts/package/mkspec
31PREV := set -e; cd -P ..;
32 35
33# rpm-pkg 36# rpm-pkg
34# --------------------------------------------------------------------------- 37# ---------------------------------------------------------------------------
35$(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile 38rpm-pkg rpm: FORCE
36 $(CONFIG_SHELL) $(MKSPEC) > $@ 39 @if test "$(objtree)" != "$(srctree)"; then \
37
38rpm-pkg rpm: $(objtree)/kernel.spec FORCE
39 @if test -n "$(KBUILD_OUTPUT)"; then \
40 echo "Building source + binary RPM is not possible outside the"; \ 40 echo "Building source + binary RPM is not possible outside the"; \
41 echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \ 41 echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \
42 echo "binrpm-pkg target instead."; \ 42 echo "binrpm-pkg target instead."; \
43 false; \ 43 false; \
44 fi 44 fi
45 $(MAKE) clean 45 $(MAKE) clean
46 $(PREV) ln -sf $(srctree) $(KERNELPATH) 46 ln -sf $(srctree) $(KERNELPATH)
47 $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
47 $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion 48 $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion
48 $(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. 49 tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(TAR_CONTENT)
49 $(PREV) rm $(KERNELPATH) 50 rm $(KERNELPATH)
50 rm -f $(objtree)/.scmversion 51 rm -f $(objtree)/.scmversion
51 set -e; \
52 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version 52 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
53 set -e; \
54 mv -f $(objtree)/.tmp_version $(objtree)/.version 53 mv -f $(objtree)/.tmp_version $(objtree)/.version
55 54 $(RPM) $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz
56 $(RPM) $(RPMOPTS) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz 55 rm $(KERNELPATH).tar.gz kernel.spec
57 rm ../$(KERNELPATH).tar.gz
58
59clean-files := $(objtree)/kernel.spec
60 56
61# binrpm-pkg 57# binrpm-pkg
62# --------------------------------------------------------------------------- 58# ---------------------------------------------------------------------------
63$(objtree)/binkernel.spec: $(MKSPEC) $(srctree)/Makefile 59binrpm-pkg: FORCE
64 $(CONFIG_SHELL) $(MKSPEC) prebuilt > $@
65
66binrpm-pkg: $(objtree)/binkernel.spec FORCE
67 $(MAKE) KBUILD_SRC= 60 $(MAKE) KBUILD_SRC=
68 set -e; \ 61 $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec
69 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version 62 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
70 set -e; \
71 mv -f $(objtree)/.tmp_version $(objtree)/.version 63 mv -f $(objtree)/.tmp_version $(objtree)/.version
72 64
73 $(RPM) $(RPMOPTS) --define "_builddir $(objtree)" --target \ 65 $(RPM) $(RPMOPTS) --define "_builddir $(objtree)" --target \
74 $(UTS_MACHINE) -bb $< 66 $(UTS_MACHINE) -bb $<
75 67 rm binkernel.spec
76clean-files += $(objtree)/binkernel.spec
77 68
78# Deb target 69# Deb target
79# --------------------------------------------------------------------------- 70# ---------------------------------------------------------------------------
diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index 62d8234f8787..cdd9bb909bcd 100644
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -16,7 +16,7 @@ set -e
16# Some variables and settings used throughout the script 16# Some variables and settings used throughout the script
17# 17#
18tmpdir="${objtree}/tar-install" 18tmpdir="${objtree}/tar-install"
19tarball="${objtree}/linux-${KERNELRELEASE}.tar" 19tarball="${objtree}/linux-${KERNELRELEASE}-${ARCH}.tar"
20 20
21 21
22# 22#
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 26a87e68afed..74f02e4dddd2 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -199,7 +199,9 @@ exuberant()
199 --regex-c='/DEFINE_PER_CPU_SHARED_ALIGNED\(([^,]*,\s*)(\w*).*\)/\2/v/' \ 199 --regex-c='/DEFINE_PER_CPU_SHARED_ALIGNED\(([^,]*,\s*)(\w*).*\)/\2/v/' \
200 --regex-c='/DECLARE_WAIT_QUEUE_HEAD\((\w*)/\1/v/' \ 200 --regex-c='/DECLARE_WAIT_QUEUE_HEAD\((\w*)/\1/v/' \
201 --regex-c='/DECLARE_(TASKLET|WORK|DELAYED_WORK)\((\w*)/\2/v/' \ 201 --regex-c='/DECLARE_(TASKLET|WORK|DELAYED_WORK)\((\w*)/\2/v/' \
202 --regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/' 202 --regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/' \
203 --regex-c='/(^\s)OFFSET\((\w*)/\2/v/' \
204 --regex-c='/(^\s)DEFINE\((\w*)/\2/v/'
203 205
204 all_kconfigs | xargs $1 -a \ 206 all_kconfigs | xargs $1 -a \
205 --langdef=kconfig --language-force=kconfig \ 207 --langdef=kconfig --language-force=kconfig \