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.

69 lines
1.8 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:=2020-05-28
  10. PKG_SOURCE_VERSION:=7685fd32bd7919581bfff2881a6dac6320581400
  11. PKG_RELEASE:=2
  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:=ff7ee8b4d333893c1ea68616227b369581926d706c7df720b649e0a0631903a9
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
  16. PKG_MAINTAINER:=Lim Guo Wei <limguowei@gmail.com>
  17. PKG_LICENSE:=Apache-2.0
  18. PKG_LICENSE_FILES:=LICENSE.md
  19. PKG_USE_MIPS16:=0
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/coremark
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. TITLE:=CoreMark Embedded Microprocessor Benchmark
  25. URL:=https://github.com/eembc/coremark
  26. endef
  27. define Package/coremark/description
  28. Embedded Microprocessor Benchmark
  29. endef
  30. DIR_ARCH:=linux$(if $(CONFIG_ARCH_64BIT),64)
  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. endef
  39. TARGET_CFLAGS += -flto
  40. ifeq ($(CONFIG_COREMARK_OPTIMIZE_O3),y)
  41. TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3
  42. endif
  43. define Build/Compile
  44. $(SED) 's|EXE = .exe|EXE =|' $(PKG_BUILD_DIR)/$(DIR_ARCH)/core_portme.mak
  45. mkdir $(PKG_BUILD_DIR)/$(ARCH)
  46. $(CP) -r $(PKG_BUILD_DIR)/$(DIR_ARCH)/* $(PKG_BUILD_DIR)/$(ARCH)
  47. $(MAKE) -C $(PKG_BUILD_DIR) PORT_DIR=$(ARCH) $(MAKE_FLAGS) \
  48. PORT_CFLAGS="$(TARGET_CFLAGS)" compile
  49. endef
  50. define Package/coremark/install
  51. $(INSTALL_DIR) $(1)/bin
  52. $(INSTALL_BIN) $(PKG_BUILD_DIR)/coremark $(1)/bin/
  53. endef
  54. $(eval $(call BuildPackage,coremark))