Commit 7c025b2a authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by Masahiro Yamada

Makefile.headersinst: cleanup input files

After the last three patches, all exported headers are under uapi/, thus
input-files2 are not needed anymore.
The side effect is that input-files1-name is exactly header-y.

Note also that input-files3-name is genhdr-y.
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 25dc1d6c
...@@ -40,31 +40,20 @@ wrapper-files := $(filter $(header-y), $(generic-y)) ...@@ -40,31 +40,20 @@ wrapper-files := $(filter $(header-y), $(generic-y))
srcdir := $(srctree)/$(obj) srcdir := $(srctree)/$(obj)
gendir := $(objtree)/$(gen) gendir := $(objtree)/$(gen)
oldsrcdir := $(srctree)/$(subst /uapi,,$(obj))
# all headers files for this dir # all headers files for this dir
header-y := $(filter-out $(generic-y), $(header-y)) header-y := $(filter-out $(generic-y), $(header-y))
all-files := $(header-y) $(genhdr-y) $(wrapper-files) all-files := $(header-y) $(genhdr-y) $(wrapper-files)
output-files := $(addprefix $(installdir)/, $(all-files)) output-files := $(addprefix $(installdir)/, $(all-files))
input-files1 := $(foreach hdr, $(header-y), \ # Check that all expected files exist
$(if $(wildcard $(srcdir)/$(hdr)), \ $(foreach hdr, $(header-y), \
$(wildcard $(srcdir)/$(hdr))) \ $(if $(wildcard $(srcdir)/$(hdr)),, \
) $(error Missing UAPI file $(srcdir)/$(hdr)) \
input-files1-name := $(notdir $(input-files1)) ))
input-files2 := $(foreach hdr, $(header-y), \ $(foreach hdr, $(genhdr-y), \
$(if $(wildcard $(srcdir)/$(hdr)),, \ $(if $(wildcard $(gendir)/$(hdr)),, \
$(if $(wildcard $(oldsrcdir)/$(hdr)), \ $(error Missing generated UAPI file $(gendir)/$(hdr)) \
$(wildcard $(oldsrcdir)/$(hdr)), \ ))
$(error Missing UAPI file $(srcdir)/$(hdr))) \
))
input-files2-name := $(notdir $(input-files2))
input-files3 := $(foreach hdr, $(genhdr-y), \
$(if $(wildcard $(gendir)/$(hdr)), \
$(wildcard $(gendir)/$(hdr)), \
$(error Missing generated UAPI file $(gendir)/$(hdr)) \
))
input-files3-name := $(notdir $(input-files3))
# Work out what needs to be removed # Work out what needs to be removed
oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h)) oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h))
...@@ -78,9 +67,8 @@ printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@)) ...@@ -78,9 +67,8 @@ printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@))
quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\
file$(if $(word 2, $(all-files)),s)) file$(if $(word 2, $(all-files)),s))
cmd_install = \ cmd_install = \
$(CONFIG_SHELL) $< $(installdir) $(srcdir) $(input-files1-name); \ $(CONFIG_SHELL) $< $(installdir) $(srcdir) $(header-y); \
$(CONFIG_SHELL) $< $(installdir) $(oldsrcdir) $(input-files2-name); \ $(CONFIG_SHELL) $< $(installdir) $(gendir) $(genhdr-y); \
$(CONFIG_SHELL) $< $(installdir) $(gendir) $(input-files3-name); \
for F in $(wrapper-files); do \ for F in $(wrapper-files); do \
echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \ echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \
done; \ done; \
...@@ -106,7 +94,9 @@ __headersinst: $(subdirs) $(install-file) ...@@ -106,7 +94,9 @@ __headersinst: $(subdirs) $(install-file)
@: @:
targets += $(install-file) targets += $(install-file)
$(install-file): scripts/headers_install.sh $(input-files1) $(input-files2) $(input-files3) FORCE $(install-file): scripts/headers_install.sh \
$(addprefix $(srcdir)/,$(header-y)) \
$(addprefix $(gendir)/,$(genhdr-y)) FORCE
$(if $(unwanted),$(call cmd,remove),) $(if $(unwanted),$(call cmd,remove),)
$(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@))) $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@)))
$(call if_changed,install) $(call if_changed,install)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment