Makefile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #
  2. # Copyright (C) 2010-2015 Jo-Philipp Wich <[email protected]>
  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:=4
  10. PKG_LICENSE:=LGPL-2.1
  11. PKG_BUILD_DIR:=$(BUILD_DIR)/px5g-$(BUILD_VARIANT)
  12. PKG_USE_MIPS16:=0
  13. include $(INCLUDE_DIR)/package.mk
  14. define Package/px5g/Template
  15. SECTION:=utils
  16. CATEGORY:=Utilities
  17. TITLE:=X.509 certificate generator (using $(1))
  18. MAINTAINER:=Jo-Philipp Wich <[email protected]>
  19. DEPENDS:=+lib$(1)
  20. PROVIDES:=px5g
  21. VARIANT:=$(1)
  22. endef
  23. define Package/px5g-polarssl/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. Package/px5g-mbedtls=$(call Package/px5g/Template,mbedtls)
  29. Package/px5g-polarssl=$(call Package/px5g/Template,polarssl)
  30. Package/px5g-mbedtls/description=$(Package/px5g-polarssl/description)
  31. define Build/Prepare
  32. mkdir -p $(PKG_BUILD_DIR)
  33. endef
  34. ifeq ($(BUILD_VARIANT),mbedtls)
  35. TARGET_CFLAGS += -DMBEDTLS
  36. TARGET_LDFLAGS := -lmbedtls -lmbedx509 -lmbedcrypto
  37. else
  38. TARGET_LDFLAGS := -lpolarssl
  39. endif
  40. define Build/Compile
  41. $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/px5g px5g.c $(TARGET_LDFLAGS)
  42. endef
  43. define Package/px5g-polarssl/install
  44. $(INSTALL_DIR) $(1)/usr/sbin
  45. $(INSTALL_BIN) $(PKG_BUILD_DIR)/px5g $(1)/usr/sbin/px5g
  46. endef
  47. Package/px5g-mbedtls/install=$(Package/px5g-polarssl/install)
  48. $(eval $(call BuildPackage,px5g-polarssl))
  49. $(eval $(call BuildPackage,px5g-mbedtls))