1 # SPDX-License-Identifier: GPL-2.0-only
2 # ==========================================================================
3 # Install unstripped copies of vDSO
4 # ==========================================================================
10 include $(srctree)/scripts/Kbuild.include
12 install-dir := $(MODLIB)/vdso
14 define gen_install_rules
16 src := $$(firstword $$(subst :,$(space),$(1)))
17 dest := $(install-dir)/$$(or $$(word 2,$$(subst :,$(space),$(1))),$$(patsubst %.dbg,%,$$(notdir $(1))))
20 $$(dest): $$(src) FORCE
23 # Some architectures create .build-id symlinks
24 ifneq ($(filter arm sparc x86, $(SRCARCH)),)
25 link := $(install-dir)/.build-id/$$(shell $(READELF) -n $$(src) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p').debug
28 $$(link): $$(dest) FORCE
34 $(foreach x, $(sort $(INSTALL_FILES)), $(eval $(call gen_install_rules,$(x))))
36 quiet_cmd_install = INSTALL $@
37 cmd_install = mkdir -p $(dir $@); cp $< $@
39 quiet_cmd_symlink = SYMLINK $@
40 cmd_symlink = mkdir -p $(dir $@); ln -sf --relative $< $@