You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.3 KiB

  1. #
  2. # Copyright (C) 2018 Lim Guo Wei
  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. PKG_NAME:=coremark
  9. PKG_SOURCE_DATE:=2021-11-17
  10. PKG_SOURCE_VERSION:=45faaf84d2b76a413129909605fb4f09e55645e3
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz
  13. PKG_SOURCE_URL:=https://codeload.github.com/eembc/coremark/tar.gz/$(PKG_SOURCE_VERSION)?
  14. PKG_HASH:=3c74d1789ed8e7a9cf2c6ad6ad68b33ed5bc87abe405af04088ab418e240ffe1
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
  16. PKG_MAINTAINER:=Lim Guo Wei <limguowei@gmail.com> \
  17. Aleksander Jan Bajkowski <olek2@wp.pl>
  18. PKG_LICENSE:=Apache-2.0
  19. PKG_LICENSE_FILES:=LICENSE.md
  20. PKG_USE_MIPS16:=0
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/coremark
  23. SECTION:=utils
  24. CATEGORY:=Utilities
  25. TITLE:=CoreMark Embedded Microprocessor Benchmark
  26. URL:=https://github.com/eembc/coremark
  27. endef
  28. define Package/coremark/description
  29. Embedded Microprocessor Benchmark
  30. endef
  31. define Package/coremark/config
  32. config COREMARK_OPTIMIZE_O3
  33. bool "Use all optimizations (-O3)"
  34. depends on PACKAGE_coremark
  35. default y
  36. help
  37. This enables additional optmizations using the -O3 compilation flag.
  38. config COREMARK_ENABLE_MULTITHREADING
  39. bool "Enable multithreading support"
  40. depends on PACKAGE_coremark
  41. default n
  42. help
  43. This enables multithreading support
  44. config COREMARK_NUMBER_OF_THREADS
  45. int "Number of threads"
  46. depends on COREMARK_ENABLE_MULTITHREADING
  47. default 2
  48. help
  49. Number of threads to run in parallel
  50. endef
  51. TARGET_CFLAGS += -flto
  52. ifeq ($(CONFIG_COREMARK_OPTIMIZE_O3),y)
  53. TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3
  54. endif
  55. ifeq ($(CONFIG_COREMARK_ENABLE_MULTITHREADING),y)
  56. EXTRA_CFLAGS := -DMULTITHREAD=$(CONFIG_COREMARK_NUMBER_OF_THREADS) -DUSE_PTHREAD
  57. endif
  58. define Build/Compile
  59. $(SED) 's|EXE = .exe|EXE =|' $(PKG_BUILD_DIR)/posix/core_portme.mak
  60. mkdir $(PKG_BUILD_DIR)/$(ARCH)
  61. $(CP) -r $(PKG_BUILD_DIR)/linux/* $(PKG_BUILD_DIR)/$(ARCH)
  62. $(MAKE) -C $(PKG_BUILD_DIR) PORT_DIR=$(ARCH) $(MAKE_FLAGS) \
  63. PORT_CFLAGS="$(TARGET_CFLAGS)" XCFLAGS="$(EXTRA_CFLAGS)" compile
  64. endef
  65. define Package/coremark/install
  66. $(INSTALL_DIR) $(1)/bin
  67. $(INSTALL_BIN) $(PKG_BUILD_DIR)/coremark $(1)/bin/
  68. endef
  69. $(eval $(call BuildPackage,coremark))