Makefile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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.7
  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:=b8c033e7b08bb39e87ef00bdb779f0ba
  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/libuci-lua
  32. SECTION=libs
  33. CATEGORY=Libraries
  34. DEPENDS:=+libuci +lua
  35. TITLE:=Lua plugin for UCI
  36. endef
  37. define Build/Configure
  38. endef
  39. TARGET_CFLAGS += $(FPIC)
  40. UCI_MAKEOPTS = \
  41. $(TARGET_CONFIGURE_OPTS) \
  42. COPTS="$(TARGET_CFLAGS)" \
  43. DEBUG="$(DEBUG)" \
  44. VERSION="$(UCI_VERSION)" \
  45. CPPFLAGS="-I$(PKG_BUILD_DIR) $(TARGET_CPPFLAGS)" \
  46. OS="Linux"
  47. # work around a nasty gcc bug
  48. ifneq ($(CONFIG_GCC_VERSION_4_2_4),)
  49. UCI_MAKEOPTS += WOPTS=""
  50. endif
  51. define Build/Compile
  52. $(MAKE) -C $(PKG_BUILD_DIR) $(UCI_MAKEOPTS)
  53. $(MAKE) -C $(PKG_BUILD_DIR)/lua $(UCI_MAKEOPTS)
  54. endef
  55. define Package/libuci/install
  56. $(INSTALL_DIR) $(1)/lib
  57. $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
  58. endef
  59. define Package/libuci-lua/install
  60. $(INSTALL_DIR) $(1)/usr/lib/lua
  61. $(CP) $(PKG_BUILD_DIR)/lua/uci.so $(1)/usr/lib/lua/
  62. endef
  63. define Package/uci/install
  64. $(INSTALL_DIR) $(1)/etc/uci-defaults
  65. $(INSTALL_DIR) $(1)/sbin
  66. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uci $(1)/sbin/
  67. $(CP) ./files/* $(1)/
  68. endef
  69. define Build/InstallDev
  70. $(INSTALL_DIR) $(1)/usr/include
  71. $(CP) $(PKG_BUILD_DIR)/uci{,_config}.h $(1)/usr/include
  72. $(INSTALL_DIR) $(1)/usr/lib
  73. $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/usr/lib
  74. $(CP) $(PKG_BUILD_DIR)/libuci.a $(1)/usr/lib
  75. $(CP) $(PKG_BUILD_DIR)/libucimap.a $(1)/usr/lib
  76. endef
  77. $(eval $(call BuildPackage,uci))
  78. $(eval $(call BuildPackage,libuci))
  79. $(eval $(call BuildPackage,libuci-lua))