Simon Ask Ulsnes
,
Table of contents
werk
is a simplistic build system, similar to make
, and a command runner,
similar to just
. It tries to be very easy to use, and religiously portable.
This is a general overview. For a more detailed explanation of syntax and
behavior, please consult the project’s README.
The source code for werk
is available on GitHub.
Check out the examples.
Caution:
werk
is alpha software. Features may be buggy or missing. It may
eat your code. Use at your own risk. Commit everything before trying it out. Consider
trying it out in a virtual machine first. Don’t blame me if you didn’t.
The motivation for werk
is that make
is annoying. Make is a very
sophisticated tool that solves a bunch of problems I don’t have, and doesn’t
solve many problems that I do have.
My personal use case – highly specific, but far from unique:
- I’m building a video game. Video games have a complex build process, because
they contain both code and assets. - Iteration speed is important.
- Some assets are code:
- WASM plugins built by Cargo.
- Shaders built by
glslc
andslangc
. Shader compilation is slow, so
precise dependency tracking (depfiles) is important.
- Native Windows support is a hard requirement.
- When it doesn’t do what I want, I need to be able to understand why.
Why not Make?
Here’s an incomplete list of problems I have with make
:
- I want to use file names and paths that contain spaces.
- I want build rules and “housekeeping” workflows to not interact in surprising
and bad ways (.PHONY
). - I want to work natively on Windows, as well as Linux and macOS. You can get
GNU Make to sort of work using layers of emulation, but fundamentally it’s a
bad experience. Specifically, Makefiles typically rely on the presence of
external POSIX utilities, likesed
,awk
, and so on, and all of these
interact in undesirable ways with Windows filesystems. - I want to put build artifacts in a separate directory.
- I want to use glob patterns in my build scripts (reliably), and I want them to
be.gitignore
-sensitive, like all the other tools we use. - In general, file modification times are just insufficient in determining
outdatedness. - I want variables, lists, strings, and other things we expect of contemporary
languages. - I want to be able to diagnose my b