15 lines
1.3 KiB
Markdown
15 lines
1.3 KiB
Markdown
# MKLua
|
|
|
|
A small tool for generating a C file that bundles a lua library. This can either be used to bundle a lua library as a single .so file, or bundle a lua application into an executable. NOTE: sine lua uses .so files for native code, unfortunately, it would be prohibitively complex to rebuild all .so modules into static libraries. For this express purpose, self-contained executables are not yet possible.
|
|
|
|
## Output C file
|
|
|
|
This tool will output a single C file, which contains `luaopen_xxx` functions for each entry you specify. If those entries depend on anything, they will be included in the executable, but not exposed. Aditionally, if `--main` is specified, a boilerplate `int main` function will be generated, which will call the export of the first entry.
|
|
|
|
## Output makefile
|
|
|
|
In this mode (`--makefile`), the tool will output a boilerplate makefile, which will use mklua to emit a C file, and then will compile it to a binary. This Makefile works out of the box (you only need to specify the output filename). However, feel free to modify the file.
|
|
|
|
## Output dependencies and libraries
|
|
|
|
This tool can also be used to output all the files that the entries depend on. This is useful for makefile scripts, in order to detect changes. `--deps` prints all the files and `--libs` prints only the files found from `cpath` |