kvm-unit-tests.mk 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ################################################################################
  2. #
  3. # kvm-unit-tests
  4. #
  5. ################################################################################
  6. KVM_UNIT_TESTS_VERSION = 2024-01-08
  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_s390x),y)
  20. KVM_UNIT_TESTS_ARCH = s390x
  21. else ifeq ($(BR2_x86_64),y)
  22. KVM_UNIT_TESTS_ARCH = x86_64
  23. endif
  24. ifeq ($(BR2_ENDIAN),"LITTLE")
  25. KVM_UNIT_TESTS_ENDIAN = little
  26. else
  27. KVM_UNIT_TESTS_ENDIAN = big
  28. endif
  29. KVM_UNIT_TESTS_CONF_OPTS =\
  30. --disable-werror \
  31. --arch="$(KVM_UNIT_TESTS_ARCH)" \
  32. --processor="$(GCC_TARGET_CPU)" \
  33. --endian="$(KVM_UNIT_TESTS_ENDIAN)"
  34. # For all architectures but x86-64, we use the target
  35. # compiler. However, for x86-64, we use the host compiler, as
  36. # kvm-unit-tests builds 32 bit code, which Buildroot toolchains for
  37. # x86-64 cannot do.
  38. ifeq ($(BR2_x86_64),)
  39. KVM_UNIT_TESTS_CONF_OPTS += --cross-prefix="$(TARGET_CROSS)"
  40. endif
  41. define KVM_UNIT_TESTS_CONFIGURE_CMDS
  42. cd $(@D) && ./configure $(KVM_UNIT_TESTS_CONF_OPTS)
  43. endef
  44. define KVM_UNIT_TESTS_BUILD_CMDS
  45. $(TARGET_MAKE_ENV) $(MAKE) $(KVM_UNIT_TESTS_MAKE_OPTS) -C $(@D) \
  46. standalone
  47. endef
  48. define KVM_UNIT_TESTS_INSTALL_TARGET_CMDS
  49. $(TARGET_MAKE_ENV) $(MAKE) $(KVM_UNIT_TESTS_MAKE_OPTS) -C $(@D) \
  50. DESTDIR=$(TARGET_DIR)/usr/share/kvm-unit-tests/ \
  51. install
  52. endef
  53. # Does use configure script but not an autotools one
  54. $(eval $(generic-package))