aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-06-09 19:27:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-06-09 19:27:42 -0400
commit6aecceccf5aa626b0af203e54ca62cbf308c53d8 (patch)
tree5d4889d531c1a92b38a36ea7a8d4f4e40252082d
parentdfb863a714b81848504d3b73ca0ecae90b91cbc0 (diff)
parent5d61b9fd19d9f3cf653dbba615876e7792eea5ea (diff)
Merge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: perf: Use make kernelversion instead of parsing the Makefile kbuild: Hack for depmod not handling X.Y versions kbuild: Move depmod call to a separate script kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL kbuild: Fix KERNELVERSION for empty SUBLEVEL or PATCHLEVEL kbuild: silence Nothing to be done for 'all' message
-rw-r--r--Makefile16
-rw-r--r--scripts/Makefile.asm-generic1
-rwxr-xr-xscripts/depmod.sh48
-rwxr-xr-xtools/perf/util/PERF-VERSION-GEN7
4 files changed, 53 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 0f1db8d90741..72c0e321f2da 100644
--- a/Makefile
+++ b/Makefile
@@ -378,7 +378,7 @@ KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
378 378
379# Read KERNELRELEASE from include/config/kernel.release (if it exists) 379# Read KERNELRELEASE from include/config/kernel.release (if it exists)
380KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) 380KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
381KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) 381KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
382 382
383export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION 383export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
384export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC 384export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
@@ -1005,7 +1005,7 @@ endef
1005 1005
1006define filechk_version.h 1006define filechk_version.h
1007 (echo \#define LINUX_VERSION_CODE $(shell \ 1007 (echo \#define LINUX_VERSION_CODE $(shell \
1008 expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ 1008 expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
1009 echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) 1009 echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
1010endef 1010endef
1011 1011
@@ -1110,11 +1110,6 @@ modules_install: _modinst_ _modinst_post
1110 1110
1111PHONY += _modinst_ 1111PHONY += _modinst_
1112_modinst_: 1112_modinst_:
1113 @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \
1114 echo "Warning: you may need to install module-init-tools"; \
1115 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
1116 sleep 1; \
1117 fi
1118 @rm -rf $(MODLIB)/kernel 1113 @rm -rf $(MODLIB)/kernel
1119 @rm -f $(MODLIB)/source 1114 @rm -f $(MODLIB)/source
1120 @mkdir -p $(MODLIB)/kernel 1115 @mkdir -p $(MODLIB)/kernel
@@ -1531,12 +1526,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))
1531 1526
1532# Run depmod only if we have System.map and depmod is executable 1527# Run depmod only if we have System.map and depmod is executable
1533quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) 1528quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
1534 cmd_depmod = \ 1529 cmd_depmod = $(srctree)/scripts/depmod.sh $(DEPMOD) $(KERNELRELEASE)
1535 if [ -r System.map -a -x $(DEPMOD) ]; then \
1536 $(DEPMOD) -ae -F System.map \
1537 $(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) ) \
1538 $(KERNELRELEASE); \
1539 fi
1540 1530
1541# Create temporary dir for module support files 1531# Create temporary dir for module support files
1542# clean it up only when building all modules 1532# clean it up only when building all modules
diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic
index 490122c3e2aa..40caf3c26cd5 100644
--- a/scripts/Makefile.asm-generic
+++ b/scripts/Makefile.asm-generic
@@ -17,6 +17,7 @@ quiet_cmd_wrap = WRAP $@
17cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ 17cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@
18 18
19all: $(patsubst %, $(obj)/%, $(generic-y)) 19all: $(patsubst %, $(obj)/%, $(generic-y))
20 @:
20 21
21$(obj)/%.h: 22$(obj)/%.h:
22 $(call cmd,wrap) 23 $(call cmd,wrap)
diff --git a/scripts/depmod.sh b/scripts/depmod.sh
new file mode 100755
index 000000000000..3b029cba2baf
--- /dev/null
+++ b/scripts/depmod.sh
@@ -0,0 +1,48 @@
1#!/bin/sh
2#
3# A depmod wrapper used by the toplevel Makefile
4
5if test $# -ne 2; then
6 echo "Usage: $0 /sbin/depmod <kernelrelease>" >&2
7 exit 1
8fi
9DEPMOD=$1
10KERNELRELEASE=$2
11
12if ! "$DEPMOD" -V 2>/dev/null | grep -q module-init-tools; then
13 echo "Warning: you may need to install module-init-tools" >&2
14 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt" >&2
15 sleep 1
16fi
17
18if ! test -r System.map -a -x "$DEPMOD"; then
19 exit 0
20fi
21# older versions of depmod require the version string to start with three
22# numbers, so we cheat with a symlink here
23depmod_hack_needed=true
24mkdir -p .tmp_depmod/lib/modules/$KERNELRELEASE
25if "$DEPMOD" -b .tmp_depmod $KERNELRELEASE 2>/dev/null; then
26 if test -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep -o \
27 -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep.bin; then
28 depmod_hack_needed=false
29 fi
30fi
31if $depmod_hack_needed; then
32 symlink="$INSTALL_MOD_PATH/lib/modules/99.98.$KERNELRELEASE"
33 ln -s "$KERNELRELEASE" "$symlink"
34 KERNELRELEASE=99.98.$KERNELRELEASE
35fi
36
37set -- -ae -F System.map
38if test -n "$INSTALL_MOD_PATH"; then
39 set -- "$@" -b "$INSTALL_MOD_PATH"
40fi
41"$DEPMOD" "$@" "$KERNELRELEASE"
42ret=$?
43
44if $depmod_hack_needed; then
45 rm -f "$symlink"
46fi
47
48exit $ret
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index 26d4d3fd6deb..9c5fb4d93824 100755
--- a/tools/perf/util/PERF-VERSION-GEN
+++ b/tools/perf/util/PERF-VERSION-GEN
@@ -23,12 +23,7 @@ if test -d ../../.git -o -f ../../.git &&
23then 23then
24 VN=$(echo "$VN" | sed -e 's/-/./g'); 24 VN=$(echo "$VN" | sed -e 's/-/./g');
25else 25else
26 eval $(grep '^VERSION[[:space:]]*=' ../../Makefile|tr -d ' ') 26 VN=$(make -sC ../.. kernelversion)
27 eval $(grep '^PATCHLEVEL[[:space:]]*=' ../../Makefile|tr -d ' ')
28 eval $(grep '^SUBLEVEL[[:space:]]*=' ../../Makefile|tr -d ' ')
29 eval $(grep '^EXTRAVERSION[[:space:]]*=' ../../Makefile|tr -d ' ')
30
31 VN="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}"
32fi 27fi
33 28
34VN=$(expr "$VN" : v*'\(.*\)') 29VN=$(expr "$VN" : v*'\(.*\)')