2
0

Makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=px5g
  9. PKG_RELEASE:=9
  10. PKG_LICENSE:=LGPL-2.1
  11. PKG_USE_MIPS16:=0
  12. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  13. include $(INCLUDE_DIR)/package.mk
  14. define Package/px5g-mbedtls
  15. SECTION:=utils
  16. CATEGORY:=Utilities
  17. SUBMENU:=Encryption
  18. TITLE:=X.509 certificate generator (using mbedtls)
  19. DEPENDS:=+libmbedtls
  20. PROVIDES:=px5g
  21. VARIANT:=mbedtls
  22. endef
  23. define Package/px5g-mbedtls/description
  24. Px5g is a tiny standalone X.509 certificate generator.
  25. It suitable to create key files and certificates in DER
  26. and PEM format for use with stunnel, uhttpd and others.
  27. endef
  28. define Package/px5g-standalone
  29. SECTION:=utils
  30. CATEGORY:=Utilities
  31. SUBMENU:=Encryption
  32. TITLE:=X.509 certificate generator (standalone)
  33. VARIANT:=standalone
  34. endef
  35. Package/px5g-standalone/description = $(Package/px5g-mbedtls/description)
  36. define Build/Prepare
  37. mkdir -p $(PKG_BUILD_DIR)
  38. endef
  39. TARGET_LDFLAGS += -lmbedtls -lmbedx509 -lmbedcrypto
  40. ifeq ($(BUILD_VARIANT),standalone)
  41. TARGET_LDFLAGS := -Wl,-Bstatic $(TARGET_LDFLAGS) -Wl,-Bdynamic
  42. endif
  43. TARGET_CFLAGS += -Wl,--gc-sections -Wall -Werror
  44. define Build/Compile
  45. $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/px5g px5g.c $(TARGET_LDFLAGS)
  46. endef
  47. define Package/px5g-mbedtls/install
  48. $(INSTALL_DIR) $(1)/usr/sbin
  49. $(INSTALL_BIN) $(PKG_BUILD_DIR)/px5g $(1)/usr/sbin/px5g
  50. endef
  51. Package/px5g-standalone/install = $(Package/px5g-mbedtls/install)
  52. $(eval $(call BuildPackage,px5g-mbedtls))
  53. $(eval $(call BuildPackage,px5g-standalone))