A minimal build system for C projects written in C99 with a Go-based CLI.
Twig uses a simple key-value format for build manifests. Each manifest file defines a single build target.
Manifest files use a simple key = value format with comma-separated lists for multiple values.
target- The name of the build targettype- The type of target (executable)
sources- Comma-separated list of source filesincludes- Comma-separated list of include directories
target = myapp
type = executable
sources = main.c, folder1/file1.c, folder2/file2.c
includes = folder1, folder2- Key-Value Pairs: Use
key = valueformat - Whitespace: Leading and trailing whitespace around keys and values is ignored
- Comments: Lines starting with
#are ignored - Empty Lines: Empty lines are ignored
- Comma-Separated Lists: Multiple values are separated by commas
- Whitespace in Lists: Whitespace around comma-separated values is trimmed
executable- Builds an executable program
For a project with this structure:
project/
│ main.c
├─folder1/
│ ├─ file1.c
│ └─ file1.h
├─folder2/
│ ├─ file2.c
│ └─ file2.h
The manifest would be:
target = myapp
type = executable
sources = main.c, folder1/file1.c, folder2/file2.c
includes = folder1, folder2# This is a comment
target = myapp # Comments can be on the same line
type = executable
sources = main.c , utils.c , helper.c # Whitespace around commas is trimmed
includes = include , src , lib/include- Each manifest file defines exactly one target
- Source files can include subdirectories
- Include directories are used for header file resolution
- The manifest file should be named with a
.twigextension (e.g.,build.twig)