Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #
  2. # Copyright (C) 2008 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # $Id$
  8. include $(TOPDIR)/rules.mk
  9. UCI_VERSION=0.3
  10. UCI_RELEASE=3
  11. PKG_NAME:=uci
  12. PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
  13. PKG_RELEASE:=1
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  15. PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
  16. PKG_MD5SUM:=e1d3204629938adb21c6bf84a08ce001
  17. include $(INCLUDE_DIR)/package.mk
  18. # set to 1 to enable debugging
  19. DEBUG=
  20. define Package/libuci
  21. SECTION:=libs
  22. CATEGORY:=Libraries
  23. TITLE:=C library for the Unified Configuration Interface (UCI)
  24. endef
  25. define Package/uci
  26. SECTION:=base
  27. CATEGORY:=Base system
  28. DEPENDS:=+libuci
  29. TITLE:=Utility for the Unified Configuration Interface (UCI)
  30. endef
  31. define Package/uci-sh
  32. SECTION:=base
  33. CATEGORY:=Base system
  34. DEPENDS:=@!PACKAGE_uci
  35. TITLE:=Old shell/awk implementation of UCI
  36. endef
  37. define Package/libuci-lua
  38. SECTION=libs
  39. CATEGORY=Libraries
  40. DEPENDS:=+libuci +lua
  41. TITLE:=Lua plugin for UCI
  42. endef
  43. define Build/Configure
  44. endef
  45. UCI_MAKEOPTS = \
  46. $(TARGET_CONFIGURE_OPTS) \
  47. COPTS="$(TARGET_CFLAGS)" \
  48. DEBUG="$(DEBUG)" \
  49. VERSION="$(UCI_VERSION)" \
  50. CPPFLAGS="-I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include" \
  51. OS="Linux"
  52. define Build/Compile
  53. $(MAKE) -C $(PKG_BUILD_DIR) $(UCI_MAKEOPTS)
  54. $(MAKE) -C $(PKG_BUILD_DIR)/lua $(UCI_MAKEOPTS)
  55. endef
  56. define Package/libuci/install
  57. $(INSTALL_DIR) $(1)/lib
  58. $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
  59. endef
  60. define Package/libuci-lua/install
  61. $(INSTALL_DIR) $(1)/usr/lib/lua/5.1
  62. $(CP) $(PKG_BUILD_DIR)/lua/uci.so $(1)/usr/lib/lua/5.1
  63. endef
  64. define Package/uci/install
  65. $(INSTALL_DIR) $(1)/sbin
  66. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uci $(1)/sbin/
  67. $(CP) ./files/uci/* $(1)/
  68. endef
  69. define Package/uci-sh/install
  70. $(INSTALL_DIR) $(1)
  71. $(CP) ./files/uci-sh/* $(1)/
  72. endef
  73. define Build/InstallDev
  74. $(INSTALL_DIR) $(1)/usr/include
  75. $(CP) $(PKG_BUILD_DIR)/uci{,_config}.h $(1)/usr/include
  76. $(INSTALL_DIR) $(1)/usr/lib
  77. $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/usr/lib
  78. endef
  79. $(eval $(call BuildPackage,uci))
  80. $(eval $(call BuildPackage,libuci))
  81. $(eval $(call BuildPackage,libuci-lua))
  82. $(eval $(call BuildPackage,uci-sh))