Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. #
  2. # Copyright (C) 2006-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. PKG_NAME:=lua
  10. PKG_VERSION:=5.1.4
  11. PKG_RELEASE:=3
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=http://www.lua.org/ftp/ \
  14. http://ftp.gwdg.de/pub/languages/lua/ \
  15. http://mirrors.dotsrc.org/lua/ \
  16. http://www.tecgraf.puc-rio.br/lua/ftp/
  17. PKG_MD5SUM:=d0870f2de55d59c1c8419f36e8fac150
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/lua/Default
  20. SUBMENU:=LUA
  21. SECTION:=lang
  22. CATEGORY:=Languages
  23. TITLE:=LUA programming language
  24. URL:=http://www.lua.org/
  25. endef
  26. define Package/lua/Default/description
  27. Lua is a powerful light-weight programming language designed for extending
  28. applications. Lua is also frequently used as a general-purpose, stand-alone
  29. language. Lua is free software.
  30. endef
  31. define Package/liblua
  32. $(call Package/lua/Default)
  33. SUBMENU:=
  34. SECTION:=libs
  35. CATEGORY:=Libraries
  36. TITLE+= (libraries)
  37. endef
  38. define Package/liblua/description
  39. $(call Package/lua/Default/description)
  40. This package contains the LUA shared libraries, needed by other programs.
  41. endef
  42. define Package/lua
  43. $(call Package/lua/Default)
  44. DEPENDS:=+liblua
  45. TITLE+= (interpreter)
  46. endef
  47. define Package/lua/description
  48. $(call Package/lua/Default/description)
  49. This package contains the LUA language interpreter.
  50. endef
  51. define Package/luac
  52. $(call Package/lua/Default)
  53. DEPENDS:=+liblua
  54. TITLE+= (compiler)
  55. endef
  56. define Package/luac/description
  57. $(call Package/lua/Default/description)
  58. This package contains the LUA language compiler.
  59. endef
  60. define Package/lua-examples
  61. $(call Package/lua/Default)
  62. DEPENDS:=lua
  63. TITLE+= (examples)
  64. endef
  65. define Package/lua-examples/description
  66. $(call Package/lua/Default/description)
  67. This package contains LUA language examples.
  68. endef
  69. define Build/Configure
  70. endef
  71. TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC)
  72. define Build/Compile
  73. $(MAKE) -C $(PKG_BUILD_DIR) \
  74. CC="$(TARGET_CROSS)gcc" \
  75. AR="$(TARGET_CROSS)ar rcu" \
  76. RANLIB="$(TARGET_CROSS)ranlib" \
  77. INSTALL_ROOT=/usr \
  78. CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  79. MYLDFLAGS="$(TARGET_LDFLAGS)" \
  80. PKG_VERSION=$(PKG_VERSION) \
  81. linux
  82. rm -rf $(PKG_INSTALL_DIR)
  83. mkdir -p $(PKG_INSTALL_DIR)
  84. $(MAKE) -C $(PKG_BUILD_DIR) \
  85. INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
  86. install
  87. endef
  88. define Build/InstallDev
  89. mkdir -p $(1)/usr/include
  90. $(CP) $(PKG_INSTALL_DIR)/usr/include/lua{,lib,conf}.h $(1)/usr/include/
  91. $(CP) $(PKG_INSTALL_DIR)/usr/include/lauxlib.h $(1)/usr/include/
  92. $(CP) $(PKG_INSTALL_DIR)/usr/include/lnum_config.h $(1)/usr/include/
  93. mkdir -p $(1)/usr/lib
  94. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.{a,so*} $(1)/usr/lib/
  95. ln -sf liblua.so.$(PKG_VERSION) $(1)/usr/lib/liblualib.so
  96. endef
  97. define Package/liblua/install
  98. $(INSTALL_DIR) $(1)/usr/lib
  99. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.so.* $(1)/usr/lib/
  100. endef
  101. define Package/lua/install
  102. $(INSTALL_DIR) $(1)/usr/bin
  103. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua $(1)/usr/bin/
  104. endef
  105. define Package/luac/install
  106. $(INSTALL_DIR) $(1)/usr/bin
  107. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac $(1)/usr/bin/
  108. endef
  109. define Package/lua-examples/install
  110. $(INSTALL_DIR) $(1)/usr/share/lua/examples
  111. $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/*.lua \
  112. $(1)/usr/share/lua/examples/
  113. endef
  114. $(eval $(call BuildPackage,liblua))
  115. $(eval $(call BuildPackage,lua))
  116. $(eval $(call BuildPackage,luac))
  117. $(eval $(call BuildPackage,lua-examples))