Makefile 1.7 KB

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