kvm-unit-tests.mk 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ################################################################################
  2. #
  3. # kvm-unit-tests
  4. #
  5. ################################################################################
  6. KVM_UNIT_TESTS_VERSION = 2025-06-05
  7. KVM_UNIT_TESTS_SOURCE = kvm-unit-tests-v$(KVM_UNIT_TESTS_VERSION).tar.bz2
  8. KVM_UNIT_TESTS_SITE = https://gitlab.com/kvm-unit-tests/kvm-unit-tests/-/archive/v$(KVM_UNIT_TESTS_VERSION)
  9. KVM_UNIT_TESTS_LICENSE = GPL-2.0, LGPL-2.0
  10. KVM_UNIT_TESTS_LICENSE_FILES = COPYRIGHT LICENSE
  11. ifeq ($(BR2_aarch64)$(BR2_aarch64_be),y)
  12. KVM_UNIT_TESTS_ARCH = aarch64
  13. else ifeq ($(BR2_arm),y)
  14. KVM_UNIT_TESTS_ARCH = arm
  15. else ifeq ($(BR2_i386),y)
  16. KVM_UNIT_TESTS_ARCH = i386
  17. else ifeq ($(BR2_powerpc64)$(BR2_powerpc64le),y)
  18. KVM_UNIT_TESTS_ARCH = ppc64
  19. else ifeq ($(BR2_RISCV_32),y)
  20. KVM_UNIT_TESTS_ARCH = riscv32
  21. else ifeq ($(BR2_RISCV_64),y)
  22. KVM_UNIT_TESTS_ARCH = riscv64
  23. else ifeq ($(BR2_s390x),y)
  24. KVM_UNIT_TESTS_ARCH = s390x
  25. else ifeq ($(BR2_x86_64),y)
  26. KVM_UNIT_TESTS_ARCH = x86_64
  27. endif
  28. ifeq ($(BR2_ENDIAN),"LITTLE")
  29. KVM_UNIT_TESTS_ENDIAN = little
  30. else
  31. KVM_UNIT_TESTS_ENDIAN = big
  32. endif
  33. KVM_UNIT_TESTS_CONF_OPTS =\
  34. --disable-werror \
  35. --arch="$(KVM_UNIT_TESTS_ARCH)" \
  36. --processor="$(GCC_TARGET_CPU)" \
  37. --endian="$(KVM_UNIT_TESTS_ENDIAN)"
  38. # For all architectures but x86-64, we use the target
  39. # compiler. However, for x86-64, we use the host compiler, as
  40. # kvm-unit-tests builds 32 bit code, which Buildroot toolchains for
  41. # x86-64 cannot do.
  42. ifeq ($(BR2_x86_64),)
  43. KVM_UNIT_TESTS_CONF_OPTS += --cross-prefix="$(TARGET_CROSS)"
  44. endif
  45. define KVM_UNIT_TESTS_CONFIGURE_CMDS
  46. cd $(@D) && ./configure $(KVM_UNIT_TESTS_CONF_OPTS)
  47. endef
  48. define KVM_UNIT_TESTS_BUILD_CMDS
  49. $(TARGET_MAKE_ENV) $(MAKE) $(KVM_UNIT_TESTS_MAKE_OPTS) -C $(@D) \
  50. standalone
  51. endef
  52. define KVM_UNIT_TESTS_INSTALL_TARGET_CMDS
  53. $(TARGET_MAKE_ENV) $(MAKE) $(KVM_UNIT_TESTS_MAKE_OPTS) -C $(@D) \
  54. DESTDIR=$(TARGET_DIR)/usr/share/kvm-unit-tests/ \
  55. install
  56. endef
  57. # Does use configure script but not an autotools one
  58. $(eval $(generic-package))