A compromise between the speed of make and the ease of use of a build script
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
moonbuild/README.md

35 lines
1.6 KiB

4 years ago
# moonbuild
**Now in v2 - complete rework from v1**
5 years ago
4 years ago
Because `make` is painful to use, and build scripts are too slow. Moonbuild aims to be a good compromise.
You should probably use [http://gittup.org/tup/](tup) instead if you want a good build system.
5 years ago
## How does it work?
4 years ago
`moonbuild` reads a build file, usually `Build.moon` that is written in a Moonscript DSL to define its targets and variables.
It then builds a DAG for the dependancies of the targets you tell it to build.
Then, it tries building every target in the graph while respecting dependancies, possibly on multiple processes.
5 years ago
4 years ago
Essentially, it works the same way as `make`, just with a different language, you can compare the `Build.moon` and `Makefile` in this repo to see for yourself.
5 years ago
4 years ago
## Why Moonscript?
Because it's fast, based on lua, and making DSLs with it is relatively easy.
It's also a language I like a lot, so I might have been biased when choosing it.
5 years ago
4 years ago
## Installing
It is available on luarocks with `luarocks install moonbuild`.
It is also recommended to install `luaposix` if you can, as it speeds it up a lot, or `luafilesystem` in case it isn't available.
5 years ago
4 years ago
## Building from source
You will need `argparse` and `moonscript` installed from luarocks, and `luaposix` or `luafilesystem` are recommended.
5 years ago
4 years ago
### Bootstrapping
You can build moonbuild with itself: `moon bin/moonbuild.moon -qjy`.
This will leave the binary ready to be used as `out/moonbuild`.
5 years ago
4 years ago
### Using make
You can also build moonbuild with make: `make`.
This will leave the binary ready to be used as `out/moonbuild`.
4 years ago
## Docs
TODO