You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ARCHIVED: Checkout LadyLua for your standalone Lua programs.
omniajit
Compile Lua 5.1 and LuaJIT source code into standalone executables. This makes it easy to use them for general purpose scripting.
Requires: GNU Make, a compiler and binutils (or equivalent). Installing development tools e.g. the package build-essential should have everything you need. Does not require autotools.
Note: Linux 3.17+ (5 Oct 2014) and glibc 2.25+ only for getrandom().
Getting started
Edit the following space delimited variables in the top-level Makefile
MAIN: The "main" script in the bin/ directory
SRC: Modules that are specific to your application. Copy these to src/lua.
SRC_DIR: Directories containing modules that are specific to your application. Copy these to src/lua.
VENDOR: 3rd party modules
VENDOR_DIR: directories containing 3rd party modules
Copy the main source file into the bin/ directory.
Copy modules into src/lua/ or vendor/lua/.
The SRC, VENDOR split is just for organization. Underneath they are using the same Make routines.
Run make
The executable will be located under the bin/ directory
Adding plain Lua modules. (NOTE: VENDOR and SRC are interchangeable.)
Adding plain modules is trivial. $(NAME) is the name of the module passed to VENDOR.
Copy the module to vendor/lua/$(NAME).lua
example: cp ~/Downloads/dkjson.lua vendor/lua
Add $(NAME) to VENDOR
example: VENDOR= re dkjson
For modules that are split into multile files, such as Penlight:
Copy the directory of the Lua to vendor/lua/$(NAME)
example: cp -R ~/Download/Penlight-1.3.1/lua/pl vendor/lua
Add $(NAME) to VENDOR_DIR
example: VENDOR_DIR= pl
For modules with multiple levels of directories you will have to pass each directory. Example: VENDOR_DIR= ldoc ldoc/builtin ldoc/html
Lua does not have facilities to traverse directories and I'd like to avoid shell out functions.