4f29135bb408537e3b24b4337c5784510551b3a6
[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.16.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:=c8d7a4696287cb9533c455bdd65859106dbdd4472c125194387486e6d4df2799
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 TITLE:=Embedded SSL
28 URL:=https://tls.mbed.org
29 endef
30
31 define Package/mbedtls/Default/description
32 The aim of the mbedtls project is to provide a quality, open-source
33 cryptographic library written in C and targeted at embedded systems.
34 endef
35
36 define Package/libmbedtls
37 $(call Package/mbedtls/Default)
38 SECTION:=libs
39 CATEGORY:=Libraries
40 SUBMENU:=SSL
41 TITLE+= (library)
42 ABI_VERSION:=12
43 endef
44
45 define Package/mbedtls-util
46 $(call Package/mbedtls/Default)
47 SECTION:=utils
48 CATEGORY:=Utilities
49 TITLE+= (utilities)
50 DEPENDS:=+libmbedtls
51 endef
52
53 define Package/libmbedtls/description
54 $(call Package/mbedtls/Default/description)
55 This package contains the mbedtls library.
56 endef
57
58 define Package/mbedtls-util/description
59 $(call Package/mbedtls/Default/description)
60 This package contains mbedtls helper programs for private key and
61 CSR generation (gen_key, cert_req)
62 endef
63
64 PKG_INSTALL:=1
65
66 TARGET_CFLAGS += -ffunction-sections -fdata-sections
67 TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
68
69 CMAKE_OPTIONS += \
70 -DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \
71 -DENABLE_TESTING:Bool=OFF \
72 -DENABLE_PROGRAMS:Bool=ON
73
74 define Build/InstallDev
75 $(INSTALL_DIR) $(1)/usr/include
76 $(CP) $(PKG_INSTALL_DIR)/usr/include/mbedtls $(1)/usr/include/
77 $(INSTALL_DIR) $(1)/usr/lib
78 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
79 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.a $(1)/usr/lib/
80 endef
81
82 define Package/libmbedtls/install
83 $(INSTALL_DIR) $(1)/usr/lib
84 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
85 endef
86
87 define Package/mbedtls-util/install
88 $(INSTALL_DIR) $(1)/usr/bin
89 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gen_key $(1)/usr/bin/
90 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cert_req $(1)/usr/bin/
91 endef
92
93 $(eval $(call BuildPackage,libmbedtls))
94 $(eval $(call BuildPackage,mbedtls-util))