diff options
| -rw-r--r-- | Makefile | 14 | ||||
| -rw-r--r-- | arch/x86/include/asm/Kbuild | 4 | ||||
| -rw-r--r-- | arch/x86/syscalls/Makefile | 2 | ||||
| -rw-r--r-- | include/linux/Kbuild | 2 | ||||
| -rw-r--r-- | include/uapi/linux/Kbuild | 2 | ||||
| -rw-r--r-- | scripts/Makefile.headersinst | 45 | ||||
| -rw-r--r-- | scripts/headers_install.pl | 14 |
7 files changed, 49 insertions, 34 deletions
| @@ -447,7 +447,7 @@ asm-generic: | |||
| 447 | # Detect when mixed targets is specified, and make a second invocation | 447 | # Detect when mixed targets is specified, and make a second invocation |
| 448 | # of make so .config is not included in this case either (for *config). | 448 | # of make so .config is not included in this case either (for *config). |
| 449 | 449 | ||
| 450 | version_h := include/generated/linux/version.h | 450 | version_h := include/generated/uapi/linux/version.h |
| 451 | 451 | ||
| 452 | no-dot-config-targets := clean mrproper distclean \ | 452 | no-dot-config-targets := clean mrproper distclean \ |
| 453 | cscope gtags TAGS tags help %docs check% coccicheck \ | 453 | cscope gtags TAGS tags help %docs check% coccicheck \ |
| @@ -908,10 +908,10 @@ headers_install_all: | |||
| 908 | 908 | ||
| 909 | PHONY += headers_install | 909 | PHONY += headers_install |
| 910 | headers_install: __headers | 910 | headers_install: __headers |
| 911 | $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild),, \ | 911 | $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \ |
| 912 | $(error Headers not exportable for the $(SRCARCH) architecture)) | 912 | $(error Headers not exportable for the $(SRCARCH) architecture)) |
| 913 | $(Q)$(MAKE) $(hdr-inst)=include | 913 | $(Q)$(MAKE) $(hdr-inst)=include/uapi |
| 914 | $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) | 914 | $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) |
| 915 | 915 | ||
| 916 | PHONY += headers_check_all | 916 | PHONY += headers_check_all |
| 917 | headers_check_all: headers_install_all | 917 | headers_check_all: headers_install_all |
| @@ -919,8 +919,8 @@ headers_check_all: headers_install_all | |||
| 919 | 919 | ||
| 920 | PHONY += headers_check | 920 | PHONY += headers_check |
| 921 | headers_check: headers_install | 921 | headers_check: headers_install |
| 922 | $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1 | 922 | $(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1 |
| 923 | $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1 | 923 | $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1 |
| 924 | 924 | ||
| 925 | # --------------------------------------------------------------------------- | 925 | # --------------------------------------------------------------------------- |
| 926 | # Modules | 926 | # Modules |
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index f9c0d3ba9e84..1595d6813432 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild | |||
| @@ -22,7 +22,3 @@ header-y += sigcontext32.h | |||
| 22 | header-y += ucontext.h | 22 | header-y += ucontext.h |
| 23 | header-y += vm86.h | 23 | header-y += vm86.h |
| 24 | header-y += vsyscall.h | 24 | header-y += vsyscall.h |
| 25 | |||
| 26 | genhdr-y += unistd_32.h | ||
| 27 | genhdr-y += unistd_64.h | ||
| 28 | genhdr-y += unistd_x32.h | ||
diff --git a/arch/x86/syscalls/Makefile b/arch/x86/syscalls/Makefile index 174b03248418..f325af26107c 100644 --- a/arch/x86/syscalls/Makefile +++ b/arch/x86/syscalls/Makefile | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | out := $(obj)/../include/generated/asm | 1 | out := $(obj)/../include/generated/asm |
| 2 | uapi := $(obj)/../include/generated/asm | 2 | uapi := $(obj)/../include/generated/uapi/asm |
| 3 | 3 | ||
| 4 | # Create output directory if not already present | 4 | # Create output directory if not already present |
| 5 | _dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') \ | 5 | _dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') \ |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 0236a3b346fe..3f4c207a93bb 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -20,8 +20,6 @@ header-y += netfilter_ipv6/ | |||
| 20 | header-y += usb/ | 20 | header-y += usb/ |
| 21 | header-y += wimax/ | 21 | header-y += wimax/ |
| 22 | 22 | ||
| 23 | genhdr-y += version.h | ||
| 24 | |||
| 25 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ | 23 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ |
| 26 | $(srctree)/include/asm-$(SRCARCH)/a.out.h \ | 24 | $(srctree)/include/asm-$(SRCARCH)/a.out.h \ |
| 27 | $(INSTALL_HDR_PATH)/include/asm-*/a.out.h),) | 25 | $(INSTALL_HDR_PATH)/include/asm-*/a.out.h),) |
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index 13a9cf4cb6fe..b0fd4d03499d 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild | |||
| @@ -20,3 +20,5 @@ header-y += netfilter_ipv4/ | |||
| 20 | header-y += netfilter_ipv6/ | 20 | header-y += netfilter_ipv6/ |
| 21 | header-y += usb/ | 21 | header-y += usb/ |
| 22 | header-y += wimax/ | 22 | header-y += wimax/ |
| 23 | |||
| 24 | genhdr-y += version.h | ||
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst index 463b95acc15b..06ba4a70bd4d 100644 --- a/scripts/Makefile.headersinst +++ b/scripts/Makefile.headersinst | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | # ========================================================================== | 8 | # ========================================================================== |
| 9 | 9 | ||
| 10 | # called may set destination dir (when installing to asm/) | 10 | # called may set destination dir (when installing to asm/) |
| 11 | _dst := $(if $(dst),$(dst),$(obj)) | 11 | _dst := $(or $(destination-y),$(dst),$(obj)) |
| 12 | 12 | ||
| 13 | # generated header directory | 13 | # generated header directory |
| 14 | gen := $(if $(gen),$(gen),$(subst include/,include/generated/,$(obj))) | 14 | gen := $(if $(gen),$(gen),$(subst include/,include/generated/,$(obj))) |
| @@ -16,47 +16,64 @@ gen := $(if $(gen),$(gen),$(subst include/,include/generated/,$(obj))) | |||
| 16 | kbuild-file := $(srctree)/$(obj)/Kbuild | 16 | kbuild-file := $(srctree)/$(obj)/Kbuild |
| 17 | include $(kbuild-file) | 17 | include $(kbuild-file) |
| 18 | 18 | ||
| 19 | _dst := $(if $(destination-y),$(destination-y),$(_dst)) | 19 | old-kbuild-file := $(srctree)/$(subst uapi/,,$(obj))/Kbuild |
| 20 | ifneq ($(wildcard $(old-kbuild-file)),) | ||
| 21 | include $(old-kbuild-file) | ||
| 22 | endif | ||
| 20 | 23 | ||
| 21 | include scripts/Kbuild.include | 24 | include scripts/Kbuild.include |
| 22 | 25 | ||
| 23 | install := $(INSTALL_HDR_PATH)/$(_dst) | 26 | installdir := $(INSTALL_HDR_PATH)/$(subst uapi/,,$(_dst)) |
| 24 | 27 | ||
| 25 | header-y := $(sort $(header-y)) | 28 | header-y := $(sort $(header-y)) |
| 26 | subdirs := $(patsubst %/,%,$(filter %/, $(header-y))) | 29 | subdirs := $(patsubst %/,%,$(filter %/, $(header-y))) |
| 27 | header-y := $(filter-out %/, $(header-y)) | 30 | header-y := $(filter-out %/, $(header-y)) |
| 28 | 31 | ||
| 29 | # files used to track state of install/check | 32 | # files used to track state of install/check |
| 30 | install-file := $(install)/.install | 33 | install-file := $(installdir)/.install |
| 31 | check-file := $(install)/.check | 34 | check-file := $(installdir)/.check |
| 32 | 35 | ||
| 33 | # generic-y list all files an architecture uses from asm-generic | 36 | # generic-y list all files an architecture uses from asm-generic |
| 34 | # Use this to build a list of headers which require a wrapper | 37 | # Use this to build a list of headers which require a wrapper |
| 35 | wrapper-files := $(filter $(header-y), $(generic-y)) | 38 | wrapper-files := $(filter $(header-y), $(generic-y)) |
| 36 | 39 | ||
| 40 | srcdir := $(srctree)/$(obj) | ||
| 41 | gendir := $(objtree)/$(gen) | ||
| 42 | |||
| 43 | oldsrcdir := $(srctree)/$(subst /uapi,,$(obj)) | ||
| 44 | |||
| 37 | # all headers files for this dir | 45 | # all headers files for this dir |
| 38 | header-y := $(filter-out $(generic-y), $(header-y)) | 46 | header-y := $(filter-out $(generic-y), $(header-y)) |
| 39 | all-files := $(header-y) $(genhdr-y) $(wrapper-files) | 47 | all-files := $(header-y) $(genhdr-y) $(wrapper-files) |
| 40 | input-files := $(addprefix $(srctree)/$(obj)/,$(header-y)) \ | 48 | output-files := $(addprefix $(installdir)/, $(all-files)) |
| 41 | $(addprefix $(objtree)/$(gen)/,$(genhdr-y)) | 49 | |
| 42 | output-files := $(addprefix $(install)/, $(all-files)) | 50 | input-files := $(foreach hdr, $(header-y), \ |
| 51 | $(or \ | ||
| 52 | $(wildcard $(srcdir)/$(hdr)), \ | ||
| 53 | $(wildcard $(oldsrcdir)/$(hdr)), \ | ||
| 54 | $(error Missing UAPI file $(srcdir)/$(hdr)) \ | ||
| 55 | )) \ | ||
| 56 | $(foreach hdr, $(genhdr-y), \ | ||
| 57 | $(or \ | ||
| 58 | $(wildcard $(gendir)/$(hdr)), \ | ||
| 59 | $(error Missing generated UAPI file $(gendir)/$(hdr)) \ | ||
| 60 | )) | ||
| 43 | 61 | ||
| 44 | # Work out what needs to be removed | 62 | # Work out what needs to be removed |
| 45 | oldheaders := $(patsubst $(install)/%,%,$(wildcard $(install)/*.h)) | 63 | oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h)) |
| 46 | unwanted := $(filter-out $(all-files),$(oldheaders)) | 64 | unwanted := $(filter-out $(all-files),$(oldheaders)) |
| 47 | 65 | ||
| 48 | # Prefix unwanted with full paths to $(INSTALL_HDR_PATH) | 66 | # Prefix unwanted with full paths to $(INSTALL_HDR_PATH) |
| 49 | unwanted-file := $(addprefix $(install)/, $(unwanted)) | 67 | unwanted-file := $(addprefix $(installdir)/, $(unwanted)) |
| 50 | 68 | ||
| 51 | printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@)) | 69 | printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@)) |
| 52 | 70 | ||
| 53 | quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ | 71 | quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ |
| 54 | file$(if $(word 2, $(all-files)),s)) | 72 | file$(if $(word 2, $(all-files)),s)) |
| 55 | cmd_install = \ | 73 | cmd_install = \ |
| 56 | $(PERL) $< $(srctree)/$(obj) $(install) $(SRCARCH) $(header-y); \ | 74 | $(PERL) $< $(installdir) $(SRCARCH) $(input-files); \ |
| 57 | $(PERL) $< $(objtree)/$(gen) $(install) $(SRCARCH) $(genhdr-y); \ | ||
| 58 | for F in $(wrapper-files); do \ | 75 | for F in $(wrapper-files); do \ |
| 59 | echo "\#include <asm-generic/$$F>" > $(install)/$$F; \ | 76 | echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \ |
| 60 | done; \ | 77 | done; \ |
| 61 | touch $@ | 78 | touch $@ |
| 62 | 79 | ||
| @@ -67,7 +84,7 @@ quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files) | |||
| 67 | # Headers list can be pretty long, xargs helps to avoid | 84 | # Headers list can be pretty long, xargs helps to avoid |
| 68 | # the "Argument list too long" error. | 85 | # the "Argument list too long" error. |
| 69 | cmd_check = for f in $(all-files); do \ | 86 | cmd_check = for f in $(all-files); do \ |
| 70 | echo "$(install)/$${f}"; done \ | 87 | echo "$(installdir)/$${f}"; done \ |
| 71 | | xargs \ | 88 | | xargs \ |
| 72 | $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \ | 89 | $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \ |
| 73 | touch $@ | 90 | touch $@ |
diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl index 48462be328bb..239d22d4207b 100644 --- a/scripts/headers_install.pl +++ b/scripts/headers_install.pl | |||
| @@ -4,8 +4,7 @@ | |||
| 4 | # user space and copy the files to their destination. | 4 | # user space and copy the files to their destination. |
| 5 | # | 5 | # |
| 6 | # Usage: headers_install.pl readdir installdir arch [files...] | 6 | # Usage: headers_install.pl readdir installdir arch [files...] |
| 7 | # readdir: dir to open files | 7 | # installdir: dir to install the files to |
| 8 | # installdir: dir to install the files | ||
| 9 | # arch: current architecture | 8 | # arch: current architecture |
| 10 | # arch is used to force a reinstallation when the arch | 9 | # arch is used to force a reinstallation when the arch |
| 11 | # changes because kbuild then detect a command line change. | 10 | # changes because kbuild then detect a command line change. |
| @@ -18,15 +17,18 @@ | |||
| 18 | 17 | ||
| 19 | use strict; | 18 | use strict; |
| 20 | 19 | ||
| 21 | my ($readdir, $installdir, $arch, @files) = @ARGV; | 20 | my ($installdir, $arch, @files) = @ARGV; |
| 22 | 21 | ||
| 23 | my $unifdef = "scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__"; | 22 | my $unifdef = "scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__"; |
| 24 | 23 | ||
| 25 | foreach my $file (@files) { | 24 | foreach my $filename (@files) { |
| 25 | my $file = $filename; | ||
| 26 | $file =~ s!^.*/!!; | ||
| 27 | |||
| 26 | my $tmpfile = "$installdir/$file.tmp"; | 28 | my $tmpfile = "$installdir/$file.tmp"; |
| 27 | 29 | ||
| 28 | open(my $in, '<', "$readdir/$file") | 30 | open(my $in, '<', $filename) |
| 29 | or die "$readdir/$file: $!\n"; | 31 | or die "$filename: $!\n"; |
| 30 | open(my $out, '>', $tmpfile) | 32 | open(my $out, '>', $tmpfile) |
| 31 | or die "$tmpfile: $!\n"; | 33 | or die "$tmpfile: $!\n"; |
| 32 | while (my $line = <$in>) { | 34 | while (my $line = <$in>) { |
