linux-tools.mk 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ################################################################################
  2. #
  3. # linux-tools
  4. #
  5. ################################################################################
  6. # Vampirising sources from the kernel tree, so no source nor site specified.
  7. # Instead, we directly build in the sources of the linux package. We can do
  8. # that, because we're not building in the same location and the same files.
  9. #
  10. # So, all tools refer to $(LINUX_DIR) instead of $(@D).
  11. # Note: we need individual tools makefiles to be included *before* we build
  12. # the list of build and install hooks below to guarantee that each tool has
  13. # a chance to register itself once, and only once. Therefore, the makefiles
  14. # are named linux-tool-*.mk.in, so they won't be picked up by the top-level
  15. # Makefile, but can be included here, guaranteeing the single inclusion and
  16. # the proper ordering.
  17. include $(sort $(wildcard package/linux-tools/*.mk.in))
  18. # We only need the kernel to be extracted, not actually built
  19. LINUX_TOOLS_PATCH_DEPENDENCIES = linux
  20. # Install Linux kernel tools in the staging directory since some tools
  21. # may install shared libraries and headers (e.g. cpupower).
  22. LINUX_TOOLS_INSTALL_STAGING = YES
  23. LINUX_TOOLS_DEPENDENCIES += $(foreach tool,$(LINUX_TOOLS),\
  24. $(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
  25. $($(call UPPERCASE,$(tool))_DEPENDENCIES)))
  26. LINUX_TOOLS_POST_BUILD_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
  27. $(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
  28. $(call UPPERCASE,$(tool))_BUILD_CMDS))
  29. LINUX_TOOLS_POST_INSTALL_STAGING_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
  30. $(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
  31. $(call UPPERCASE,$(tool))_INSTALL_STAGING_CMDS))
  32. LINUX_TOOLS_POST_INSTALL_TARGET_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
  33. $(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
  34. $(call UPPERCASE,$(tool))_INSTALL_TARGET_CMDS))
  35. $(eval $(generic-package))