Makefile.vdsoinst 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. # ==========================================================================
  3. # Install unstripped copies of vDSO
  4. # ==========================================================================
  5. PHONY := __default
  6. __default:
  7. @:
  8. include $(srctree)/scripts/Kbuild.include
  9. install-dir := $(MODLIB)/vdso
  10. define gen_install_rules
  11. dest := $(install-dir)/$$(patsubst %.dbg,%,$$(notdir $(1)))
  12. __default: $$(dest)
  13. $$(dest): $(1) FORCE
  14. $$(call cmd,install)
  15. # Some architectures create .build-id symlinks
  16. ifneq ($(filter arm s390 sparc x86, $(SRCARCH)),)
  17. link := $(install-dir)/.build-id/$$(shell $(READELF) -n $(1) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p').debug
  18. __default: $$(link)
  19. $$(link): $$(dest) FORCE
  20. $$(call cmd,symlink)
  21. endif
  22. endef
  23. $(foreach x, $(sort $(INSTALL_FILES)), $(eval $(call gen_install_rules,$(x))))
  24. quiet_cmd_install = INSTALL $@
  25. cmd_install = mkdir -p $(dir $@); cp $< $@
  26. quiet_cmd_symlink = SYMLINK $@
  27. cmd_symlink = mkdir -p $(dir $@); ln -sf --relative $< $@
  28. PHONY += FORCE
  29. FORCE:
  30. .PHONY: $(PHONY)