Why not make?
GNU Make is an incredibly powerful tool that has proven its worth through ~50 years of reliable use. But its age is also showing, and its behavior is often surprising to people who are used to more modern tools.
Put simply, it solves many hard problems that I don't have, and it doesn't solve many of the easy problems I do have.
The most glaring problem with Make is that it does not work well on Windows. It can be made to work, but not portably - often projects will have specific Makefiles for each platform, which must be maintained in isolation.
Key differences from Make
- Truly cross-platform:
werktreats Windows as a first-class target platform. werkhas a clear separation between "input" files (workspace) and "output" files (output directory).werkwill never produce files alongside input files.- Globbing "just works".
werktracks the result of glob operations between runs and detects that a file is outdated if one of its dependencies was removed since the last run. - No shell requirement:
werkdoes not execute commands in a shell, but performs its own$PATHlookup etc., meaning allWerkfiles work natively on all platforms without needing a POSIX emulation layer. - No shell (2): This also means that common POSIX shell utilities are not available. Most operations usually delegated to the shell can be performed using built-in language features instead, but explicitly invoking a shell is also an option.
- Build recipes and tasks recipes are separate things: No need for
.PHONYtargets. - Language semantics matching modern expectations:
werkdistinguished between lists and strings, meaning that file names can contain spaces. - No implicit rules.
- Automatic documentation.
werk --listprints the list of available recipes and configuration variables to the command line, along with any preceding comment. - Dry-run mode: Running
werk --dry-rundoes not run any commands, but still goes through the process of figuring out which commands would have been run. - Better debugging: Running
werk --explainexplains why a recipe was run. Also works with--dry-run. - Better error messages.
werktries very hard to be helpful when an error occurs.