diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-10 19:05:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-10 19:05:40 -0400 |
commit | cb63fc26623ee38fd84d71ea5a98189240ec2e1b (patch) | |
tree | 888721f9f48126b0f25711adbd82957d0f965781 /scripts | |
parent | a9642fa351c9dbf930ad2b5a1c17f3cfe2f62820 (diff) | |
parent | 4d47dde47f7dd95042fa56283d948f50dd4b509c (diff) |
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild updates from Michal Marek:
- fix for make headers_install argv explosion with too long path
- scripts/setlocalversion does not call git update-index needlessly
- fix for the src.rpm produced by make rpm-pkg. The new make
image_name can be useful also for other packaging tools.
- scripts/mod/devicetable-offsets.o is not rebuilt during each make run
- make modules_install dependency fix
- scripts/sortextable portability fix
- fix for kbuild to generate the output directory for all object files
in subdirs.
- a couple of minor fixes
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
kbuild: create directory for dir/file.o
tools/include: use stdint types for user-space byteshift headers
Makefile: Fix install error with make -j option
Fix a build warning in scripts/mod/file2alias.c
improve modalias building
scripts/mod: Spelling s/DEVICEVTABLE/DEVICETABLE/
kbuild: fix error when building from src rpm
scripts/setlocalversion on write-protected source tree
Makefile.lib: align DTB quiet_cmd
kbuild: fix make headers_install when path is too long
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.headersinst | 20 | ||||
-rw-r--r-- | scripts/Makefile.lib | 4 | ||||
-rw-r--r-- | scripts/headers_install.sh | 7 | ||||
-rw-r--r-- | scripts/mod/Makefile | 15 | ||||
-rw-r--r-- | scripts/mod/file2alias.c | 10 | ||||
-rwxr-xr-x | scripts/package/mkspec | 1 | ||||
-rwxr-xr-x | scripts/setlocalversion | 3 |
7 files changed, 33 insertions, 27 deletions
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst index 182084d728c8..8ccf83056a7a 100644 --- a/scripts/Makefile.headersinst +++ b/scripts/Makefile.headersinst | |||
@@ -47,18 +47,24 @@ header-y := $(filter-out $(generic-y), $(header-y)) | |||
47 | all-files := $(header-y) $(genhdr-y) $(wrapper-files) | 47 | all-files := $(header-y) $(genhdr-y) $(wrapper-files) |
48 | output-files := $(addprefix $(installdir)/, $(all-files)) | 48 | output-files := $(addprefix $(installdir)/, $(all-files)) |
49 | 49 | ||
50 | input-files := $(foreach hdr, $(header-y), \ | 50 | input-files1 := $(foreach hdr, $(header-y), \ |
51 | $(if $(wildcard $(srcdir)/$(hdr)), \ | 51 | $(if $(wildcard $(srcdir)/$(hdr)), \ |
52 | $(wildcard $(srcdir)/$(hdr)), \ | 52 | $(wildcard $(srcdir)/$(hdr))) \ |
53 | ) | ||
54 | input-files1-name := $(notdir $(input-files1)) | ||
55 | input-files2 := $(foreach hdr, $(header-y), \ | ||
56 | $(if $(wildcard $(srcdir)/$(hdr)),, \ | ||
53 | $(if $(wildcard $(oldsrcdir)/$(hdr)), \ | 57 | $(if $(wildcard $(oldsrcdir)/$(hdr)), \ |
54 | $(wildcard $(oldsrcdir)/$(hdr)), \ | 58 | $(wildcard $(oldsrcdir)/$(hdr)), \ |
55 | $(error Missing UAPI file $(srcdir)/$(hdr))) \ | 59 | $(error Missing UAPI file $(srcdir)/$(hdr))) \ |
56 | )) \ | 60 | )) |
57 | $(foreach hdr, $(genhdr-y), \ | 61 | input-files2-name := $(notdir $(input-files2)) |
62 | input-files3 := $(foreach hdr, $(genhdr-y), \ | ||
58 | $(if $(wildcard $(gendir)/$(hdr)), \ | 63 | $(if $(wildcard $(gendir)/$(hdr)), \ |
59 | $(wildcard $(gendir)/$(hdr)), \ | 64 | $(wildcard $(gendir)/$(hdr)), \ |
60 | $(error Missing generated UAPI file $(gendir)/$(hdr)) \ | 65 | $(error Missing generated UAPI file $(gendir)/$(hdr)) \ |
61 | )) | 66 | )) |
67 | input-files3-name := $(notdir $(input-files3)) | ||
62 | 68 | ||
63 | # Work out what needs to be removed | 69 | # Work out what needs to be removed |
64 | oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h)) | 70 | oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h)) |
@@ -72,7 +78,9 @@ printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@)) | |||
72 | quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ | 78 | quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ |
73 | file$(if $(word 2, $(all-files)),s)) | 79 | file$(if $(word 2, $(all-files)),s)) |
74 | cmd_install = \ | 80 | cmd_install = \ |
75 | $(CONFIG_SHELL) $< $(installdir) $(input-files); \ | 81 | $(CONFIG_SHELL) $< $(installdir) $(srcdir) $(input-files1-name); \ |
82 | $(CONFIG_SHELL) $< $(installdir) $(oldsrcdir) $(input-files2-name); \ | ||
83 | $(CONFIG_SHELL) $< $(installdir) $(gendir) $(input-files3-name); \ | ||
76 | for F in $(wrapper-files); do \ | 84 | for F in $(wrapper-files); do \ |
77 | echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \ | 85 | echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \ |
78 | done; \ | 86 | done; \ |
@@ -98,7 +106,7 @@ __headersinst: $(subdirs) $(install-file) | |||
98 | @: | 106 | @: |
99 | 107 | ||
100 | targets += $(install-file) | 108 | targets += $(install-file) |
101 | $(install-file): scripts/headers_install.sh $(input-files) FORCE | 109 | $(install-file): scripts/headers_install.sh $(input-files1) $(input-files2) $(input-files3) FORCE |
102 | $(if $(unwanted),$(call cmd,remove),) | 110 | $(if $(unwanted),$(call cmd,remove),) |
103 | $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@))) | 111 | $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@))) |
104 | $(call if_changed,install) | 112 | $(call if_changed,install) |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 6031e2380638..49392ecbef17 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -63,7 +63,7 @@ multi-objs := $(multi-objs-y) $(multi-objs-m) | |||
63 | subdir-obj-y := $(filter %/built-in.o, $(obj-y)) | 63 | subdir-obj-y := $(filter %/built-in.o, $(obj-y)) |
64 | 64 | ||
65 | # $(obj-dirs) is a list of directories that contain object files | 65 | # $(obj-dirs) is a list of directories that contain object files |
66 | obj-dirs := $(dir $(multi-objs) $(subdir-obj-y)) | 66 | obj-dirs := $(dir $(multi-objs) $(obj-y)) |
67 | 67 | ||
68 | # Replace multi-part objects by their individual parts, look at local dir only | 68 | # Replace multi-part objects by their individual parts, look at local dir only |
69 | real-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) | 69 | real-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) |
@@ -244,7 +244,7 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \ | |||
244 | # --------------------------------------------------------------------------- | 244 | # --------------------------------------------------------------------------- |
245 | 245 | ||
246 | # Generate an assembly file to wrap the output of the device tree compiler | 246 | # Generate an assembly file to wrap the output of the device tree compiler |
247 | quiet_cmd_dt_S_dtb= DTB $@ | 247 | quiet_cmd_dt_S_dtb= DTB $@ |
248 | cmd_dt_S_dtb= \ | 248 | cmd_dt_S_dtb= \ |
249 | ( \ | 249 | ( \ |
250 | echo '\#include <asm-generic/vmlinux.lds.h>'; \ | 250 | echo '\#include <asm-generic/vmlinux.lds.h>'; \ |
diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index 643764f53ea7..5de5660cb708 100644 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | if [ $# -lt 1 ] | 3 | if [ $# -lt 1 ] |
4 | then | 4 | then |
5 | echo "Usage: headers_install.sh OUTDIR [FILES...] | 5 | echo "Usage: headers_install.sh OUTDIR SRCDIR [FILES...] |
6 | echo | 6 | echo |
7 | echo "Prepares kernel header files for use by user space, by removing" | 7 | echo "Prepares kernel header files for use by user space, by removing" |
8 | echo "all compiler.h definitions and #includes, removing any" | 8 | echo "all compiler.h definitions and #includes, removing any" |
@@ -10,6 +10,7 @@ then | |||
10 | echo "asm/inline/volatile keywords." | 10 | echo "asm/inline/volatile keywords." |
11 | echo | 11 | echo |
12 | echo "OUTDIR: directory to write each userspace header FILE to." | 12 | echo "OUTDIR: directory to write each userspace header FILE to." |
13 | echo "SRCDIR: source directory where files are picked." | ||
13 | echo "FILES: list of header files to operate on." | 14 | echo "FILES: list of header files to operate on." |
14 | 15 | ||
15 | exit 1 | 16 | exit 1 |
@@ -19,6 +20,8 @@ fi | |||
19 | 20 | ||
20 | OUTDIR="$1" | 21 | OUTDIR="$1" |
21 | shift | 22 | shift |
23 | SRCDIR="$1" | ||
24 | shift | ||
22 | 25 | ||
23 | # Iterate through files listed on command line | 26 | # Iterate through files listed on command line |
24 | 27 | ||
@@ -34,7 +37,7 @@ do | |||
34 | -e 's/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g' \ | 37 | -e 's/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g' \ |
35 | -e 's/(^|[ \t(])(inline|asm|volatile)([ \t(]|$)/\1__\2__\3/g' \ | 38 | -e 's/(^|[ \t(])(inline|asm|volatile)([ \t(]|$)/\1__\2__\3/g' \ |
36 | -e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @' \ | 39 | -e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @' \ |
37 | "$i" > "$OUTDIR/$FILE.sed" || exit 1 | 40 | "$SRCDIR/$i" > "$OUTDIR/$FILE.sed" || exit 1 |
38 | scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed" \ | 41 | scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed" \ |
39 | > "$OUTDIR/$FILE" | 42 | > "$OUTDIR/$FILE" |
40 | [ $? -gt 1 ] && exit 1 | 43 | [ $? -gt 1 ] && exit 1 |
diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile index 75d59fcd48b8..c11212ff3510 100644 --- a/scripts/mod/Makefile +++ b/scripts/mod/Makefile | |||
@@ -15,8 +15,8 @@ endef | |||
15 | quiet_cmd_offsets = GEN $@ | 15 | quiet_cmd_offsets = GEN $@ |
16 | define cmd_offsets | 16 | define cmd_offsets |
17 | (set -e; \ | 17 | (set -e; \ |
18 | echo "#ifndef __DEVICEVTABLE_OFFSETS_H__"; \ | 18 | echo "#ifndef __DEVICETABLE_OFFSETS_H__"; \ |
19 | echo "#define __DEVICEVTABLE_OFFSETS_H__"; \ | 19 | echo "#define __DEVICETABLE_OFFSETS_H__"; \ |
20 | echo "/*"; \ | 20 | echo "/*"; \ |
21 | echo " * DO NOT MODIFY."; \ | 21 | echo " * DO NOT MODIFY."; \ |
22 | echo " *"; \ | 22 | echo " *"; \ |
@@ -29,15 +29,10 @@ define cmd_offsets | |||
29 | echo "#endif" ) > $@ | 29 | echo "#endif" ) > $@ |
30 | endef | 30 | endef |
31 | 31 | ||
32 | # We use internal kbuild rules to avoid the "is up to date" message from make | 32 | $(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s |
33 | scripts/mod/devicetable-offsets.s: scripts/mod/devicetable-offsets.c FORCE | 33 | $(call if_changed,offsets) |
34 | $(Q)mkdir -p $(dir $@) | ||
35 | $(call if_changed_dep,cc_s_c) | ||
36 | 34 | ||
37 | $(obj)/$(devicetable-offsets-file): scripts/mod/devicetable-offsets.s | 35 | targets += $(devicetable-offsets-file) devicetable-offsets.s |
38 | $(call cmd,offsets) | ||
39 | |||
40 | targets += $(devicetable-offsets-file) | ||
41 | 36 | ||
42 | # dependencies on generated files need to be listed explicitly | 37 | # dependencies on generated files need to be listed explicitly |
43 | 38 | ||
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index d9e67b719f08..23708636b05c 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -79,10 +79,12 @@ struct devtable **__start___devtable, **__stop___devtable; | |||
79 | extern struct devtable *__start___devtable[], *__stop___devtable[]; | 79 | extern struct devtable *__start___devtable[], *__stop___devtable[]; |
80 | #endif /* __MACH__ */ | 80 | #endif /* __MACH__ */ |
81 | 81 | ||
82 | #if __GNUC__ == 3 && __GNUC_MINOR__ < 3 | 82 | #if !defined(__used) |
83 | # define __used __attribute__((__unused__)) | 83 | # if __GNUC__ == 3 && __GNUC_MINOR__ < 3 |
84 | #else | 84 | # define __used __attribute__((__unused__)) |
85 | # define __used __attribute__((__used__)) | 85 | # else |
86 | # define __used __attribute__((__used__)) | ||
87 | # endif | ||
86 | #endif | 88 | #endif |
87 | 89 | ||
88 | /* Define a variable f that holds the value of field f of struct devid | 90 | /* Define a variable f that holds the value of field f of struct devid |
diff --git a/scripts/package/mkspec b/scripts/package/mkspec index fbbfd08853d3..fdd3fbf4d4a4 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec | |||
@@ -74,6 +74,7 @@ echo "" | |||
74 | fi | 74 | fi |
75 | 75 | ||
76 | echo "%install" | 76 | echo "%install" |
77 | echo 'KBUILD_IMAGE=$(make image_name)' | ||
77 | echo "%ifarch ia64" | 78 | echo "%ifarch ia64" |
78 | echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules' | 79 | echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules' |
79 | echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware' | 80 | echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware' |
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 84b88f109b80..d105a44b68f6 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion | |||
@@ -71,9 +71,6 @@ scm_version() | |||
71 | printf -- '-svn%s' "`git svn find-rev $head`" | 71 | printf -- '-svn%s' "`git svn find-rev $head`" |
72 | fi | 72 | fi |
73 | 73 | ||
74 | # Update index only on r/w media | ||
75 | [ -w . ] && git update-index --refresh --unmerged > /dev/null | ||
76 | |||
77 | # Check for uncommitted changes | 74 | # Check for uncommitted changes |
78 | if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then | 75 | if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then |
79 | printf '%s' -dirty | 76 | printf '%s' -dirty |