Executing a simple Lua script
To execute a Lua script, you can choose to use either the Lua library or the Lua source code. For production projects, I personally recommend using the source code. For learning purposes, either way is fine. We will use Lua source code in the rest of this book.
Can you notice this?
Even if you choose to use the Lua source code, in the Makefile
, you are first building the Lua source code into the Lua library and then make your project link to the library. Compared to using the Lua library directly, using the Lua source code is just doing one more step in your project. You can focus more on the similarities rather than the differences.
Now, let’s look at a more general project structure.
Creating a project
As said, there will be more complex projects in the following chapters. For now, we will explore a more general project structure. We will build and link to Lua in a shared location instead of making a copy for each project.
The...