1adacfc6dSMasahiro Yamada# SPDX-License-Identifier: GPL-2.0-only 2adacfc6dSMasahiro Yamada# ========================================================================== 3adacfc6dSMasahiro Yamada# Install unstripped copies of vDSO 4adacfc6dSMasahiro Yamada# ========================================================================== 5adacfc6dSMasahiro Yamada 6adacfc6dSMasahiro YamadaPHONY := __default 7adacfc6dSMasahiro Yamada__default: 8adacfc6dSMasahiro Yamada @: 9adacfc6dSMasahiro Yamada 10adacfc6dSMasahiro Yamadainclude $(srctree)/scripts/Kbuild.include 11adacfc6dSMasahiro Yamada 12adacfc6dSMasahiro Yamadainstall-dir := $(MODLIB)/vdso 13adacfc6dSMasahiro Yamada 14adacfc6dSMasahiro Yamadadefine gen_install_rules 15adacfc6dSMasahiro Yamada 16adacfc6dSMasahiro Yamadasrc := $$(firstword $$(subst :,$(space),$(1))) 17adacfc6dSMasahiro Yamadadest := $(install-dir)/$$(or $$(word 2,$$(subst :,$(space),$(1))),$$(patsubst %.dbg,%,$$(notdir $(1)))) 18adacfc6dSMasahiro Yamada 19adacfc6dSMasahiro Yamada__default: $$(dest) 20adacfc6dSMasahiro Yamada$$(dest): $$(src) FORCE 21adacfc6dSMasahiro Yamada $$(call cmd,install) 22adacfc6dSMasahiro Yamada 23adacfc6dSMasahiro Yamada# Some architectures create .build-id symlinks 240e035cb8SJens Remusifneq ($(filter arm s390 sparc x86, $(SRCARCH)),) 2507423c9bSMasahiro Yamadalink := $(install-dir)/.build-id/$$(shell $(READELF) -n $$(src) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p').debug 26adacfc6dSMasahiro Yamada 27adacfc6dSMasahiro Yamada__default: $$(link) 28adacfc6dSMasahiro Yamada$$(link): $$(dest) FORCE 29adacfc6dSMasahiro Yamada $$(call cmd,symlink) 30adacfc6dSMasahiro Yamadaendif 31adacfc6dSMasahiro Yamada 32adacfc6dSMasahiro Yamadaendef 33adacfc6dSMasahiro Yamada 34adacfc6dSMasahiro Yamada$(foreach x, $(sort $(INSTALL_FILES)), $(eval $(call gen_install_rules,$(x)))) 35adacfc6dSMasahiro Yamada 36adacfc6dSMasahiro Yamadaquiet_cmd_install = INSTALL $@ 37adacfc6dSMasahiro Yamada cmd_install = mkdir -p $(dir $@); cp $< $@ 38adacfc6dSMasahiro Yamada 39adacfc6dSMasahiro Yamadaquiet_cmd_symlink = SYMLINK $@ 40adacfc6dSMasahiro Yamada cmd_symlink = mkdir -p $(dir $@); ln -sf --relative $< $@ 41adacfc6dSMasahiro Yamada 42adacfc6dSMasahiro YamadaPHONY += FORCE 43adacfc6dSMasahiro YamadaFORCE: 44adacfc6dSMasahiro Yamada 45adacfc6dSMasahiro Yamada.PHONY: $(PHONY) 46