unifdef utility is fast enough to warrant that we always run the scripts through unifdef. This patch runs all headers listed with header-y and unifdef-y through unifdef. Next step is to drop unifdef-y in all Kbuild files and that can now be done in smaller steps.
Unified · Split
| @@ -50,25 +50,22 @@ ifeq ($(obj)$(ALTARCH),include/asm-$(ARCH)$(BIASMDIR)) · 49 unmodified lines | ||
| 50 | 50 | _dst := include/asm |
| 51 | 51 | endif |
| 52 | 52 | |
| 53 | −header-y := $(sort $(header-y)) | |
| 54 | −unifdef-y := $(sort $(unifdef-y)) | |
| 53 | +header-y := $(sort $(header-y) $(unifdef-y)) | |
| 55 | 54 | subdir-y := $(patsubst %/,%,$(filter %/, $(header-y))) |
| 56 | 55 | header-y := $(filter-out %/, $(header-y)) |
| 57 | −header-y := $(filter-out $(unifdef-y),$(header-y)) | |
| 58 | 56 | |
| 59 | 57 | # stamp files for header checks |
| 60 | −check-y := $(patsubst %,.check.%,$(header-y) $(unifdef-y) $(objhdr-y)) | |
| 58 | +check-y := $(patsubst %,.check.%,$(header-y) $(objhdr-y)) | |
| 61 | 59 | |
| 62 | 60 | # Work out what needs to be removed |
| 63 | 61 | oldheaders := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/*.h)) |
| 64 | −unwanted := $(filter-out $(header-y) $(unifdef-y) $(objhdr-y),$(oldheaders)) | |
| 62 | +unwanted := $(filter-out $(header-y) $(objhdr-y),$(oldheaders)) | |
| 65 | 63 | |
| 66 | 64 | oldcheckstamps := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/.check.*.h)) |
| 67 | 65 | unwanted += $(filter-out $(check-y),$(oldcheckstamps)) |
| 68 | 66 | |
| 69 | 67 | # Prefix them all with full paths to $(INSTALL_HDR_PATH) |
| 70 | 68 | header-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(header-y)) |
| 71 | −unifdef-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(unifdef-y)) | |
| 72 | 69 | objhdr-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(objhdr-y)) |
| 73 | 70 | check-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(check-y)) |
| 74 | 71 | |
| @@ -88,10 +85,6 @@ quiet_cmd_o_hdr_install = INSTALL $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) · 13 unmodified lines | ||
| 88 | 85 | cmd_o_hdr_install = cp $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(objtree)/$(obj)/%,$@) \ |
| 89 | 86 | $(INSTALL_HDR_PATH)/$(_dst) |
| 90 | 87 | |
| 91 | −quiet_cmd_headers_install = INSTALL $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) | |
| 92 | − cmd_headers_install = $(HDRSED) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \ | |
| 93 | − > $@ | |
| 94 | − | |
| 95 | 88 | quiet_cmd_unifdef = UNIFDEF $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) |
| 96 | 89 | cmd_unifdef = $(UNIFDEF) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \ |
| 97 | 90 | | $(HDRSED) > $@ || : |
| @@ -151,10 +144,10 @@ include /dev/null $(wildcard $(check-y)) · 53 unmodified lines | ||
| 151 | 144 | |
| 152 | 145 | else |
| 153 | 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 | 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 | 152 | $(INSTALL_HDR_PATH)/$(_dst): |
| 160 | 153 | $(call cmd,mkdir) |
| @@ -164,18 +157,16 @@ $(unwanted): · 3 unmodified lines | ||
| 164 | 157 | $(call cmd,remove) |
| 165 | 158 | |
| 166 | 159 | ifdef GENASM |
| 167 | −$(objhdr-y) $(header-y) $(unifdef-y): $(KBUILDFILES) | |
| 160 | +$(objhdr-y) $(header-y): $(KBUILDFILES) | |
| 168 | 161 | $(call cmd,gen) |
| 169 | 162 | |
| 170 | 163 | else |
| 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 | 165 | $(call cmd,o_hdr_install) |
| 173 | 166 | |
| 174 | −$(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) | |
| 167 | +$(header-y): $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES) | |
| 178 | 168 | $(call cmd,unifdef) |
| 169 | + | |
| 179 | 170 | endif |
| 180 | 171 | endif |
| 181 | 172 | |
| @@ -184,7 +175,7 @@ hdrinst := -rR -f $(srctree)/scripts/Makefile.headersinst obj · 2 unmodified lines | ||
| 184 | 175 | .PHONY: altarch-dir |
| 185 | 176 | # All the files in the normal arch dir must be created first, since we test |
| 186 | 177 | # for their existence. |
| 187 | −altarch-dir: $(subdir-y) $(header-y) $(unifdef-y) $(objhdr-y) | |
| 178 | +altarch-dir: $(subdir-y) $(header-y) $(objhdr-y) | |
| 188 | 179 | $(Q)$(MAKE) $(hdrinst)=include/asm-$(ALTARCH) dst=include/asm-$(ALTARCH) |
| 189 | 180 | $(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm$(BIASMDIR) |
| 190 | 181 | |