History

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

Linus Torvalds committed 13 years ago

Commit b9e306e2 parents 685e56d a0f9c6f7 files · +52 −42Browse files

Showing the changes to scripts (4 of 7 files). Show all

Unified · Split

4 files
  1. scripts/coccicheck +18 −13
  2. scripts/package/Makefile +15 −24
  3. scripts/package/buildtar +1 −1
  4. scripts/tags.sh +3 −1
scripts/coccicheck+18−13
@@ -1,4 +1,4 @@
1−#!/bin/sh
1+#!/bin/bash
22
33 SPATCH="`which ${SPATCH:=spatch}`"
44
@@ -11,27 +11,32 @@ else · 6 unmodified lines
1111 VERBOSE=0
1212 fi
1313
14+FLAGS="$SPFLAGS -very_quiet"
15+
16+# spatch only allows include directories with the syntax "-I include"
17+# while gcc also allows "-Iinclude" and "-include include"
18+COCCIINCLUDE=${LINUXINCLUDE//-I/-I }
19+COCCIINCLUDE=${COCCIINCLUDE//-include/-I}
20+
1421 if [ "$C" = "1" -o "$C" = "2" ]; then
1522 ONLINE=1
1623
17−# This requires Coccinelle >= 0.2.3
18−# FLAGS="-ignore_unknown_options -very_quiet"
19−# OPTIONS=$*
20−
21−# Workaround for Coccinelle < 0.2.3
22− FLAGS="-I $srctree/include -very_quiet"
23− shift $(( $# - 1 ))
24− OPTIONS=$1
24+ # Take only the last argument, which is the C file to test
25+ shift $(( $# - 1 ))
26+ OPTIONS="$COCCIINCLUDE $1"
2527 else
2628 ONLINE=0
27− FLAGS="-very_quiet"
2829 if [ "$KBUILD_EXTMOD" = "" ] ; then
29− OPTIONS="-dir $srctree"
30+ OPTIONS="-dir $srctree $COCCIINCLUDE"
3031 else
31− OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree -I $srctree/include -I $KBUILD_EXTMOD/include"
32+ OPTIONS="-dir $KBUILD_EXTMOD $COCCIINCLUDE"
3233 fi
3334 fi
3435
36+if [ "$KBUILD_EXTMOD" != "" ] ; then
37+ OPTIONS="-patch $srctree $OPTIONS"
38+fi
39+
3540 if [ ! -x "$SPATCH" ]; then
3641 echo 'spatch is part of the Coccinelle project and is available at http://coccinelle.lip6.fr/'
3742 exit 1
@@ -72,7 +77,7 @@ coccinelle () { · 34 unmodified lines
7277 #
7378 # $SPATCH -D $MODE $FLAGS -parse_cocci $COCCI $OPT > /dev/null
7479
75− if [ $VERBOSE -ne 0 ] ; then
80+ if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then
7681
7782 FILE=`echo $COCCI | sed "s|$srctree/||"`
7883
scripts/package/Makefile+15−24
@@ -27,53 +27,44 @@ RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ · 26 unmodified lines
2727
2828 # Remove hyphens since they have special meaning in RPM filenames
2929 KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
30+# Include only those top-level files that are needed by make, plus the GPL copy
31+TAR_CONTENT := $(KBUILD_ALLDIRS) kernel.spec .config .scmversion Makefile \
32+ Kbuild Kconfig COPYING $(wildcard localversion*)
33+TAR_CONTENT := $(addprefix $(KERNELPATH)/,$(TAR_CONTENT))
3034 MKSPEC := $(srctree)/scripts/package/mkspec
31−PREV := set -e; cd -P ..;
3235
3336 # rpm-pkg
3437 # ---------------------------------------------------------------------------
35−$(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile
36− $(CONFIG_SHELL) $(MKSPEC) > $@
37−
38−rpm-pkg rpm: $(objtree)/kernel.spec FORCE
39− @if test -n "$(KBUILD_OUTPUT)"; then \
38+rpm-pkg rpm: FORCE
39+ @if test "$(objtree)" != "$(srctree)"; then \
4040 echo "Building source + binary RPM is not possible outside the"; \
4141 echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \
4242 echo "binrpm-pkg target instead."; \
4343 false; \
4444 fi
4545 $(MAKE) clean
46− $(PREV) ln -sf $(srctree) $(KERNELPATH)
46+ ln -sf $(srctree) $(KERNELPATH)
47+ $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
4748 $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion
48− $(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/.
49− $(PREV) rm $(KERNELPATH)
49+ tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(TAR_CONTENT)
50+ rm $(KERNELPATH)
5051 rm -f $(objtree)/.scmversion
51− set -e; \
5252 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
53− set -e; \
5453 mv -f $(objtree)/.tmp_version $(objtree)/.version
55−
56− $(RPM) $(RPMOPTS) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz
57− rm ../$(KERNELPATH).tar.gz
58−
59−clean-files := $(objtree)/kernel.spec
54+ $(RPM) $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz
55+ rm $(KERNELPATH).tar.gz kernel.spec
6056
6157 # binrpm-pkg
6258 # ---------------------------------------------------------------------------
63−$(objtree)/binkernel.spec: $(MKSPEC) $(srctree)/Makefile
64− $(CONFIG_SHELL) $(MKSPEC) prebuilt > $@
65−
66−binrpm-pkg: $(objtree)/binkernel.spec FORCE
59+binrpm-pkg: FORCE
6760 $(MAKE) KBUILD_SRC=
68− set -e; \
61+ $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec
6962 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
70− set -e; \
7163 mv -f $(objtree)/.tmp_version $(objtree)/.version
7264
7365 $(RPM) $(RPMOPTS) --define "_builddir $(objtree)" --target \
7466 $(UTS_MACHINE) -bb $<
75−
76−clean-files += $(objtree)/binkernel.spec
67+ rm binkernel.spec
7768
7869 # Deb target
7970 # ---------------------------------------------------------------------------
scripts/package/buildtar+1−1
@@ -16,7 +16,7 @@ set -e · 15 unmodified lines
1616 # Some variables and settings used throughout the script
1717 #
1818 tmpdir="${objtree}/tar-install"
19−tarball="${objtree}/linux-${KERNELRELEASE}.tar"
19+tarball="${objtree}/linux-${KERNELRELEASE}-${ARCH}.tar"
2020
2121
2222 #
scripts/tags.sh+3−1
@@ -199,7 +199,9 @@ exuberant() · 198 unmodified lines
199199 --regex-c='/DEFINE_PER_CPU_SHARED_ALIGNED\(([^,]*,\s*)(\w*).*\)/\2/v/' \
200200 --regex-c='/DECLARE_WAIT_QUEUE_HEAD\((\w*)/\1/v/' \
201201 --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/'
203205
204206 all_kconfigs | xargs $1 -a \
205207 --langdef=kconfig --language-force=kconfig \