Skip to content

Commit 7c025b2

Browse files
NicolasDichtelmasahir0y
authored andcommitted
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: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 25dc1d6 commit 7c025b2

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed

scripts/Makefile.headersinst

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,20 @@ wrapper-files := $(filter $(header-y), $(generic-y))
4040
srcdir := $(srctree)/$(obj)
4141
gendir := $(objtree)/$(gen)
4242

43-
oldsrcdir := $(srctree)/$(subst /uapi,,$(obj))
44-
4543
# all headers files for this dir
4644
header-y := $(filter-out $(generic-y), $(header-y))
4745
all-files := $(header-y) $(genhdr-y) $(wrapper-files)
4846
output-files := $(addprefix $(installdir)/, $(all-files))
4947

50-
input-files1 := $(foreach hdr, $(header-y), \
51-
$(if $(wildcard $(srcdir)/$(hdr)), \
52-
$(wildcard $(srcdir)/$(hdr))) \
53-
)
54-
input-files1-name := $(notdir $(input-files1))
55-
input-files2 := $(foreach hdr, $(header-y), \
56-
$(if $(wildcard $(srcdir)/$(hdr)),, \
57-
$(if $(wildcard $(oldsrcdir)/$(hdr)), \
58-
$(wildcard $(oldsrcdir)/$(hdr)), \
59-
$(error Missing UAPI file $(srcdir)/$(hdr))) \
60-
))
61-
input-files2-name := $(notdir $(input-files2))
62-
input-files3 := $(foreach hdr, $(genhdr-y), \
63-
$(if $(wildcard $(gendir)/$(hdr)), \
64-
$(wildcard $(gendir)/$(hdr)), \
65-
$(error Missing generated UAPI file $(gendir)/$(hdr)) \
66-
))
67-
input-files3-name := $(notdir $(input-files3))
48+
# Check that all expected files exist
49+
$(foreach hdr, $(header-y), \
50+
$(if $(wildcard $(srcdir)/$(hdr)),, \
51+
$(error Missing UAPI file $(srcdir)/$(hdr)) \
52+
))
53+
$(foreach hdr, $(genhdr-y), \
54+
$(if $(wildcard $(gendir)/$(hdr)),, \
55+
$(error Missing generated UAPI file $(gendir)/$(hdr)) \
56+
))
6857

6958
# Work out what needs to be removed
7059
oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h))
@@ -78,9 +67,8 @@ printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@))
7867
quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\
7968
file$(if $(word 2, $(all-files)),s))
8069
cmd_install = \
81-
$(CONFIG_SHELL) $< $(installdir) $(srcdir) $(input-files1-name); \
82-
$(CONFIG_SHELL) $< $(installdir) $(oldsrcdir) $(input-files2-name); \
83-
$(CONFIG_SHELL) $< $(installdir) $(gendir) $(input-files3-name); \
70+
$(CONFIG_SHELL) $< $(installdir) $(srcdir) $(header-y); \
71+
$(CONFIG_SHELL) $< $(installdir) $(gendir) $(genhdr-y); \
8472
for F in $(wrapper-files); do \
8573
echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \
8674
done; \
@@ -106,7 +94,9 @@ __headersinst: $(subdirs) $(install-file)
10694
@:
10795

10896
targets += $(install-file)
109-
$(install-file): scripts/headers_install.sh $(input-files1) $(input-files2) $(input-files3) FORCE
97+
$(install-file): scripts/headers_install.sh \
98+
$(addprefix $(srcdir)/,$(header-y)) \
99+
$(addprefix $(gendir)/,$(genhdr-y)) FORCE
110100
$(if $(unwanted),$(call cmd,remove),)
111101
$(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@)))
112102
$(call if_changed,install)

0 commit comments

Comments
 (0)