ia64/linux-2.6.18-xen.hg

annotate scripts/Makefile.headersinst @ 893:f994bfe9b93b

linux/blktap2: reduce TLB flush scope

c/s 885 added very coarse TLB flushing. Since these flushes always
follow single page updates, single page flushes (when available) are
sufficient.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 04 10:32:57 2009 +0100 (2009-06-04)
parents 831230e53067
children
rev   line source
ian@0 1 # ==========================================================================
ian@0 2 # Installing headers
ian@0 3 #
ian@0 4 # header-y files will be installed verbatim
ian@0 5 # unifdef-y are the files where unifdef will be run before installing files
ian@0 6 # objhdr-y are generated files that will be installed verbatim
ian@0 7 #
ian@0 8 # ==========================================================================
ian@0 9
ian@0 10 UNIFDEF := unifdef -U__KERNEL__
ian@0 11
ian@0 12 # Eliminate the contents of (and inclusions of) compiler.h
ian@0 13 HDRSED := sed -e "s/ inline / __inline__ /g" \
ian@0 14 -e "s/[[:space:]]__user[[:space:]]\+/ /g" \
ian@0 15 -e "s/(__user[[:space:]]\+/ (/g" \
ian@0 16 -e "s/[[:space:]]__force[[:space:]]\+/ /g" \
ian@0 17 -e "s/(__force[[:space:]]\+/ (/g" \
ian@0 18 -e "s/[[:space:]]__iomem[[:space:]]\+/ /g" \
ian@0 19 -e "s/(__iomem[[:space:]]\+/ (/g" \
ian@0 20 -e "s/[[:space:]]__attribute_const__[[:space:]]\+/\ /g" \
ian@0 21 -e "s/[[:space:]]__attribute_const__$$//" \
ian@0 22 -e "/^\#include <linux\/compiler.h>/d"
ian@0 23
ian@0 24 _dst := $(if $(dst),$(dst),$(obj))
ian@0 25
ian@0 26 .PHONY: __headersinst
ian@0 27 __headersinst:
ian@0 28
ian@0 29
ian@0 30 ifeq (,$(patsubst include/asm/%,,$(obj)/))
ian@0 31 # For producing the generated stuff in include/asm for biarch builds, include
ian@0 32 # both sets of Kbuild files; we'll generate anything which is mentioned in
ian@0 33 # _either_ arch, and recurse into subdirectories which are mentioned in either
ian@0 34 # arch. Since some directories may exist in one but not the other, we must
ian@0 35 # use '-include'.
ian@0 36 GENASM := 1
ian@0 37 archasm := $(subst include/asm,asm-$(ARCH),$(obj))
ian@0 38 altarchasm := $(subst include/asm,asm-$(ALTARCH),$(obj))
ian@0 39 -include $(srctree)/include/$(archasm)/Kbuild
ian@0 40 -include $(srctree)/include/$(altarchasm)/Kbuild
ian@0 41 else
ian@0 42 include $(srctree)/$(obj)/Kbuild
ian@0 43 endif
ian@0 44
ian@0 45 include scripts/Kbuild.include
ian@0 46
ian@0 47 # If this is include/asm-$(ARCH) and there's no $(ALTARCH), then
ian@0 48 # override $(_dst) so that we install to include/asm directly.
ian@0 49 ifeq ($(obj)$(ALTARCH),include/asm-$(ARCH))
ian@0 50 _dst := include/asm
ian@0 51 endif
ian@0 52
ian@0 53 header-y := $(sort $(header-y))
ian@0 54 unifdef-y := $(sort $(unifdef-y))
ian@0 55 subdir-y := $(patsubst %/,%,$(filter %/, $(header-y)))
ian@0 56 header-y := $(filter-out %/, $(header-y))
ian@0 57 header-y := $(filter-out $(unifdef-y),$(header-y))
ian@0 58
ian@0 59 ifdef ALTARCH
ian@0 60 ifeq ($(obj),include/asm-$(ARCH))
ian@0 61 altarch-y := altarch-dir
ian@0 62 endif
ian@0 63 endif
ian@0 64
ian@0 65 # Make the definitions visible for recursive make invocations
ian@0 66 export ALTARCH
ian@0 67 export ARCHDEF
ian@0 68 export ALTARCHDEF
ian@0 69
ian@0 70 quiet_cmd_o_hdr_install = INSTALL $(_dst)/$@
ian@0 71 cmd_o_hdr_install = cp $(objtree)/$(obj)/$@ $(INSTALL_HDR_PATH)/$(_dst)
ian@0 72
ian@0 73 quiet_cmd_headers_install = INSTALL $(_dst)/$@
ian@0 74 cmd_headers_install = $(HDRSED) $(srctree)/$(obj)/$@ \
ian@0 75 > $(INSTALL_HDR_PATH)/$(_dst)/$@
ian@0 76
ian@0 77 quiet_cmd_unifdef = UNIFDEF $(_dst)/$@
ian@0 78 cmd_unifdef = $(UNIFDEF) $(srctree)/$(obj)/$@ | $(HDRSED) \
ian@0 79 > $(INSTALL_HDR_PATH)/$(_dst)/$@ || :
ian@0 80
ian@0 81 quiet_cmd_check = CHECK $(_dst)/$@
ian@0 82 cmd_check = $(srctree)/scripts/hdrcheck.sh \
ian@0 83 $(INSTALL_HDR_PATH)/include \
ian@0 84 $(INSTALL_HDR_PATH)/$(_dst)/$@
ian@0 85
ian@0 86 quiet_cmd_mkdir = MKDIR $@
ian@0 87 cmd_mkdir = mkdir -p $(INSTALL_HDR_PATH)/$@
ian@0 88
ian@0 89 quiet_cmd_gen = GEN $(_dst)/$@
ian@0 90 cmd_gen = \
ian@0 91 STUBDEF=__ASM_STUB_`echo $@ | tr a-z. A-Z_`; \
ian@0 92 (echo "/* File autogenerated by 'make headers_install' */" ; \
ian@0 93 echo "\#ifndef $$STUBDEF" ; \
ian@0 94 echo "\#define $$STUBDEF" ; \
ian@0 95 echo "\# if $(ARCHDEF)" ; \
ian@0 96 if [ -r $(INSTALL_HDR_PATH)/include/$(archasm)/$@ ]; then \
ian@0 97 echo "\# include <$(archasm)/$@>" ; \
ian@0 98 else \
ian@0 99 echo "\# error $(archasm)/$@ does not exist in" \
ian@0 100 "the $(ARCH) architecture" ; \
ian@0 101 fi ; \
ian@0 102 echo "\# elif $(ALTARCHDEF)" ; \
ian@0 103 if [ -r $(INSTALL_HDR_PATH)/include/$(altarchasm)/$@ ]; then \
ian@0 104 echo "\# include <$(altarchasm)/$@>" ; \
ian@0 105 else \
ian@0 106 echo "\# error $(altarchasm)/$@ does not exist in" \
ian@0 107 "the $(ALTARCH) architecture" ; \
ian@0 108 fi ; \
ian@0 109 echo "\# else" ; \
ian@0 110 echo "\# warning This machine appears to be" \
ian@0 111 "neither $(ARCH) nor $(ALTARCH)." ; \
ian@0 112 echo "\# endif" ; \
ian@0 113 echo "\#endif /* $$STUBDEF */" ; \
ian@0 114 ) > $(INSTALL_HDR_PATH)/$(_dst)/$@
ian@0 115
ian@0 116 __headersinst: $(subdir-y) $(header-y) $(unifdef-y) $(altarch-y) $(objhdr-y)
ian@0 117
ian@0 118 .PHONY: $(header-y) $(unifdef-y) $(subdir-y)
ian@0 119
ian@0 120 ifdef HDRCHECK
ian@0 121 # Rules for checking headers
ian@0 122 $(objhdr-y) $(header-y) $(unifdef-y):
ian@0 123 $(call cmd,check)
ian@0 124 else
ian@0 125 # Rules for installing headers
ian@0 126
ian@0 127 $(objhdr-y) $(subdir-y) $(header-y) $(unifdef-y): $(_dst)
ian@0 128
ian@0 129 .PHONY: $(_dst)
ian@0 130 $(_dst):
ian@0 131 $(call cmd,mkdir)
ian@0 132
ian@0 133 ifdef GENASM
ian@0 134 $(objhdr-y) $(header-y) $(unifdef-y):
ian@0 135 $(call cmd,gen)
ian@0 136
ian@0 137 else
ian@0 138 $(objhdr-y):
ian@0 139 $(call cmd,o_hdr_install)
ian@0 140
ian@0 141 $(header-y):
ian@0 142 $(call cmd,headers_install)
ian@0 143
ian@0 144 $(unifdef-y):
ian@0 145 $(call cmd,unifdef)
ian@0 146 endif
ian@0 147 endif
ian@0 148
ian@0 149 hdrinst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
ian@0 150
ian@0 151 .PHONY: altarch-dir
ian@0 152 # All the files in the normal arch dir must be created first, since we test
ian@0 153 # for their existence.
ian@0 154 altarch-dir: $(subdir-y) $(header-y) $(unifdef-y) $(objhdr-y)
ian@0 155 $(Q)$(MAKE) $(hdrinst)=include/asm-$(ALTARCH) dst=include/asm-$(ALTARCH)
ian@0 156 $(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm
ian@0 157
ian@0 158 # Recursion
ian@0 159 $(subdir-y):
ian@0 160 $(Q)$(MAKE) $(hdrinst)=$(obj)/$@ dst=$(_dst)/$@ rel=../$(rel)