Make (lite) implementation in Prolog.
- Prolog 64.9%
- Nix 35.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .envrc | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| make.pl | ||
| makefile.pl | ||
| README.md | ||
Make (lite) build system in Prolog
The file make.pl contains the build-system implementation, and
the file makefile.pl contains an example makefile.
Usage
❯ direnv allow
❯ cat >! main.cpp <<EOF
#include <stdio.h>
int main() { printf("Hello, world\n"); }
EOF
❯ ./make.pl
g++(-c,-o,./main.obj,./main.cpp)
gcc(-o,./main.elf,./main.obj)
❯ ./main.elf
Hello, world
And currently it implements timestamp based rebuild detection.
❯ ./make.pl
./main.obj up to date
./main.elf up to date
❯ touch main.cpp
❯ ./make.pl
g++(-c,-o,./main.obj,./main.cpp)
gcc(-o,./main.elf,./main.obj)
See https://kovirobi.uk/blog/misc/build-systems/prolog/ for details on how it works under the hood.