opensbi.mk 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ################################################################################
  2. #
  3. # opensbi
  4. #
  5. ################################################################################
  6. OPENSBI_VERSION = v0.3
  7. OPENSBI_SITE = $(call github,riscv,opensbi,$(OPENSBI_VERSION))
  8. OPENSBI_LICENSE = BSD-2-Clause
  9. OPENSBI_LICENSE_FILES = COPYING.BSD
  10. OPENSBI_INSTALL_TARGET = NO
  11. OPENSBI_INSTALL_STAGING = YES
  12. OPENSBI_MAKE_ENV = \
  13. CROSS_COMPILE=$(TARGET_CROSS)
  14. OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_OPENSBI_PLAT))
  15. ifneq ($(OPENSBI_PLAT),)
  16. OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT)
  17. endif
  18. define OPENSBI_BUILD_CMDS
  19. $(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
  20. endef
  21. ifneq ($(OPENSBI_PLAT),)
  22. OPENSBI_INSTALL_IMAGES = YES
  23. define OPENSBI_INSTALL_IMAGES_CMDS
  24. $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_jump.bin $(BINARIES_DIR)/fw_jump.bin
  25. $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_jump.elf $(BINARIES_DIR)/fw_jump.elf
  26. endef
  27. endif
  28. # libsbi.a is not a library meant to be linked in user-space code, but
  29. # with bare metal code, which is why we don't install it in
  30. # $(STAGING_DIR)/usr/lib
  31. define OPENSBI_INSTALL_STAGING_CMDS
  32. $(INSTALL) -m 0644 -D $(@D)/build/lib/libsbi.a $(STAGING_DIR)/usr/share/opensbi/libsbi.a
  33. endef
  34. $(eval $(generic-package))