qoriq-rcw.mk 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ################################################################################
  2. #
  3. # qoriq-rcw
  4. #
  5. ################################################################################
  6. QORIQ_RCW_VERSION = LSDK-19.09
  7. QORIQ_RCW_SITE = https://source.codeaurora.org/external/qoriq/qoriq-components/rcw
  8. QORIQ_RCW_SITE_METHOD = git
  9. QORIQ_RCW_LICENSE = BSD-3-Clause
  10. QORIQ_RCW_LICENSE_FILES = LICENSE
  11. HOST_QORIQ_RCW_DEPENDENCIES = $(BR2_PYTHON3_HOST_DEPENDENCY)
  12. QORIQ_RCW_FILES = $(call qstrip,$(BR2_PACKAGE_HOST_QORIQ_RCW_CUSTOM_PATH))
  13. ifneq ($(QORIQ_RCW_FILES),)
  14. QORIQ_RCW_INCLUDES = $(filter-out %.rcw,$(QORIQ_RCW_FILES))
  15. # Get the name of the custom rcw file from the custom list
  16. QORIQ_RCW_PROJECT = $(notdir $(filter %.rcw,$(QORIQ_RCW_FILES)))
  17. # Error if there are no or more than one .rcw file
  18. ifeq ($(BR_BUILDING),y)
  19. ifneq ($(words $(QORIQ_RCW_PROJECT)),1)
  20. $(error BR2_PACKAGE_HOST_QORIQ_RCW_CUSTOM_PATH must have exactly one .rcw file)
  21. endif
  22. endif
  23. ifneq ($(QORIQ_RCW_INCLUDES),)
  24. define HOST_QORIQ_RCW_ADD_CUSTOM_RCW_INCLUDES
  25. mkdir -p $(@D)/custom_board
  26. cp -f $(QORIQ_RCW_INCLUDES) $(@D)/custom_board
  27. endef
  28. HOST_QORIQ_RCW_POST_PATCH_HOOKS += HOST_QORIQ_RCW_ADD_CUSTOM_RCW_INCLUDES
  29. endif
  30. define HOST_QORIQ_RCW_ADD_CUSTOM_RCW_FILES
  31. mkdir -p $(@D)/custom_board/rcw
  32. cp -f $(filter %.rcw,$(QORIQ_RCW_FILES)) $(@D)/custom_board/rcw
  33. endef
  34. HOST_QORIQ_RCW_POST_PATCH_HOOKS += HOST_QORIQ_RCW_ADD_CUSTOM_RCW_FILES
  35. # rcw.py is a python3-only script, and we can be using either the
  36. # system-provided python3, or our own built with host-python3.
  37. # Fortunately, rcw.py uses #!/usr/bin/env python3, so it will
  38. # easily find it from PATH.
  39. define HOST_QORIQ_RCW_BUILD_CMDS
  40. PATH=$(BR_PATH) \
  41. $(@D)/rcw.py \
  42. -i $(@D)/custom_board/rcw/$(QORIQ_RCW_PROJECT) \
  43. -I $(@D)/custom_board -o $(@D)/PBL.bin
  44. endef
  45. define HOST_QORIQ_RCW_INSTALL_DELIVERY_FILE
  46. $(INSTALL) -D -m 0644 $(@D)/PBL.bin $(BINARIES_DIR)/PBL.bin
  47. endef
  48. endif
  49. # Copy source files and script into $(HOST_DIR)/share/rcw/ so a developer
  50. # could use a post image or SDK to build/install PBL files.
  51. define HOST_QORIQ_RCW_INSTALL_CMDS
  52. mkdir -p $(HOST_DIR)/share/rcw
  53. cp -a $(@D)/* $(HOST_DIR)/share/rcw
  54. $(HOST_QORIQ_RCW_INSTALL_DELIVERY_FILE)
  55. endef
  56. $(eval $(host-generic-package))