A lil LISPy build system.
(library
libparser
(include-directories inc)
(sources lib/parser/parser.cpp)
(flags -Wall -Wextra -Wpedantic -Werror))
(library
libtests
(include-directories inc)
(sources lib/tests/tests.cpp)
(flags -Wall -Wextra -Wpedantic -Werror))
(dependency libtests libparser)
(executable
lbs
(include-directories inc)
(sources src/main.cpp)
;; (defines -DLBS_TEST)
(flags -Wall -Wextra -Wpedantic -Werror))
(dependency lbs libparser)
(dependency lbs libtests)
To use the build system, first of all build it. This can be done by bootstrapping with a pre-built binary or by using CMake. Either way, once you have an lbs
binary available, just run it (with the -n
argument signifying a dry run) from this directory (or any directory with a .lbs
build scenario description file). Most commonly this looks something like ./bld/lbs -n
.
What you’ll see is a command or commands that should look familiar to you if you’ve compiled a C or C++ project before, along with a few self-explanatory actions like file copies, deletions, etc.
Iff the commands look like something you are okay with running on your system, you can use ./bld/lbs
to run them. If you are in this directory, you will end up with an executable at ./lbs
.
The CLI also offers a best-effort attempt to convert the LISP build system description into a usable CMakeLists.txt
: just pass --cmake
and it will print it out instead of doing any building. This means that if your build system needs to perform more complex tasks than arbitrary shell commands (whatever that may be), then you can generate a workable CMakeLists.txt
and begin using that build system description from now on. In this way, lisp-build-system
can act as an easy-to-write build system description that is used in the beginnings of a program’s development and eventually dropped for a much more complicated and somewhat more powerful one like CMake once the need arises.