• Stars
    star
    129
  • Rank 269,901 (Top 6 %)
  • Language
    Lua
  • License
    MIT License
  • Created over 13 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Lua-based Build Tool

Lake - a Lua-based Build Tool

lake is a build engine written in Lua, similar to Ruby's rake. It is not a makefile generator, but evaluates dependencies directly - that is, it is an interpreter of dependency rules, not a makefile compiler. This is a sensible design decision because lake is small (about 70K pure Lua, 250K together with Lua and LuaFileSystem) enough to carry around.

Much of the inspiration for lake comes from Martin Fowler's article on dependency-driven programming in rake.

There is one file, lake, which only depends on LuaFileSystem. On Unix, you can simply make it executable and put it on your path.

Or for Windows:

rem lake.bat
lua \path\to\lake %*

Apart from being quick & compact, these are the features of interest:

  • it is an embedded DSL (Domain Specific Language) - all the normal functionality of Lua is available
  • it knows about both GCC and Microsoft Visual C++ compilers, and does cross-platform builds
  • it knows about building Lua extensions in C or C++

For example, a lakefile for building a GTK application can be as simple as:

c.program{'hello',needs='gtk'}

Creating a binary Lua extension:

c.shared{'mylib',needs='lua'}

lake can be used to automate other tools as well. This will convert all JPEG files in the current directory to PNG, but only if the PNG file does not exist or the JPEG file has changed.

to_png = rule('.jpg','.png',
  'convert $(INPUT) $(TARGET)'
)

default(to_png '*')

Here is a lakefile for building Lua itself:

LUA='lua'
LUAC='luac print'
as_dll = WINDOWS
if as_dll then
  defs = 'LUA_BUILD_AS_DLL'
end
if not WINDOWS then
  defs = 'LUA_USE_LINUX'
end

-- build the static library
lib,ll=c.library{'lua',src='*',exclude={LUA,LUAC},defines=defs}

-- build the shared library
if as_dll then
  libl = c.shared{'lua',rules=ll,dynamic=true}
else
  libl = lib
end

-- build the executables
lua = c.program{'lua',libl,src=LUA,needs='dl math readline',export=not as_dll}
luac = c.program{'luac',lib,src=LUAC,needs='math'}

default {lua,luac}

More details can be found in doc/index.md

Released under the MIT/X11 licence, Steve Donovan, 2010-2013

More Repositories

1

gentle-intro

A gentle Rust tutorial
Rust
820
star
2

luar

luar is a Go package for conveniently working with the luago Lua bindings. Arbitrary Go functions can be registered
Go
300
star
3

winapi

Minimal but useful Lua bindings to the Windows API
C
188
star
4

Microlight

A little library of useful Lua functions, intended as the 'light' version of Penlight
Lua
163
star
5

LuaMacro

An extended Lua macro preprocessor
Lua
144
star
6

runner

Tool for running Rust snippets
Rust
141
star
7

luabuild

A highly customizable Lua 5.2 build system, allowing for common external modules to be linked in statically, and built-in modules to be excluded
C
77
star
8

luaish

A Lua REPL with global name tab-completion and a shell sub-mode
Lua
58
star
9

UnderC

Interactive C++ Interpreter for x86 Systems
C++
57
star
10

chrono-english

Converting informal English dates (like `date` command) to chrono DateTime in Rust
Rust
54
star
11

llib

A compact library for C99 (and MSVC in C++ mode) providing refcounted arrays, maps, lists and a cool lexical scanner.
C
40
star
12

MonoLuaInterface

Mono-buildable version of LuaInterface
C#
36
star
13

el

A more commamd-line friendly style of using Lua
Lua
32
star
14

outstreams

C++ wrapper around stdio that overloads the call operator to output fields
C++
32
star
15

Orbiter

A personal Lua Web Application Server
Lua
29
star
16

llua

Higher-level C API for Lua based on llib
C
29
star
17

lua-patterns

Exposing Lua string patterns to Rust
Rust
28
star
18

ltags

Exuberant CTags compatible tag files from Lua projects
Lua
25
star
19

stevedonovan.github.com

Project Pages
HTML
24
star
20

lua-command-tools

Command-line utilties for performing common Lua one-liners, like matching string patterns and substitution.
Lua
22
star
21

findr

Expression-oriented fast file finder
Rust
20
star
22

lapp

a Rust port of the Lua Lapp framework: a straightforward GNU-style command-line parser which uses usage text to define arguments
Rust
17
star
23

mosquitto-client

Rust
15
star
24

LuaExpatUtils

Utilities for pretty-printing lxp.dom style LOM and constructing LOM documents
Lua
15
star
25

lglob

Extended undefined-variable checker for Lua 5.1 and 5.2
Lua
14
star
26

luafaq

Unofficial Lua FAQ
14
star
27

shmake

A shell-based build tool.
C
12
star
28

cs-repl

A REPL for C# (formerly known as CSI)
C#
12
star
29

rx-cpp

Modern C++ Regular Expressions library, wrapping both POSIX and Lua string patterns.
C++
11
star
30

scanlex

A simple lexical scanner in Rust
Rust
11
star
31

LuaRocksTools

Support utilities for working with LuaRocks
Lua
10
star
32

lua-gentle-intro

8
star
33

grun

A command-line runner for Go expressions
Go
8
star
34

easy-shortcuts

Useful helpers for implementing short command-line tools in Rust
Rust
8
star
35

tinycpp

Compact 'fake' standard library strings and streams, for experimental purposes only ;)
C++
7
star
36

ldeb

ldeb converts Lua scripts into Debian packages
Lua
7
star
37

Webrocks

A self-contained local web interface to LuaRocks
JavaScript
6
star
38

flot-rs

Rust
6
star
39

rockspec

A command-line tool and DSL for generating rockspecs for LuaRocks
Lua
5
star
40

cargo-docgen

Cargo subcommand for testing and formatting Rust documentation tests
Rust
3
star
41

moi

MOI (MQTT Orchestration Interface) is a simple management tool for groups of remote systems
Rust
1
star
42

lily-extras

A collection of examples and extensions for the Lily programming language
C
1
star
43

ght

ght is a friendly HTTP/API command-line tool in the footsteps of HTTPie
Go
1
star
44

jaywalk

Java utility classes for easier command-line and GUI programs
1
star
45

xflag

Extended version of Go's flag package, with support for opening files and positional parameters
1
star