Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #
  2. # Copyright (C) 2021 Tony Ambardar <itugrok@yahoo.com>
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=kselftests-bpf
  10. PKG_VERSION:=$(LINUX_VERSION)
  11. PKG_RELEASE:=1
  12. PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
  13. PKG_BUILD_FLAGS:=gc-sections lto
  14. PKG_BUILD_PARALLEL:=1
  15. PKG_FLAGS:=nonshared
  16. include $(INCLUDE_DIR)/package.mk
  17. include $(INCLUDE_DIR)/nls.mk
  18. define Package/kselftests-bpf
  19. SECTION:=devel
  20. CATEGORY:=Development
  21. DEPENDS:= +libelf +zlib +libpthread +librt @!IN_SDK \
  22. @KERNEL_DEBUG_FS @KERNEL_DEBUG_INFO_BTF @KERNEL_BPF_EVENTS
  23. TITLE:=Linux Kernel Selftests (BPF)
  24. URL:=http://www.kernel.org
  25. endef
  26. define Package/kselftests-bpf/description
  27. kselftests-bpf is the Linux kernel BPF test suite
  28. endef
  29. TEST_TARGET = test_verifier
  30. MAKE_PATH:=tools/testing/selftests/bpf
  31. MAKE_VARS = \
  32. ARCH="$(LINUX_KARCH)" \
  33. CROSS_COMPILE="$(TARGET_CROSS)" \
  34. SAN_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  35. LDLIBS="$(TARGET_LDFLAGS)" \
  36. TOOLCHAIN_INCLUDE="$(TOOLCHAIN_DIR)/include" \
  37. VMLINUX_BTF="$(LINUX_DIR)/vmlinux"
  38. MAKE_FLAGS = \
  39. $(if $(findstring c,$(LIBRECMC_VERBOSE)),V=1,V='') \
  40. O=$(PKG_BUILD_DIR)
  41. define Build/Compile
  42. +$(MAKE_VARS) \
  43. $(MAKE) $(PKG_JOBS) -C $(LINUX_DIR)/$(MAKE_PATH) \
  44. $(MAKE_FLAGS) $(TEST_TARGET) ;
  45. endef
  46. define Package/kselftests-bpf/install
  47. $(INSTALL_DIR) $(1)/usr/bin
  48. $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(TEST_TARGET) $(1)/usr/bin/
  49. endef
  50. $(eval $(call BuildPackage,kselftests-bpf))