Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #
  2. # Copyright (C) 2006-2014 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. PKG_NAME:=lua
  9. PKG_VERSION:=5.3.5
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://www.lua.org/ftp/ \
  13. http://www.tecgraf.puc-rio.br/lua/ftp/
  14. PKG_HASH:=0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac
  15. PKG_BUILD_PARALLEL:=1
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=COPYRIGHT
  18. HOST_PATCH_DIR := ./patches-host
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/host-build.mk
  21. define Package/lua5.3/Default
  22. SUBMENU:=Lua
  23. SECTION:=lang
  24. CATEGORY:=Languages
  25. TITLE:=Lua programming language
  26. URL:=http://www.lua.org/
  27. MAINTAINER:=Jo-Philipp Wich <[email protected]>
  28. endef
  29. define Package/lua5.3/Default/description
  30. Lua is a powerful, efficient, lightweight, embeddable scripting language. It
  31. supports procedural programming, object-oriented programming, functional
  32. programming, data-driven programming, and data description.
  33. endef
  34. define Package/lua5.3
  35. $(call Package/lua5.3/Default)
  36. TITLE+= (interpreter)
  37. PROVIDES:=lua
  38. endef
  39. define Package/lua5.3/description
  40. $(call Package/lua5.3/Default/description)
  41. This package contains the Lua language interpreter.
  42. endef
  43. define Package/luac5.3
  44. $(call Package/lua5.3/Default)
  45. TITLE+= (compiler)
  46. PROVIDES:=luac
  47. endef
  48. define Package/luac5.3/description
  49. $(call Package/lua5.3/Default/description)
  50. This package contains the Lua language compiler.
  51. endef
  52. TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99
  53. define Build/Compile
  54. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  55. CC="$(TARGET_CROSS)gcc" \
  56. AR="$(TARGET_CROSS)ar rcu" \
  57. RANLIB="$(TARGET_CROSS)ranlib" \
  58. INSTALL_ROOT=/usr \
  59. CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  60. PKG_VERSION=$(PKG_VERSION) \
  61. linux
  62. rm -rf $(PKG_INSTALL_DIR)
  63. mkdir -p $(PKG_INSTALL_DIR)
  64. $(MAKE) -C $(PKG_BUILD_DIR) \
  65. INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
  66. install
  67. endef
  68. define Host/Configure
  69. $(SED) 's,"/usr/local/","$(STAGING_DIR_HOSTPKG)/",' $(HOST_BUILD_DIR)/src/luaconf.h
  70. endef
  71. ifeq ($(HOST_OS),Darwin)
  72. LUA_OS:=macosx
  73. else
  74. ifeq ($(HOST_OS),FreeBSD)
  75. LUA_OS:=freebsd
  76. else
  77. LUA_OS:=linux
  78. endif
  79. endif
  80. define Host/Compile
  81. $(MAKE) -C $(HOST_BUILD_DIR) \
  82. CC="$(HOSTCC) -std=gnu99" \
  83. $(LUA_OS)
  84. endef
  85. define Host/Install
  86. $(MAKE) -C $(HOST_BUILD_DIR) \
  87. INSTALL_TOP="$(STAGING_DIR_HOSTPKG)" \
  88. install
  89. endef
  90. define Build/InstallDev
  91. $(INSTALL_DIR) $(1)/usr/include
  92. $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.3/lua{,lib,conf}.h $(1)/usr/include/
  93. $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.3/lauxlib.h $(1)/usr/include/
  94. endef
  95. define Package/lua5.3/install
  96. $(INSTALL_DIR) $(1)/usr/bin
  97. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua5.3 $(1)/usr/bin/
  98. endef
  99. define Package/luac5.3/install
  100. $(INSTALL_DIR) $(1)/usr/bin
  101. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac5.3 $(1)/usr/bin/
  102. endef
  103. $(eval $(call BuildPackage,lua5.3))
  104. $(eval $(call BuildPackage,luac5.3))
  105. $(eval $(call HostBuild))