Make (lite) implementation in Prolog.
  • Prolog 64.9%
  • Nix 35.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Kovacsics Robert 3d0bf471ea
Add README
2026-10-16 00:09:13 +01:00
.envrc Add flake config 2026-10-15 23:48:44 +01:00
flake.lock Add flake config 2026-10-15 23:48:44 +01:00
flake.nix Add flake config 2026-10-15 23:48:44 +01:00
LICENSE Add MIT No Attribution license 2026-10-15 23:48:44 +01:00
make.pl Split into make implementation and makefile 2026-10-16 00:06:57 +01:00
makefile.pl Split into make implementation and makefile 2026-10-16 00:06:57 +01:00
README.md Add README 2026-10-16 00:09:13 +01:00

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.