0
votes

I am making a script that requires lmapm, but I'm not quite sure how to install it. I have 4 files,

lmapm.c
test.lua
README
Makefile 

And I'm not sure how to use them in my lua environment. Lua 5.1 is installed on my desktop in a folder called "5.1", and it was installed with LuaRocks (If that matters) I know lua libraries are used with require, but this is a c file, not a lua file.

How can I install/use lmapm in my lua programs?

Upon reading the readme it tells me to run make, but makefile is just a "file" on my computer, there is nothing I can run it with.

1
lmapm is available in the LuaRocks repository, so a luarocks install lmapm MAPM_INCDIR=... MAPM_LIBDIR=... (insert the correct paths) should do it. - siffiejoe
Are you running Windows or Linux or Mac OS X? - lhf

1 Answers

1
votes
  • README: Short description of what you got and how to install & use the module at the end.
  • test.lua: Lua script to test the module/sample of usage.
  • lmapm.c: C source code and the module in raw/still unusable form. Needs to get compiled and linked to a dynamic library of target platform.
  • Makefile: Automatic build instructions to compile&link lmapm.c to what you finally use in Lua.

Makefile serves as a macro which makes building easier with minimal input by users. To run this file, you need program make (comes with GNU toolchain; on Unix install package build-essential, on Windows MSYS). Before you have to fix the path to your Lua and MAPM installation (as mentioned in the official build instructions). Furthermore you need the C compiler and linker (which you already installed on Unix together with make and have to install on Windows by f.e. MinGW).

The result is a dynamic library/Lua C module which you can require simply by its filename. To put it in the scope of Lua, move it in the application or (better) in the Lua modules directory.