898880d453a7024cac6f6a02544c0f021f6f1ca6
[openwrt/openwrt.git] / package / libs / mbedtls / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=mbedtls
11 PKG_VERSION:=2.8.0
12 PKG_RELEASE:=1
13 PKG_USE_MIPS16:=0
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-gpl.tgz
16 PKG_SOURCE_URL:=https://tls.mbed.org/download/
17 PKG_HASH:=649eb27187154590edda52943a7f468e740ec08807e5bf68ff45f4e8ffd68923
18
19 PKG_BUILD_PARALLEL:=1
20 PKG_LICENSE:=GPL-2.0+
21 PKG_CPE_ID:=cpe:/a:arm:mbed_tls
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/cmake.mk
25
26 define Package/mbedtls/Default
27 SUBMENU:=SSL
28 TITLE:=Embedded SSL
29 URL:=https://tls.mbed.org
30 endef
31
32 define Package/mbedtls/Default/description
33 The aim of the mbedtls project is to provide a quality, open-source
34 cryptographic library written in C and targeted at embedded systems.
35 endef
36
37 define Package/libmbedtls
38 $(call Package/mbedtls/Default)
39 SECTION:=libs
40 CATEGORY:=Libraries
41 TITLE+= (library)
42 ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
43 endef
44
45 define Package/libmbedtls/description
46 $(call Package/mbedtls/Default/description)
47 This package contains the mbedtls library.
48 endef
49
50 PKG_INSTALL:=1
51
52 TARGET_CFLAGS += -ffunction-sections -fdata-sections
53
54 CMAKE_OPTIONS += \
55 -DCMAKE_BUILD_TYPE:String="Release" \
56 -DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \
57 -DENABLE_TESTING:Bool=OFF \
58 -DENABLE_PROGRAMS:Bool=OFF \
59
60 define Build/InstallDev
61 $(INSTALL_DIR) $(1)/usr/include
62 $(CP) $(PKG_INSTALL_DIR)/usr/include/mbedtls $(1)/usr/include/
63 $(INSTALL_DIR) $(1)/usr/lib
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
65 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.a $(1)/usr/lib/
66 endef
67
68 define Package/libmbedtls/install
69 $(INSTALL_DIR) $(1)/usr/lib
70 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
71 endef
72
73 $(eval $(call BuildPackage,libmbedtls))