--- zzzz-none-000/linux-4.19.183/scripts/Makefile.headersinst 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/scripts/Makefile.headersinst 2023-06-28 08:54:21.000000000 +0000 @@ -31,18 +31,23 @@ $(subdirs): $(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(dst)/$@ +ifeq ($(no-skip),) # Skip header install/check for include/uapi and arch/$(SRCARCH)/include/uapi. # We have only sub-directories there. skip-inst := $(if $(filter %/uapi,$(obj)),1) +endif ifeq ($(skip-inst),) +# generated header directory +gen := $(if $(gen),$(gen),$(subst include/,include/generated/,$(obj))) + # Kbuild file is optional kbuild-file := $(srctree)/$(obj)/Kbuild -include $(kbuild-file) installdir := $(INSTALL_HDR_PATH)/$(dst) -gendir := $(objtree)/$(subst include/,include/generated/,$(obj)) +gendir := $(objtree)/$(gen) header-files := $(notdir $(wildcard $(srcdir)/*.h)) header-files += $(notdir $(wildcard $(srcdir)/*.agh)) header-files := $(filter-out $(no-export-headers), $(header-files)) @@ -64,9 +69,11 @@ endif endif +ifeq ($(no-skip),) # Work out what needs to be removed oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h)) unwanted := $(filter-out $(all-files),$(oldheaders)) +endif # Prefix unwanted with full paths to $(INSTALL_HDR_PATH) unwanted-file := $(addprefix $(installdir)/, $(unwanted)) @@ -101,7 +108,7 @@ $(install-file): scripts/headers_install.sh \ $(addprefix $(srcdir)/,$(header-files)) \ $(addprefix $(gendir)/,$(genhdr-files)) FORCE - $(if $(unwanted),$(call cmd,remove),) + $(if $(subst include/uapi,,$(dst)),$(if $(unwanted),$(call cmd,remove),)) $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@))) $(call if_changed,install)