Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #
  2. # Copyright (C) 2011-2015 OpenWrt.org
  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:=mbedtls
  9. PKG_VERSION:=2.14.1
  10. PKG_RELEASE:=1
  11. PKG_USE_MIPS16:=0
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-gpl.tgz
  13. PKG_SOURCE_URL:=https://tls.mbed.org/download/
  14. PKG_HASH:=baa1121952786f5b2c66c52226a8ca0e05126de920d1756266551df677915b7e
  15. PKG_BUILD_PARALLEL:=1
  16. PKG_LICENSE:=GPL-2.0+
  17. PKG_CPE_ID:=cpe:/a:arm:mbed_tls
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/cmake.mk
  20. define Package/mbedtls/Default
  21. TITLE:=Embedded SSL
  22. URL:=https://tls.mbed.org
  23. endef
  24. define Package/mbedtls/Default/description
  25. The aim of the mbedtls project is to provide a quality, open-source
  26. cryptographic library written in C and targeted at embedded systems.
  27. endef
  28. define Package/libmbedtls
  29. $(call Package/mbedtls/Default)
  30. SECTION:=libs
  31. CATEGORY:=Libraries
  32. SUBMENU:=SSL
  33. TITLE+= (library)
  34. ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
  35. endef
  36. define Package/mbedtls-util
  37. $(call Package/mbedtls/Default)
  38. SECTION:=utils
  39. CATEGORY:=Utilities
  40. TITLE+= (utilities)
  41. DEPENDS:=+libmbedtls
  42. endef
  43. define Package/libmbedtls/description
  44. $(call Package/mbedtls/Default/description)
  45. This package contains the mbedtls library.
  46. endef
  47. define Package/mbedtls-util/description
  48. $(call Package/mbedtls/Default/description)
  49. This package contains mbedtls helper programs for private key and
  50. CSR generation (gen_key, cert_req)
  51. endef
  52. PKG_INSTALL:=1
  53. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  54. TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
  55. CMAKE_OPTIONS += \
  56. -DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \
  57. -DENABLE_TESTING:Bool=OFF \
  58. -DENABLE_PROGRAMS:Bool=ON
  59. define Build/InstallDev
  60. $(INSTALL_DIR) $(1)/usr/include
  61. $(CP) $(PKG_INSTALL_DIR)/usr/include/mbedtls $(1)/usr/include/
  62. $(INSTALL_DIR) $(1)/usr/lib
  63. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
  64. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.a $(1)/usr/lib/
  65. endef
  66. define Package/libmbedtls/install
  67. $(INSTALL_DIR) $(1)/usr/lib
  68. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
  69. endef
  70. define Package/mbedtls-util/install
  71. $(INSTALL_DIR) $(1)/usr/bin
  72. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gen_key $(1)/usr/bin/
  73. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cert_req $(1)/usr/bin/
  74. endef
  75. $(eval $(call BuildPackage,libmbedtls))
  76. $(eval $(call BuildPackage,mbedtls-util))