Skip to content

Commit a8ff49a

Browse files
committed
kbuild: pass dst= to Makefile.headersinst from top Makefile
We can always pass dst= from the top Makefile. This will simplify the logic in Makefile.headersinst. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 0f042ee commit a8ff49a

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

‎Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ PHONY += headers_install
11541154
headers_install: __headers
11551155
$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \
11561156
$(error Headers not exportable for the $(SRCARCH) architecture))
1157-
$(Q)$(MAKE) $(hdr-inst)=include/uapi
1157+
$(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include
11581158
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi $(hdr-dst)
11591159

11601160
PHONY += headers_check_all
@@ -1163,7 +1163,7 @@ headers_check_all: headers_install_all
11631163

11641164
PHONY += headers_check
11651165
headers_check: headers_install
1166-
$(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1
1166+
$(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include HDRCHECK=1
11671167
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi $(hdr-dst) HDRCHECK=1
11681168

11691169
# ---------------------------------------------------------------------------

‎scripts/Makefile.headersinst‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@ subdirs := $(patsubst $(srcdir)/%/,%,\
2323
$(filter-out $(srcdir)/,\
2424
$(sort $(dir $(wildcard $(srcdir)/*/)))))
2525

26-
# caller may set destination dir (when installing to asm/)
27-
_dst := $(if $(dst),$(dst),$(obj))
28-
2926
# Recursion
3027
__headers: $(subdirs)
3128

3229
.PHONY: $(subdirs)
3330
$(subdirs):
34-
$(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(_dst)/$@
31+
$(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(dst)/$@
3532

3633
# Skip header install/check for include/uapi and arch/$(hdr-arch)/include/uapi.
3734
# We have only sub-directories there.
@@ -48,8 +45,7 @@ ifneq ($(wildcard $(old-kbuild-file)),)
4845
include $(old-kbuild-file)
4946
endif
5047

51-
installdir := $(INSTALL_HDR_PATH)/$(subst uapi/,,$(_dst))
52-
48+
installdir := $(INSTALL_HDR_PATH)/$(dst)
5349
gendir := $(objtree)/$(subst include/,include/generated/,$(obj))
5450
header-files := $(notdir $(wildcard $(srcdir)/*.h))
5551
header-files += $(notdir $(wildcard $(srcdir)/*.agh))

0 commit comments

Comments
 (0)