blob: 6addbbab122ae644beff0fae4f9c935773c51381 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#
2# Copyright (C) 2010-2015 Jo-Philipp Wich <jo@mein.io>
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=px5g-mbedtls
11PKG_RELEASE:=11
12PKG_LICENSE:=LGPL-2.1
13
14PKG_BUILD_FLAGS:=no-mips16
15
16PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
17
18include $(INCLUDE_DIR)/package.mk
19
20define Package/px5g-mbedtls
21 SECTION:=utils
22 CATEGORY:=Utilities
23 SUBMENU:=Encryption
24 TITLE:=X.509 certificate generator (using mbedtls)
25 DEPENDS:=+libmbedtls
26 PROVIDES:=px5g
27 VARIANT:=mbedtls
28endef
29
30define Package/px5g-mbedtls/description
31 Px5g is a tiny standalone X.509 certificate generator.
32 It suitable to create key files and certificates in DER
33 and PEM format for use with stunnel, uhttpd and others.
34endef
35
36define Package/px5g-standalone
37 SECTION:=utils
38 CATEGORY:=Utilities
39 SUBMENU:=Encryption
40 TITLE:=X.509 certificate generator (standalone)
41 VARIANT:=standalone
42endef
43Package/px5g-standalone/description = $(Package/px5g-mbedtls/description)
44
45define Build/Prepare
46 mkdir -p $(PKG_BUILD_DIR)
47endef
48
49TARGET_LDFLAGS += -lmbedtls -lmbedx509 -lmbedcrypto
50
51ifeq ($(BUILD_VARIANT),standalone)
52 TARGET_LDFLAGS := -Wl,-Bstatic $(TARGET_LDFLAGS) -Wl,-Bdynamic
53endif
54
55TARGET_CFLAGS += -Wl,--gc-sections -Wall -Werror
56
57define Build/Compile
58 $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/px5g px5g-mbedtls.c $(TARGET_LDFLAGS)
59endef
60
61define Package/px5g-mbedtls/install
62 $(INSTALL_DIR) $(1)/usr/sbin
63 $(INSTALL_BIN) $(PKG_BUILD_DIR)/px5g $(1)/usr/sbin/px5g
64endef
65
66Package/px5g-standalone/install = $(Package/px5g-mbedtls/install)
67
68$(eval $(call BuildPackage,px5g-mbedtls))
69$(eval $(call BuildPackage,px5g-standalone))