Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. include $(TOPDIR)/rules.mk
  8. UCI_VERSION=0.7
  9. UCI_RELEASE=5
  10. PKG_NAME:=uci
  11. PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
  12. PKG_RELEASE:=1
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
  15. PKG_MD5SUM:=ed34c5ef606a90da4aba03ce6d22eeb9
  16. include $(INCLUDE_DIR)/package.mk
  17. # set to 1 to enable debugging
  18. DEBUG=
  19. define Package/libuci
  20. SECTION:=libs
  21. CATEGORY:=Libraries
  22. TITLE:=C library for the Unified Configuration Interface (UCI)
  23. endef
  24. define Package/uci
  25. SECTION:=base
  26. CATEGORY:=Base system
  27. DEPENDS:=+libuci
  28. TITLE:=Utility for the Unified Configuration Interface (UCI)
  29. endef
  30. define Package/libuci-lua
  31. SECTION=libs
  32. CATEGORY=Libraries
  33. DEPENDS:=+libuci +lua
  34. TITLE:=Lua plugin for UCI
  35. endef
  36. define Build/Configure
  37. endef
  38. TARGET_CFLAGS += $(FPIC)
  39. UCI_MAKEOPTS = \
  40. $(TARGET_CONFIGURE_OPTS) \
  41. COPTS="$(TARGET_CFLAGS)" \
  42. DEBUG="$(DEBUG)" \
  43. VERSION="$(UCI_VERSION)" \
  44. CPPFLAGS="-I$(PKG_BUILD_DIR) $(TARGET_CPPFLAGS)" \
  45. OS="Linux"
  46. # work around a nasty gcc bug
  47. ifneq ($(CONFIG_GCC_VERSION_4_2_4),)
  48. UCI_MAKEOPTS += WOPTS=""
  49. endif
  50. define Build/Compile
  51. $(MAKE) -C $(PKG_BUILD_DIR) $(UCI_MAKEOPTS)
  52. $(MAKE) -C $(PKG_BUILD_DIR)/lua $(UCI_MAKEOPTS)
  53. endef
  54. define Package/libuci/install
  55. $(INSTALL_DIR) $(1)/lib
  56. $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
  57. endef
  58. define Package/libuci-lua/install
  59. $(INSTALL_DIR) $(1)/usr/lib/lua
  60. $(CP) $(PKG_BUILD_DIR)/lua/uci.so $(1)/usr/lib/lua/
  61. endef
  62. define Package/uci/install
  63. $(INSTALL_DIR) $(1)/etc/uci-defaults
  64. $(INSTALL_DIR) $(1)/sbin
  65. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uci $(1)/sbin/
  66. $(CP) ./files/* $(1)/
  67. endef
  68. define Build/InstallDev
  69. $(INSTALL_DIR) $(1)/usr/include
  70. $(CP) $(PKG_BUILD_DIR)/uci{,_config}.h $(1)/usr/include
  71. $(INSTALL_DIR) $(1)/usr/lib
  72. $(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/usr/lib
  73. $(CP) $(PKG_BUILD_DIR)/libuci.a $(1)/usr/lib
  74. $(CP) $(PKG_BUILD_DIR)/libucimap.a $(1)/usr/lib
  75. endef
  76. $(eval $(call BuildPackage,uci))
  77. $(eval $(call BuildPackage,libuci))
  78. $(eval $(call BuildPackage,libuci-lua))