Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329225
b: refs/heads/master
c: 10b6395
h: refs/heads/master
i:
  329223: c5357f8
v: v3
  • Loading branch information
David Howells committed Oct 2, 2012
1 parent 383c31a commit 68e0db6
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ec28b7f250b19f31e14b69b015d61d0818bf43a0
refs/heads/master: 10b63956fce7f369cc37fd4d994f09bd5203efe4
14 changes: 7 additions & 7 deletions trunk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ asm-generic:
# Detect when mixed targets is specified, and make a second invocation
# of make so .config is not included in this case either (for *config).

version_h := include/generated/linux/version.h
version_h := include/generated/uapi/linux/version.h

no-dot-config-targets := clean mrproper distclean \
cscope gtags TAGS tags help %docs check% coccicheck \
Expand Down Expand Up @@ -908,19 +908,19 @@ headers_install_all:

PHONY += headers_install
headers_install: __headers
$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild),, \
$(error Headers not exportable for the $(SRCARCH) architecture))
$(Q)$(MAKE) $(hdr-inst)=include
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst)
$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \
$(error Headers not exportable for the $(SRCARCH) architecture))
$(Q)$(MAKE) $(hdr-inst)=include/uapi
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst)

PHONY += headers_check_all
headers_check_all: headers_install_all
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh check

PHONY += headers_check
headers_check: headers_install
$(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1
$(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1

# ---------------------------------------------------------------------------
# Modules
Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/x86/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ header-y += sigcontext32.h
header-y += ucontext.h
header-y += vm86.h
header-y += vsyscall.h

genhdr-y += unistd_32.h
genhdr-y += unistd_64.h
genhdr-y += unistd_x32.h
2 changes: 1 addition & 1 deletion trunk/arch/x86/syscalls/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
out := $(obj)/../include/generated/asm
uapi := $(obj)/../include/generated/asm
uapi := $(obj)/../include/generated/uapi/asm

# Create output directory if not already present
_dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') \
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ header-y += netfilter_ipv6/
header-y += usb/
header-y += wimax/

genhdr-y += version.h

ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
$(srctree)/include/asm-$(SRCARCH)/a.out.h \
$(INSTALL_HDR_PATH)/include/asm-*/a.out.h),)
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/uapi/linux/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ header-y += netfilter_ipv4/
header-y += netfilter_ipv6/
header-y += usb/
header-y += wimax/

genhdr-y += version.h
45 changes: 31 additions & 14 deletions trunk/scripts/Makefile.headersinst
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,72 @@
# ==========================================================================

# called may set destination dir (when installing to asm/)
_dst := $(if $(dst),$(dst),$(obj))
_dst := $(or $(destination-y),$(dst),$(obj))

# generated header directory
gen := $(if $(gen),$(gen),$(subst include/,include/generated/,$(obj)))

kbuild-file := $(srctree)/$(obj)/Kbuild
include $(kbuild-file)

_dst := $(if $(destination-y),$(destination-y),$(_dst))
old-kbuild-file := $(srctree)/$(subst uapi/,,$(obj))/Kbuild
ifneq ($(wildcard $(old-kbuild-file)),)
include $(old-kbuild-file)
endif

include scripts/Kbuild.include

install := $(INSTALL_HDR_PATH)/$(_dst)
installdir := $(INSTALL_HDR_PATH)/$(subst uapi/,,$(_dst))

header-y := $(sort $(header-y))
subdirs := $(patsubst %/,%,$(filter %/, $(header-y)))
header-y := $(filter-out %/, $(header-y))

# files used to track state of install/check
install-file := $(install)/.install
check-file := $(install)/.check
install-file := $(installdir)/.install
check-file := $(installdir)/.check

# generic-y list all files an architecture uses from asm-generic
# Use this to build a list of headers which require a wrapper
wrapper-files := $(filter $(header-y), $(generic-y))

srcdir := $(srctree)/$(obj)
gendir := $(objtree)/$(gen)

oldsrcdir := $(srctree)/$(subst /uapi,,$(obj))

# all headers files for this dir
header-y := $(filter-out $(generic-y), $(header-y))
all-files := $(header-y) $(genhdr-y) $(wrapper-files)
input-files := $(addprefix $(srctree)/$(obj)/,$(header-y)) \
$(addprefix $(objtree)/$(gen)/,$(genhdr-y))
output-files := $(addprefix $(install)/, $(all-files))
output-files := $(addprefix $(installdir)/, $(all-files))

input-files := $(foreach hdr, $(header-y), \
$(or \
$(wildcard $(srcdir)/$(hdr)), \
$(wildcard $(oldsrcdir)/$(hdr)), \
$(error Missing UAPI file $(srcdir)/$(hdr)) \
)) \
$(foreach hdr, $(genhdr-y), \
$(or \
$(wildcard $(gendir)/$(hdr)), \
$(error Missing generated UAPI file $(gendir)/$(hdr)) \
))

# Work out what needs to be removed
oldheaders := $(patsubst $(install)/%,%,$(wildcard $(install)/*.h))
oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h))
unwanted := $(filter-out $(all-files),$(oldheaders))

# Prefix unwanted with full paths to $(INSTALL_HDR_PATH)
unwanted-file := $(addprefix $(install)/, $(unwanted))
unwanted-file := $(addprefix $(installdir)/, $(unwanted))

printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@))

quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\
file$(if $(word 2, $(all-files)),s))
cmd_install = \
$(PERL) $< $(srctree)/$(obj) $(install) $(SRCARCH) $(header-y); \
$(PERL) $< $(objtree)/$(gen) $(install) $(SRCARCH) $(genhdr-y); \
$(PERL) $< $(installdir) $(SRCARCH) $(input-files); \
for F in $(wrapper-files); do \
echo "\#include <asm-generic/$$F>" > $(install)/$$F; \
echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \
done; \
touch $@

Expand All @@ -67,7 +84,7 @@ quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files)
# Headers list can be pretty long, xargs helps to avoid
# the "Argument list too long" error.
cmd_check = for f in $(all-files); do \
echo "$(install)/$${f}"; done \
echo "$(installdir)/$${f}"; done \
| xargs \
$(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \
touch $@
Expand Down
14 changes: 8 additions & 6 deletions trunk/scripts/headers_install.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
# user space and copy the files to their destination.
#
# Usage: headers_install.pl readdir installdir arch [files...]
# readdir: dir to open files
# installdir: dir to install the files
# installdir: dir to install the files to
# arch: current architecture
# arch is used to force a reinstallation when the arch
# changes because kbuild then detect a command line change.
Expand All @@ -18,15 +17,18 @@

use strict;

my ($readdir, $installdir, $arch, @files) = @ARGV;
my ($installdir, $arch, @files) = @ARGV;

my $unifdef = "scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__";

foreach my $file (@files) {
foreach my $filename (@files) {
my $file = $filename;
$file =~ s!^.*/!!;

my $tmpfile = "$installdir/$file.tmp";

open(my $in, '<', "$readdir/$file")
or die "$readdir/$file: $!\n";
open(my $in, '<', $filename)
or die "$filename: $!\n";
open(my $out, '>', $tmpfile)
or die "$tmpfile: $!\n";
while (my $line = <$in>) {
Expand Down

0 comments on commit 68e0db6

Please sign in to comment.