kvm-unit-tests.mk 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ################################################################################
  2. #
  3. # kvm-unit-tests
  4. #
  5. ################################################################################
  6. KVM_UNIT_TESTS_VERSION = kvm-unit-tests-20171020
  7. KVM_UNIT_TESTS_SITE = https://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git
  8. KVM_UNIT_TESTS_SITE_METHOD = git
  9. KVM_UNIT_TESTS_LICENSE = LGPL-2.0
  10. KVM_UNIT_TESTS_LICENSE_FILES = COPYRIGHT
  11. ifeq ($(BR2_arm),y)
  12. KVM_UNIT_TESTS_ARCH = arm
  13. else ifeq ($(BR2_i386),y)
  14. KVM_UNIT_TESTS_ARCH = i386
  15. else ifeq ($(BR2_powerpc64)$(BR2_powerpc64le),y)
  16. KVM_UNIT_TESTS_ARCH = ppc64
  17. else ifeq ($(BR2_x86_64),y)
  18. KVM_UNIT_TESTS_ARCH = x86_64
  19. endif
  20. ifeq ($(BR2_ENDIAN),"LITTLE")
  21. KVM_UNIT_TESTS_ENDIAN = little
  22. else
  23. KVM_UNIT_TESTS_ENDIAN = big
  24. endif
  25. KVM_UNIT_TESTS_CONF_OPTS =\
  26. --arch="$(KVM_UNIT_TESTS_ARCH)" \
  27. --processor="$(GCC_TARGET_CPU)" \
  28. --endian="$(KVM_UNIT_TESTS_ENDIAN)"
  29. # For all architectures but x86-64, we use the target
  30. # compiler. However, for x86-64, we use the host compiler, as
  31. # kvm-unit-tests builds 32 bit code, which Buildroot toolchains for
  32. # x86-64 cannot do.
  33. ifeq ($(BR2_x86_64),)
  34. KVM_UNIT_TESTS_CONF_OPTS += --cross-prefix="$(TARGET_CROSS)"
  35. endif
  36. define KVM_UNIT_TESTS_CONFIGURE_CMDS
  37. cd $(@D) && ./configure $(KVM_UNIT_TESTS_CONF_OPTS)
  38. endef
  39. define KVM_UNIT_TESTS_BUILD_CMDS
  40. $(TARGET_MAKE_ENV) $(MAKE) $(KVM_UNIT_TESTS_MAKE_OPTS) -C $(@D) \
  41. standalone
  42. endef
  43. define KVM_UNIT_TESTS_INSTALL_TARGET_CMDS
  44. $(TARGET_MAKE_ENV) $(MAKE) $(KVM_UNIT_TESTS_MAKE_OPTS) -C $(@D) \
  45. DESTDIR=$(TARGET_DIR)/usr/share/kvm-unit-tests/ \
  46. install
  47. endef
  48. # Does use configure script but not an autotools one
  49. $(eval $(generic-package))