2 # Copyright (C) 2010-2015 Jo-Philipp Wich <jo@mein.io>
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
16 PKG_MAINTAINER
:=Jo-Philipp Wich
<jo@mein.io
>
18 include $(INCLUDE_DIR
)/package.mk
20 define Package
/px5g-mbedtls
24 TITLE
:=X
.509 certificate generator
(using mbedtls
)
30 define 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.
36 define Package
/px5g-standalone
40 TITLE
:=X
.509 certificate generator
(standalone
)
43 Package
/px5g-standalone
/description
= $(Package
/px5g-mbedtls
/description
)
46 mkdir
-p
$(PKG_BUILD_DIR
)
49 TARGET_LDFLAGS
+= -lmbedtls
-lmbedx509
-lmbedcrypto
51 ifeq ($(BUILD_VARIANT
),standalone
)
52 TARGET_LDFLAGS
:= -Wl
,-Bstatic
$(TARGET_LDFLAGS
) -Wl
,-Bdynamic
55 TARGET_CFLAGS
+= -Wl
,--gc-sections
58 $(TARGET_CC
) $(TARGET_CPPFLAGS
) $(TARGET_CFLAGS
) -o
$(PKG_BUILD_DIR
)/px5g px5g.c
$(TARGET_LDFLAGS
)
61 define Package
/px5g-mbedtls
/install
62 $(INSTALL_DIR
) $(1)/usr
/sbin
63 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/px5g
$(1)/usr
/sbin
/px5g
66 Package
/px5g-standalone
/install = $(Package
/px5g-mbedtls
/install)
68 $(eval
$(call BuildPackage
,px5g-mbedtls
))
69 $(eval
$(call BuildPackage
,px5g-standalone
))