diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2017-03-27 08:20:09 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-05-10 11:18:37 -0400 |
commit | 7c025b2afc96b4a3fddff1dc9fbe3685953e38b4 (patch) | |
tree | e998d33e9b56c20305af48fa7f15558f8ecc62ed | |
parent | 25dc1d6cc3082aab293e5dad47623b550f7ddd2a (diff) |
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>
-rw-r--r-- | scripts/Makefile.headersinst | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst index 1106d6ca3a38..7bd9df6efe2f 100644 --- a/scripts/Makefile.headersinst +++ b/scripts/Makefile.headersinst | |||
@@ -40,31 +40,20 @@ wrapper-files := $(filter $(header-y), $(generic-y)) | |||
40 | srcdir := $(srctree)/$(obj) | 40 | srcdir := $(srctree)/$(obj) |
41 | gendir := $(objtree)/$(gen) | 41 | gendir := $(objtree)/$(gen) |
42 | 42 | ||
43 | oldsrcdir := $(srctree)/$(subst /uapi,,$(obj)) | ||
44 | |||
45 | # all headers files for this dir | 43 | # all headers files for this dir |
46 | header-y := $(filter-out $(generic-y), $(header-y)) | 44 | header-y := $(filter-out $(generic-y), $(header-y)) |
47 | all-files := $(header-y) $(genhdr-y) $(wrapper-files) | 45 | all-files := $(header-y) $(genhdr-y) $(wrapper-files) |
48 | output-files := $(addprefix $(installdir)/, $(all-files)) | 46 | output-files := $(addprefix $(installdir)/, $(all-files)) |
49 | 47 | ||
50 | input-files1 := $(foreach hdr, $(header-y), \ | 48 | # Check that all expected files exist |
51 | $(if $(wildcard $(srcdir)/$(hdr)), \ | 49 | $(foreach hdr, $(header-y), \ |
52 | $(wildcard $(srcdir)/$(hdr))) \ | 50 | $(if $(wildcard $(srcdir)/$(hdr)),, \ |
53 | ) | 51 | $(error Missing UAPI file $(srcdir)/$(hdr)) \ |
54 | input-files1-name := $(notdir $(input-files1)) | 52 | )) |
55 | input-files2 := $(foreach hdr, $(header-y), \ | 53 | $(foreach hdr, $(genhdr-y), \ |
56 | $(if $(wildcard $(srcdir)/$(hdr)),, \ | 54 | $(if $(wildcard $(gendir)/$(hdr)),, \ |
57 | $(if $(wildcard $(oldsrcdir)/$(hdr)), \ | 55 | $(error Missing generated UAPI file $(gendir)/$(hdr)) \ |
58 | $(wildcard $(oldsrcdir)/$(hdr)), \ | 56 | )) |
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)) | ||
68 | 57 | ||
69 | # Work out what needs to be removed | 58 | # Work out what needs to be removed |
70 | oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h)) | 59 | oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h)) |
@@ -78,9 +67,8 @@ printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@)) | |||
78 | quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ | 67 | quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ |
79 | file$(if $(word 2, $(all-files)),s)) | 68 | file$(if $(word 2, $(all-files)),s)) |
80 | cmd_install = \ | 69 | cmd_install = \ |
81 | $(CONFIG_SHELL) $< $(installdir) $(srcdir) $(input-files1-name); \ | 70 | $(CONFIG_SHELL) $< $(installdir) $(srcdir) $(header-y); \ |
82 | $(CONFIG_SHELL) $< $(installdir) $(oldsrcdir) $(input-files2-name); \ | 71 | $(CONFIG_SHELL) $< $(installdir) $(gendir) $(genhdr-y); \ |
83 | $(CONFIG_SHELL) $< $(installdir) $(gendir) $(input-files3-name); \ | ||
84 | for F in $(wrapper-files); do \ | 72 | for F in $(wrapper-files); do \ |
85 | echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \ | 73 | echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \ |
86 | done; \ | 74 | done; \ |
@@ -106,7 +94,9 @@ __headersinst: $(subdirs) $(install-file) | |||
106 | @: | 94 | @: |
107 | 95 | ||
108 | targets += $(install-file) | 96 | 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 | ||
110 | $(if $(unwanted),$(call cmd,remove),) | 100 | $(if $(unwanted),$(call cmd,remove),) |
111 | $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@))) | 101 | $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@))) |
112 | $(call if_changed,install) | 102 | $(call if_changed,install) |