aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.headersinst29
1 files changed, 10 insertions, 19 deletions
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 53dae3eb3d1f..22b17af0902f 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -50,25 +50,22 @@ ifeq ($(obj)$(ALTARCH),include/asm-$(ARCH)$(BIASMDIR))
50 _dst := include/asm 50 _dst := include/asm
51endif 51endif
52 52
53header-y := $(sort $(header-y)) 53header-y := $(sort $(header-y) $(unifdef-y))
54unifdef-y := $(sort $(unifdef-y))
55subdir-y := $(patsubst %/,%,$(filter %/, $(header-y))) 54subdir-y := $(patsubst %/,%,$(filter %/, $(header-y)))
56header-y := $(filter-out %/, $(header-y)) 55header-y := $(filter-out %/, $(header-y))
57header-y := $(filter-out $(unifdef-y),$(header-y))
58 56
59# stamp files for header checks 57# stamp files for header checks
60check-y := $(patsubst %,.check.%,$(header-y) $(unifdef-y) $(objhdr-y)) 58check-y := $(patsubst %,.check.%,$(header-y) $(objhdr-y))
61 59
62# Work out what needs to be removed 60# Work out what needs to be removed
63oldheaders := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/*.h)) 61oldheaders := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/*.h))
64unwanted := $(filter-out $(header-y) $(unifdef-y) $(objhdr-y),$(oldheaders)) 62unwanted := $(filter-out $(header-y) $(objhdr-y),$(oldheaders))
65 63
66oldcheckstamps := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/.check.*.h)) 64oldcheckstamps := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/.check.*.h))
67unwanted += $(filter-out $(check-y),$(oldcheckstamps)) 65unwanted += $(filter-out $(check-y),$(oldcheckstamps))
68 66
69# Prefix them all with full paths to $(INSTALL_HDR_PATH) 67# Prefix them all with full paths to $(INSTALL_HDR_PATH)
70header-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(header-y)) 68header-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(header-y))
71unifdef-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(unifdef-y))
72objhdr-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(objhdr-y)) 69objhdr-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(objhdr-y))
73check-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(check-y)) 70check-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(check-y))
74 71
@@ -88,10 +85,6 @@ quiet_cmd_o_hdr_install = INSTALL $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
88 cmd_o_hdr_install = cp $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(objtree)/$(obj)/%,$@) \ 85 cmd_o_hdr_install = cp $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(objtree)/$(obj)/%,$@) \
89 $(INSTALL_HDR_PATH)/$(_dst) 86 $(INSTALL_HDR_PATH)/$(_dst)
90 87
91quiet_cmd_headers_install = INSTALL $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
92 cmd_headers_install = $(HDRSED) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \
93 > $@
94
95quiet_cmd_unifdef = UNIFDEF $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) 88quiet_cmd_unifdef = UNIFDEF $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
96 cmd_unifdef = $(UNIFDEF) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \ 89 cmd_unifdef = $(UNIFDEF) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \
97 | $(HDRSED) > $@ || : 90 | $(HDRSED) > $@ || :
@@ -151,10 +144,10 @@ include /dev/null $(wildcard $(check-y))
151 144
152else 145else
153# Rules for installing headers 146# Rules for installing headers
154__headersinst: $(subdir-y) $(header-y) $(unifdef-y) $(altarch-y) $(objhdr-y) 147__headersinst: $(subdir-y) $(header-y) $(altarch-y) $(objhdr-y)
155 @true 148 @true
156 149
157$(objhdr-y) $(subdir-y) $(header-y) $(unifdef-y): | $(INSTALL_HDR_PATH)/$(_dst) $(unwanted) 150$(objhdr-y) $(subdir-y) $(header-y): | $(INSTALL_HDR_PATH)/$(_dst) $(unwanted)
158 151
159$(INSTALL_HDR_PATH)/$(_dst): 152$(INSTALL_HDR_PATH)/$(_dst):
160 $(call cmd,mkdir) 153 $(call cmd,mkdir)
@@ -164,18 +157,16 @@ $(unwanted):
164 $(call cmd,remove) 157 $(call cmd,remove)
165 158
166ifdef GENASM 159ifdef GENASM
167$(objhdr-y) $(header-y) $(unifdef-y): $(KBUILDFILES) 160$(objhdr-y) $(header-y): $(KBUILDFILES)
168 $(call cmd,gen) 161 $(call cmd,gen)
169 162
170else 163else
171$(objhdr-y) : $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(objtree)/$(obj)/%.h $(KBUILDFILES) 164$(objhdr-y): $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(objtree)/$(obj)/%.h $(KBUILDFILES)
172 $(call cmd,o_hdr_install) 165 $(call cmd,o_hdr_install)
173 166
174$(header-y) : $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES) 167$(header-y): $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES)
175 $(call cmd,headers_install)
176
177$(unifdef-y) : $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES)
178 $(call cmd,unifdef) 168 $(call cmd,unifdef)
169
179endif 170endif
180endif 171endif
181 172
@@ -184,7 +175,7 @@ hdrinst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
184.PHONY: altarch-dir 175.PHONY: altarch-dir
185# All the files in the normal arch dir must be created first, since we test 176# All the files in the normal arch dir must be created first, since we test
186# for their existence. 177# for their existence.
187altarch-dir: $(subdir-y) $(header-y) $(unifdef-y) $(objhdr-y) 178altarch-dir: $(subdir-y) $(header-y) $(objhdr-y)
188 $(Q)$(MAKE) $(hdrinst)=include/asm-$(ALTARCH) dst=include/asm-$(ALTARCH) 179 $(Q)$(MAKE) $(hdrinst)=include/asm-$(ALTARCH) dst=include/asm-$(ALTARCH)
189 $(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm$(BIASMDIR) 180 $(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm$(BIASMDIR)
190 181