Commit cb97914b authored by H. Peter Anvin's avatar H. Peter Anvin

kbuild: Add support for installing generated asm headers

Generated asm headers are supposed to live in
arch/*/include/generated/asm, but objhdr-y expect them to live in the
same directory they are generated in.  Instead of trying to cut that
particular Gordian knot, introduce genhdr-y that takes this into
account; the sole user of objhdr-y, linux/version.h, should be
migrated over at some later date.
Suggested-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
Acked-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent cfcfc9ec
...@@ -4,12 +4,16 @@ ...@@ -4,12 +4,16 @@
# header-y - list files to be installed. They are preprocessed # header-y - list files to be installed. They are preprocessed
# to remove __KERNEL__ section of the file # to remove __KERNEL__ section of the file
# objhdr-y - Same as header-y but for generated files # objhdr-y - Same as header-y but for generated files
# genhdr-y - Same as objhdr-y but in a generated/ directory
# #
# ========================================================================== # ==========================================================================
# called may set destination dir (when installing to asm/) # called may set destination dir (when installing to asm/)
_dst := $(if $(dst),$(dst),$(obj)) _dst := $(if $(dst),$(dst),$(obj))
# generated header directory
gen := $(if $(gen),$(gen),$(subst include/,include/generated/,$(obj)))
kbuild-file := $(srctree)/$(obj)/Kbuild kbuild-file := $(srctree)/$(obj)/Kbuild
include $(kbuild-file) include $(kbuild-file)
...@@ -33,9 +37,10 @@ wrapper-files := $(filter $(header-y), $(generic-y)) ...@@ -33,9 +37,10 @@ wrapper-files := $(filter $(header-y), $(generic-y))
# 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) $(objhdr-y) $(wrapper-files) all-files := $(header-y) $(objhdr-y) $(genhdr-y) $(wrapper-files)
input-files := $(addprefix $(srctree)/$(obj)/,$(header-y)) \ input-files := $(addprefix $(srctree)/$(obj)/,$(header-y)) \
$(addprefix $(objtree)/$(obj)/,$(objhdr-y)) $(addprefix $(objtree)/$(obj)/,$(objhdr-y)) \
$(addprefix $(objtree)/$(gen)/,$(genhdr-y))
output-files := $(addprefix $(install)/, $(all-files)) output-files := $(addprefix $(install)/, $(all-files))
# Work out what needs to be removed # Work out what needs to be removed
...@@ -52,6 +57,7 @@ quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ ...@@ -52,6 +57,7 @@ quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\
cmd_install = \ cmd_install = \
$(PERL) $< $(srctree)/$(obj) $(install) $(SRCARCH) $(header-y); \ $(PERL) $< $(srctree)/$(obj) $(install) $(SRCARCH) $(header-y); \
$(PERL) $< $(objtree)/$(obj) $(install) $(SRCARCH) $(objhdr-y); \ $(PERL) $< $(objtree)/$(obj) $(install) $(SRCARCH) $(objhdr-y); \
$(PERL) $< $(objtree)/$(gen) $(install) $(SRCARCH) $(genhdr-y); \
for F in $(wrapper-files); do \ for F in $(wrapper-files); do \
echo "\#include <asm-generic/$$F>" > $(install)/$$F; \ echo "\#include <asm-generic/$$F>" > $(install)/$$F; \
done; \ done; \
......
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