Merge git://git.infradead.org/hdrinstall-2.6

* git://git.infradead.org/hdrinstall-2.6:
Remove export of include/linux/isdn/tpam.h
Remove <linux/i2c-id.h> and <linux/i2c-algo-ite.h> from userspace export
Restrict headers exported to userspace for SPARC and SPARC64
Add empty Kbuild files for 'make headers_install' in remaining arches.
Add Kbuild file for Alpha 'make headers_install'
Add Kbuild file for SPARC 'make headers_install'
Add Kbuild file for IA64 'make headers_install'
Add Kbuild file for S390 'make headers_install'
Add Kbuild file for i386 'make headers_install'
Add Kbuild file for x86_64 'make headers_install'
Add Kbuild file for PowerPC 'make headers_install'
Add generic Kbuild files for 'make headers_install'
Basic implementation of 'make headers_check'
Basic implementation of 'make headers_install'

+399
+17
Makefile
··· 875 875 @echo '*** Warning: make $@ is unnecessary now.' 876 876 877 877 # --------------------------------------------------------------------------- 878 + # Kernel headers 879 + INSTALL_HDR_PATH=$(MODLIB)/abi 880 + export INSTALL_HDR_PATH 881 + 882 + PHONY += headers_install 883 + headers_install: include/linux/version.h 884 + $(Q)unifdef -Ux /dev/null 885 + $(Q)rm -rf $(INSTALL_HDR_PATH)/include 886 + $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include 887 + 888 + PHONY += headers_check 889 + headers_check: headers_install 890 + $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include HDRCHECK=1 891 + 892 + # --------------------------------------------------------------------------- 878 893 # Modules 879 894 880 895 ifdef CONFIG_MODULES ··· 1063 1048 @echo ' cscope - Generate cscope index' 1064 1049 @echo ' kernelrelease - Output the release version string' 1065 1050 @echo ' kernelversion - Output the version stored in Makefile' 1051 + @echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH' 1052 + @echo ' (default: /lib/modules/$$VERSION/abi)' 1066 1053 @echo '' 1067 1054 @echo 'Static analysers' 1068 1055 @echo ' checkstack - Generate a list of stack hogs'
+2
include/Kbuild
··· 1 + header-y += asm-generic/ linux/ scsi/ sound/ mtd/ rdma/ video/ 2 + header-y += asm-$(ARCH)/
+5
include/asm-alpha/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm 2 + 3 + unifdef-y += console.h fpu.h sysinfo.h 4 + 5 + header-y += gentrap.h regdef.h pal.h reg.h
+1
include/asm-arm/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+1
include/asm-arm26/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+1
include/asm-cris/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+1
include/asm-frv/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+3
include/asm-generic/Kbuild
··· 1 + header-y += atomic.h errno-base.h errno.h fcntl.h ioctl.h ipc.h mman.h \ 2 + signal.h statfs.h 3 + unifdef-y := resource.h siginfo.h
+11
include/asm-generic/Kbuild.asm
··· 1 + unifdef-y += a.out.h auxvec.h byteorder.h errno.h fcntl.h ioctl.h \ 2 + ioctls.h ipcbuf.h irq.h mman.h msgbuf.h param.h poll.h \ 3 + posix_types.h ptrace.h resource.h sembuf.h shmbuf.h shmparam.h \ 4 + sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h \ 5 + statfs.h termbits.h termios.h timex.h types.h unistd.h user.h 6 + 7 + # These really shouldn't be exported 8 + unifdef-y += atomic.h io.h 9 + 10 + # These probably shouldn't be exported 11 + unifdef-y += elf.h page.h
+1
include/asm-h8300/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+5
include/asm-i386/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm 2 + 3 + header-y += boot.h cpufeature.h debugreg.h ldt.h setup.h ucontext.h 4 + 5 + unifdef-y += mtrr.h vm86.h
+7
include/asm-ia64/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm 2 + 3 + header-y += break.h fpu.h fpswa.h gcc_intrin.h ia64regs.h \ 4 + intel_intrin.h intrinsics.h perfmon_default_smpl.h \ 5 + ptrace_offsets.h rse.h setup.h ucontext.h 6 + 7 + unifdef-y += perfmon.h
+1
include/asm-m32r/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+1
include/asm-m68k/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+1
include/asm-m68knommu/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+1
include/asm-mips/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+1
include/asm-parisc/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+10
include/asm-powerpc/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm 2 + 3 + unifdef-y += a.out.h asm-compat.h bootx.h byteorder.h cputable.h elf.h \ 4 + nvram.h param.h posix_types.h ptrace.h seccomp.h signal.h \ 5 + termios.h types.h unistd.h 6 + 7 + header-y += auxvec.h ioctls.h mman.h sembuf.h siginfo.h stat.h errno.h \ 8 + ipcbuf.h msgbuf.h shmbuf.h socket.h termbits.h fcntl.h ipc.h \ 9 + poll.h shmparam.h sockios.h ucontext.h ioctl.h linkage.h \ 10 + resource.h sigcontext.h statfs.h
+4
include/asm-s390/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm 2 + 3 + unifdef-y += cmb.h debug.h 4 + header-y += dasd.h qeth.h tape390.h ucontext.h vtoc.h z90crypt.h
+1
include/asm-sh/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+1
include/asm-sh64/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+6
include/asm-sparc/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm 2 + 3 + unifdef-y += fbio.h perfctr.h psr.h 4 + header-y += apc.h asi.h auxio.h bpp.h head.h ipc.h jsflash.h \ 5 + openpromio.h pbm.h pconf.h pgtsun4.h reg.h traps.h \ 6 + turbosparc.h vfc_ioctls.h winmacro.h
+10
include/asm-sparc64/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm 2 + 3 + ALTARCH := sparc 4 + ARCHDEF := defined __sparc__ && defined __arch64__ 5 + ALTARCHDEF := defined __sparc__ && !defined __arch64__ 6 + 7 + unifdef-y := fbio.h perfctr.h 8 + header-y += apb.h asi.h bbc.h bpp.h display7seg.h envctrl.h floppy.h \ 9 + ipc.h kdebug.h mostek.h openprom.h openpromio.h parport.h \ 10 + pconf.h psrcompat.h pstate.h reg.h uctx.h utrap.h watchdog.h
+1
include/asm-um/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+1
include/asm-v850/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+11
include/asm-x86_64/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm 2 + 3 + ALTARCH := i386 4 + ARCHDEF := defined __x86_64__ 5 + ALTARCHDEF := defined __i386__ 6 + 7 + header-y += boot.h bootsetup.h cpufeature.h debugreg.h ldt.h \ 8 + msr.h prctl.h setup.h sigcontext32.h ucontext.h \ 9 + vsyscall32.h 10 + 11 + unifdef-y += mce.h mtrr.h vsyscall.h
+1
include/asm-xtensa/Kbuild
··· 1 + include include/asm-generic/Kbuild.asm
+63
include/linux/Kbuild
··· 1 + header-y := byteorder/ dvb/ hdlc/ isdn/ nfsd/ raid/ sunrpc/ tc_act/ \ 2 + netfilter/ netfilter_arp/ netfilter_bridge/ netfilter_ipv4/ \ 3 + netfilter_ipv6/ 4 + 5 + header-y += affs_fs.h affs_hardblocks.h aio_abi.h a.out.h arcfb.h \ 6 + atmapi.h atmbr2684.h atmclip.h atm_eni.h atm_he.h \ 7 + atm_idt77105.h atmioc.h atmlec.h atmmpc.h atm_nicstar.h \ 8 + atmppp.h atmsap.h atmsvc.h atm_zatm.h auto_fs4.h auxvec.h \ 9 + awe_voice.h ax25.h b1lli.h baycom.h bfs_fs.h blkpg.h \ 10 + bpqether.h cdk.h chio.h coda_psdev.h coff.h comstats.h \ 11 + consolemap.h cycx_cfm.h devfs_fs.h dm-ioctl.h dn.h dqblk_v1.h \ 12 + dqblk_v2.h dqblk_xfs.h efs_fs_sb.h elf-fdpic.h elf.h elf-em.h \ 13 + fadvise.h fd.h fdreg.h ftape-header-segment.h ftape-vendors.h \ 14 + fuse.h futex.h genetlink.h gen_stats.h gigaset_dev.h hdsmart.h \ 15 + hpfs_fs.h hysdn_if.h i2c-dev.h i8k.h icmp.h \ 16 + if_arcnet.h if_arp.h if_bonding.h if_cablemodem.h if_fc.h \ 17 + if_fddi.h if.h if_hippi.h if_infiniband.h if_packet.h \ 18 + if_plip.h if_ppp.h if_slip.h if_strip.h if_tunnel.h in6.h \ 19 + in_route.h ioctl.h ip.h ipmi_msgdefs.h ip_mp_alg.h ipsec.h \ 20 + ipx.h irda.h isdn_divertif.h iso_fs.h ite_gpio.h ixjuser.h \ 21 + jffs2.h keyctl.h limits.h major.h matroxfb.h meye.h minix_fs.h \ 22 + mmtimer.h mqueue.h mtio.h ncp_no.h netfilter_arp.h netrom.h \ 23 + nfs2.h nfs4_mount.h nfs_mount.h openprom_fs.h param.h \ 24 + pci_ids.h pci_regs.h personality.h pfkeyv2.h pg.h pkt_cls.h \ 25 + pkt_sched.h posix_types.h ppdev.h prctl.h ps2esdi.h qic117.h \ 26 + qnxtypes.h quotaio_v1.h quotaio_v2.h radeonfb.h raw.h \ 27 + resource.h rose.h sctp.h smbno.h snmp.h sockios.h som.h \ 28 + sound.h stddef.h synclink.h telephony.h termios.h ticable.h \ 29 + times.h tiocl.h tipc.h toshiba.h ultrasound.h un.h utime.h \ 30 + utsname.h video_decoder.h video_encoder.h videotext.h vt.h \ 31 + wavefront.h wireless.h xattr.h x25.h zorro_ids.h 32 + 33 + unifdef-y += acct.h adb.h adfs_fs.h agpgart.h apm_bios.h atalk.h \ 34 + atmarp.h atmdev.h atm.h atm_tcp.h audit.h auto_fs.h binfmts.h \ 35 + capability.h capi.h cciss_ioctl.h cdrom.h cm4000_cs.h \ 36 + cn_proc.h coda.h connector.h cramfs_fs.h cuda.h cyclades.h \ 37 + dccp.h dirent.h divert.h elfcore.h errno.h errqueue.h \ 38 + ethtool.h eventpoll.h ext2_fs.h ext3_fs.h fb.h fcntl.h \ 39 + filter.h flat.h fs.h ftape.h gameport.h generic_serial.h \ 40 + genhd.h hayesesp.h hdlcdrv.h hdlc.h hdreg.h hiddev.h hpet.h \ 41 + i2c.h i2o-dev.h icmpv6.h if_bridge.h if_ec.h \ 42 + if_eql.h if_ether.h if_frad.h if_ltalk.h if_pppox.h \ 43 + if_shaper.h if_tr.h if_tun.h if_vlan.h if_wanpipe.h igmp.h \ 44 + inet_diag.h in.h inotify.h input.h ipc.h ipmi.h ipv6.h \ 45 + ipv6_route.h isdn.h isdnif.h isdn_ppp.h isicom.h jbd.h \ 46 + joystick.h kdev_t.h kd.h kernelcapi.h kernel.h keyboard.h \ 47 + llc.h loop.h lp.h mempolicy.h mii.h mman.h mroute.h msdos_fs.h \ 48 + msg.h nbd.h ncp_fs.h ncp.h ncp_mount.h netdevice.h \ 49 + netfilter_bridge.h netfilter_decnet.h netfilter.h \ 50 + netfilter_ipv4.h netfilter_ipv6.h netfilter_logging.h net.h \ 51 + netlink.h nfs3.h nfs4.h nfsacl.h nfs_fs.h nfs.h nfs_idmap.h \ 52 + n_r3964.h nubus.h nvram.h parport.h patchkey.h pci.h pktcdvd.h \ 53 + pmu.h poll.h ppp_defs.h ppp-comp.h ptrace.h qnx4_fs.h quota.h \ 54 + random.h reboot.h reiserfs_fs.h reiserfs_xattr.h romfs_fs.h \ 55 + route.h rtc.h rtnetlink.h scc.h sched.h sdla.h \ 56 + selinux_netlink.h sem.h serial_core.h serial.h serio.h shm.h \ 57 + signal.h smb_fs.h smb.h smb_mount.h socket.h sonet.h sonypi.h \ 58 + soundcard.h stat.h sysctl.h tcp.h time.h timex.h tty.h types.h \ 59 + udf_fs_i.h udp.h uinput.h uio.h unistd.h usb_ch9.h \ 60 + usbdevice_fs.h user.h videodev2.h videodev.h wait.h \ 61 + wanrouter.h watchdog.h xfrm.h zftape.h 62 + 63 + objhdr-y := version.h
+2
include/linux/byteorder/Kbuild
··· 1 + unifdef-y += generic.h swabb.h swab.h 2 + header-y += big_endian.h little_endian.h pdp_endian.h
+2
include/linux/dvb/Kbuild
··· 1 + header-y += ca.h frontend.h net.h osd.h version.h 2 + unifdef-y := audio.h dmx.h video.h
+1
include/linux/hdlc/Kbuild
··· 1 + header-y += ioctl.h
+1
include/linux/isdn/Kbuild
··· 1 + header-y += capicmd.h
+11
include/linux/netfilter/Kbuild
··· 1 + header-y := nf_conntrack_sctp.h nf_conntrack_tuple_common.h \ 2 + nfnetlink_conntrack.h nfnetlink_log.h nfnetlink_queue.h \ 3 + xt_CLASSIFY.h xt_comment.h xt_connbytes.h xt_connmark.h \ 4 + xt_CONNMARK.h xt_conntrack.h xt_dccp.h xt_esp.h \ 5 + xt_helper.h xt_length.h xt_limit.h xt_mac.h xt_mark.h \ 6 + xt_MARK.h xt_multiport.h xt_NFQUEUE.h xt_pkttype.h \ 7 + xt_policy.h xt_realm.h xt_sctp.h xt_state.h xt_string.h \ 8 + xt_tcpmss.h xt_tcpudp.h 9 + 10 + unifdef-y := nf_conntrack_common.h nf_conntrack_ftp.h \ 11 + nf_conntrack_tcp.h nfnetlink.h x_tables.h xt_physdev.h
+2
include/linux/netfilter_arp/Kbuild
··· 1 + header-y := arpt_mangle.h 2 + unifdef-y := arp_tables.h
+4
include/linux/netfilter_bridge/Kbuild
··· 1 + header-y += ebt_among.h ebt_arp.h ebt_arpreply.h ebt_ip.h ebt_limit.h \ 2 + ebt_log.h ebt_mark_m.h ebt_mark_t.h ebt_nat.h ebt_pkttype.h \ 3 + ebt_redirect.h ebt_stp.h ebt_ulog.h ebt_vlan.h 4 + unifdef-y := ebtables.h ebt_802_3.h
+21
include/linux/netfilter_ipv4/Kbuild
··· 1 + 2 + header-y := ip_conntrack_helper.h ip_conntrack_helper_h323_asn1.h \ 3 + ip_conntrack_helper_h323_types.h ip_conntrack_protocol.h \ 4 + ip_conntrack_sctp.h ip_conntrack_tcp.h ip_conntrack_tftp.h \ 5 + ip_nat_pptp.h ipt_addrtype.h ipt_ah.h \ 6 + ipt_CLASSIFY.h ipt_CLUSTERIP.h ipt_comment.h \ 7 + ipt_connbytes.h ipt_connmark.h ipt_CONNMARK.h \ 8 + ipt_conntrack.h ipt_dccp.h ipt_dscp.h ipt_DSCP.h ipt_ecn.h \ 9 + ipt_ECN.h ipt_esp.h ipt_hashlimit.h ipt_helper.h \ 10 + ipt_iprange.h ipt_length.h ipt_limit.h ipt_LOG.h ipt_mac.h \ 11 + ipt_mark.h ipt_MARK.h ipt_multiport.h ipt_NFQUEUE.h \ 12 + ipt_owner.h ipt_physdev.h ipt_pkttype.h ipt_policy.h \ 13 + ipt_realm.h ipt_recent.h ipt_REJECT.h ipt_SAME.h \ 14 + ipt_sctp.h ipt_state.h ipt_string.h ipt_tcpmss.h \ 15 + ipt_TCPMSS.h ipt_tos.h ipt_TOS.h ipt_ttl.h ipt_TTL.h \ 16 + ipt_ULOG.h 17 + 18 + unifdef-y := ip_conntrack.h ip_conntrack_h323.h ip_conntrack_irc.h \ 19 + ip_conntrack_pptp.h ip_conntrack_proto_gre.h \ 20 + ip_conntrack_tuple.h ip_nat.h ip_nat_rule.h ip_queue.h \ 21 + ip_tables.h
+6
include/linux/netfilter_ipv6/Kbuild
··· 1 + header-y += ip6t_HL.h ip6t_LOG.h ip6t_MARK.h ip6t_REJECT.h ip6t_ah.h \ 2 + ip6t_esp.h ip6t_frag.h ip6t_hl.h ip6t_ipv6header.h \ 3 + ip6t_length.h ip6t_limit.h ip6t_mac.h ip6t_mark.h \ 4 + ip6t_multiport.h ip6t_opts.h ip6t_owner.h ip6t_policy.h \ 5 + ip6t_physdev.h ip6t_rt.h 6 + unifdef-y := ip6_tables.h
+2
include/linux/nfsd/Kbuild
··· 1 + unifdef-y := const.h export.h stats.h syscall.h nfsfh.h debug.h auth.h 2 +
+1
include/linux/raid/Kbuild
··· 1 + header-y += md_p.h md_u.h
+1
include/linux/sunrpc/Kbuild
··· 1 + unifdef-y := debug.h
+1
include/linux/tc_act/Kbuild
··· 1 + header-y += tc_gact.h tc_ipt.h tc_mirred.h tc_pedit.h
+1
include/linux/tc_ematch/Kbuild
··· 1 + headers-y := tc_em_cmp.h tc_em_meta.h tc_em_nbyte.h tc_em_text.h
+2
include/mtd/Kbuild
··· 1 + unifdef-y := mtd-abi.h 2 + header-y := inftl-user.h jffs2-user.h mtd-user.h nftl-user.h
+1
include/rdma/Kbuild
··· 1 + header-y := ib_user_mad.h
+2
include/scsi/Kbuild
··· 1 + header-y += scsi.h 2 + unifdef-y := scsi_ioctl.h sg.h
+2
include/sound/Kbuild
··· 1 + header-y := asound_fm.h hdsp.h hdspm.h sfnt_info.h sscape_ioctl.h 2 + unifdef-y := asequencer.h asound.h emu10k1.h sb16_csp.h
+1
include/video/Kbuild
··· 1 + unifdef-y := sisfb.h
+158
scripts/Makefile.headersinst
··· 1 + # ========================================================================== 2 + # Installing headers 3 + # 4 + # header-y files will be installed verbatim 5 + # unifdef-y are the files where unifdef will be run before installing files 6 + # objhdr-y are generated files that will be installed verbatim 7 + # 8 + # ========================================================================== 9 + 10 + UNIFDEF := unifdef -U__KERNEL__ 11 + 12 + # Eliminate the contents of (and inclusions of) compiler.h 13 + HDRSED := sed -e "s/ inline / __inline__ /g" \ 14 + -e "s/[[:space:]]__user[[:space:]]\+/ /g" \ 15 + -e "s/(__user[[:space:]]\+/ (/g" \ 16 + -e "s/[[:space:]]__force[[:space:]]\+/ /g" \ 17 + -e "s/(__force[[:space:]]\+/ (/g" \ 18 + -e "s/[[:space:]]__iomem[[:space:]]\+/ /g" \ 19 + -e "s/(__iomem[[:space:]]\+/ (/g" \ 20 + -e "s/[[:space:]]__attribute_const__[[:space:]]\+/\ /g" \ 21 + -e "s/[[:space:]]__attribute_const__$$//" \ 22 + -e "/^\#include <linux\/compiler.h>/d" 23 + 24 + _dst := $(if $(dst),$(dst),$(obj)) 25 + 26 + .PHONY: __headersinst 27 + __headersinst: 28 + 29 + 30 + ifeq (,$(patsubst include/asm/%,,$(obj)/)) 31 + # For producing the generated stuff in include/asm for biarch builds, include 32 + # both sets of Kbuild files; we'll generate anything which is mentioned in 33 + # _either_ arch, and recurse into subdirectories which are mentioned in either 34 + # arch. Since some directories may exist in one but not the other, we must 35 + # use '-include'. 36 + GENASM := 1 37 + archasm := $(subst include/asm,asm-$(ARCH),$(obj)) 38 + altarchasm := $(subst include/asm,asm-$(ALTARCH),$(obj)) 39 + -include $(srctree)/include/$(archasm)/Kbuild 40 + -include $(srctree)/include/$(altarchasm)/Kbuild 41 + else 42 + include $(srctree)/$(obj)/Kbuild 43 + endif 44 + 45 + include scripts/Kbuild.include 46 + 47 + # If this is include/asm-$(ARCH) and there's no $(ALTARCH), then 48 + # override $(_dst) so that we install to include/asm directly. 49 + ifeq ($(obj)$(ALTARCH),include/asm-$(ARCH)) 50 + _dst := include/asm 51 + endif 52 + 53 + header-y := $(sort $(header-y)) 54 + unifdef-y := $(sort $(unifdef-y)) 55 + subdir-y := $(patsubst %/,%,$(filter %/, $(header-y))) 56 + header-y := $(filter-out %/, $(header-y)) 57 + header-y := $(filter-out $(unifdef-y),$(header-y)) 58 + 59 + ifdef ALTARCH 60 + ifeq ($(obj),include/asm-$(ARCH)) 61 + altarch-y := altarch-dir 62 + endif 63 + endif 64 + 65 + # Make the definitions visible for recursive make invocations 66 + export ALTARCH 67 + export ARCHDEF 68 + export ALTARCHDEF 69 + 70 + quiet_cmd_o_hdr_install = INSTALL $(_dst)/$@ 71 + cmd_o_hdr_install = cp $(objtree)/$(obj)/$@ $(INSTALL_HDR_PATH)/$(_dst) 72 + 73 + quiet_cmd_headers_install = INSTALL $(_dst)/$@ 74 + cmd_headers_install = $(HDRSED) $(srctree)/$(obj)/$@ \ 75 + > $(INSTALL_HDR_PATH)/$(_dst)/$@ 76 + 77 + quiet_cmd_unifdef = UNIFDEF $(_dst)/$@ 78 + cmd_unifdef = $(UNIFDEF) $(srctree)/$(obj)/$@ | $(HDRSED) \ 79 + > $(INSTALL_HDR_PATH)/$(_dst)/$@ || : 80 + 81 + quiet_cmd_check = CHECK $(_dst)/$@ 82 + cmd_check = $(srctree)/scripts/hdrcheck.sh \ 83 + $(INSTALL_HDR_PATH)/include \ 84 + $(INSTALL_HDR_PATH)/$(_dst)/$@ 85 + 86 + quiet_cmd_mkdir = MKDIR $@ 87 + cmd_mkdir = mkdir -p $(INSTALL_HDR_PATH)/$@ 88 + 89 + quiet_cmd_gen = GEN $(_dst)/$@ 90 + cmd_gen = \ 91 + STUBDEF=__ASM_STUB_`echo $@ | tr a-z. A-Z_`; \ 92 + (echo "/* File autogenerated by 'make headers_install' */" ; \ 93 + echo "\#ifndef $$STUBDEF" ; \ 94 + echo "\#define $$STUBDEF" ; \ 95 + echo "\# if $(ARCHDEF)" ; \ 96 + if [ -r $(srctree)/include/$(archasm)/$@ ]; then \ 97 + echo "\# include <$(archasm)/$@>" ; \ 98 + else \ 99 + echo "\# error $(archasm)/$@ does not exist in" \ 100 + "the $(ARCH) architecture" ; \ 101 + fi ; \ 102 + echo "\# elif $(ALTARCHDEF)" ; \ 103 + if [ -r $(srctree)/include/$(altarchasm)/$@ ]; then \ 104 + echo "\# include <$(altarchasm)/$@>" ; \ 105 + else \ 106 + echo "\# error $(altarchasm)/$@ does not exist in" \ 107 + "the $(ALTARCH) architecture" ; \ 108 + fi ; \ 109 + echo "\# else" ; \ 110 + echo "\# warning This machine appears to be" \ 111 + "neither $(ARCH) nor $(ALTARCH)." ; \ 112 + echo "\# endif" ; \ 113 + echo "\#endif /* $$STUBDEF */" ; \ 114 + ) > $(INSTALL_HDR_PATH)/$(_dst)/$@ 115 + 116 + __headersinst: $(subdir-y) $(header-y) $(unifdef-y) $(altarch-y) $(objhdr-y) 117 + 118 + .PHONY: $(header-y) $(unifdef-y) $(subdir-y) 119 + 120 + ifdef HDRCHECK 121 + # Rules for checking headers 122 + $(objhdr-y) $(header-y) $(unifdef-y): 123 + $(call cmd,check) 124 + else 125 + # Rules for installing headers 126 + 127 + $(objhdr-y) $(subdir-y) $(header-y) $(unifdef-y): $(_dst) 128 + 129 + .PHONY: $(_dst) 130 + $(_dst): 131 + $(call cmd,mkdir) 132 + 133 + ifdef GENASM 134 + $(objhdr-y) $(header-y) $(unifdef-y): 135 + $(call cmd,gen) 136 + 137 + else 138 + $(objhdr-y): 139 + $(call cmd,o_hdr_install) 140 + 141 + $(header-y): 142 + $(call cmd,headers_install) 143 + 144 + $(unifdef-y): 145 + $(call cmd,unifdef) 146 + endif 147 + endif 148 + 149 + hdrinst := -rR -f $(srctree)/scripts/Makefile.headersinst obj 150 + 151 + .PHONY: altarch-dir 152 + altarch-dir: 153 + $(Q)$(MAKE) $(hdrinst)=include/asm-$(ALTARCH) dst=include/asm-$(ALTARCH) 154 + $(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm 155 + 156 + # Recursion 157 + $(subdir-y): 158 + $(Q)$(MAKE) $(hdrinst)=$(obj)/$@ dst=$(_dst)/$@ rel=../$(rel)
+8
scripts/hdrcheck.sh
··· 1 + #!/bin/sh 2 + 3 + for FILE in `grep '^#include <' $2 | cut -f2 -d\< | cut -f1 -d\> | egrep ^linux\|^asm` ; do 4 + if [ ! -r $1/$FILE ]; then 5 + echo $2 requires $FILE, which does not exist 6 + exit 1 7 + fi 8 + done