Skip to content

kris-gaudel/twig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twig 🪵

A minimal build system for C projects written in C99 with a Go-based CLI.

Manifest Syntax

Twig uses a simple key-value format for build manifests. Each manifest file defines a single build target.

Basic Syntax

Manifest files use a simple key = value format with comma-separated lists for multiple values.

Required Fields

  • target - The name of the build target
  • type - The type of target (executable)

Optional Fields

  • sources - Comma-separated list of source files
  • includes - Comma-separated list of include directories

Example

target = myapp
type = executable
sources = main.c, folder1/file1.c, folder2/file2.c
includes = folder1, folder2

Format Rules

  1. Key-Value Pairs: Use key = value format
  2. Whitespace: Leading and trailing whitespace around keys and values is ignored
  3. Comments: Lines starting with # are ignored
  4. Empty Lines: Empty lines are ignored
  5. Comma-Separated Lists: Multiple values are separated by commas
  6. Whitespace in Lists: Whitespace around comma-separated values is trimmed

Supported Target Types

  • executable - Builds an executable program

File Structure Example

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

Comments and Whitespace

# 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

Notes

  • 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 .twig extension (e.g., build.twig)

About

Minimal build system written in C99 and Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published