Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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:=2
  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. endef
  38. define Package/lua5.3/description
  39. $(call Package/lua5.3/Default/description)
  40. This package contains the Lua language interpreter.
  41. endef
  42. define Package/luac5.3
  43. $(call Package/lua5.3/Default)
  44. TITLE+= (compiler)
  45. endef
  46. define Package/luac5.3/description
  47. $(call Package/lua5.3/Default/description)
  48. This package contains the Lua language compiler.
  49. endef
  50. TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99
  51. define Build/Compile
  52. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  53. CC="$(TARGET_CROSS)gcc" \
  54. AR="$(TARGET_CROSS)ar rcu" \
  55. RANLIB="$(TARGET_CROSS)ranlib" \
  56. INSTALL_ROOT=/usr \
  57. CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  58. PKG_VERSION=$(PKG_VERSION) \
  59. linux
  60. rm -rf $(PKG_INSTALL_DIR)
  61. mkdir -p $(PKG_INSTALL_DIR)
  62. $(MAKE) -C $(PKG_BUILD_DIR) \
  63. INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
  64. install
  65. endef
  66. define Host/Configure
  67. $(SED) 's,"/usr/local/","$(STAGING_DIR_HOSTPKG)/",' $(HOST_BUILD_DIR)/src/luaconf.h
  68. endef
  69. ifeq ($(HOST_OS),Darwin)
  70. LUA_OS:=macosx
  71. else
  72. ifeq ($(HOST_OS),FreeBSD)
  73. LUA_OS:=freebsd
  74. else
  75. LUA_OS:=linux
  76. endif
  77. endif
  78. define Host/Compile
  79. $(MAKE) -C $(HOST_BUILD_DIR) \
  80. CC="$(HOSTCC) -std=gnu99" \
  81. $(LUA_OS)
  82. endef
  83. define Host/Install
  84. $(MAKE) -C $(HOST_BUILD_DIR) \
  85. INSTALL_TOP="$(STAGING_DIR_HOSTPKG)" \
  86. install
  87. endef
  88. define Build/InstallDev
  89. $(INSTALL_DIR) $(1)/usr/include/lua5.3 $(1)/usr/lib
  90. $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.3/lua{,lib,conf}.h $(1)/usr/include/lua5.3/
  91. $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.3/lauxlib.h $(1)/usr/include/lua5.3/
  92. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua5.3.a $(1)/usr/lib/
  93. endef
  94. define Package/lua5.3/install
  95. $(INSTALL_DIR) $(1)/usr/bin
  96. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua5.3 $(1)/usr/bin/
  97. endef
  98. define Package/luac5.3/install
  99. $(INSTALL_DIR) $(1)/usr/bin
  100. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac5.3 $(1)/usr/bin/
  101. endef
  102. $(eval $(call BuildPackage,lua5.3))
  103. $(eval $(call BuildPackage,luac5.3))
  104. $(eval $(call HostBuild))