Conditionally execute commands only when dependency files are newer than the target, like make but standalone
3a:T6f1,
checkexec conditionally runs a command only if any dependency file is newer
than the target file. It provides make-style conditional rebuilds as a
standalone tool.
checkexec <target> <dependencies...> -- <command>
The -- separator is required.
checkexec build/my-bin src/my-program.c -- cc -o build/my-bin src/my-program.c
checkexec build/my-bin --infer -- cc -o build/my-bin src/my-program.c
checkexec target/debug/hello $(fd -e rs . src) -- cargo build
checkexec build/web/main.dart.js $(fd -e dart . lib) -- flutter build web
checkexec build/styles.css src/styles.scss -- sass src/styles.scss build/styles.css
0 — target is up to date, command was NOT run1 — a dependency or the command was not foundcheckexec executes commands directly, NOT through a shell&&, ||, pipes) are not supported in <command>checkexec <target> <deps> -- /bin/bash -c "cmd1 && cmd2"checkexec invocations over shell wrappingcheckexec is callable (build-step/CI)make recipes); checkexec adds back conditional rebuilds