https://github.com/mlabbe/pyprepro
Experimental build edge specification ninja builder
https://github.com/mlabbe/pyprepro
Last synced: 9 months ago
JSON representation
Experimental build edge specification ninja builder
- Host: GitHub
- URL: https://github.com/mlabbe/pyprepro
- Owner: mlabbe
- Created: 2024-05-30T03:10:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-25T20:51:34.000Z (almost 2 years ago)
- Last Synced: 2025-04-11T13:19:12.080Z (about 1 year ago)
- Language: Python
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Pyprepro #
Barebones experimental program.
Create a ninja.build file from build edges. For example, if foo.c
starts with:
// || build-edge: ninja
// || rule: grc
// || in: grain/struct.gen grain/def.gr
This creates a ninja build edge line referencing rule type 'grc' that
targets foo.c as an output.
The 'grc' program is intelligent enough to know to preserve this build
edge specification, and so the output file will rebuild successfully.
## Build-Edge Ninja Supported Keys ##
If a key isn't listed as supported here, it's passed on to ninja build verbatim.
### rule ###
The ninja build rule to invoke in order to generate this file. The supported options are in 'build_rules' at the top of pyprepro.py. Ultimately it would be nice to make this program build rule agnostic.
### in ###
One or more 'in' lines is required. Each line contains one file that
is needed to build.
// || in: message.tmpl
// || in: vars.toml
### set ###
Given a line like:
// || set: foo = bar
Create a variable %foo that is interpolated in 'in' lines.
It is possible to use variables to generate variables
// || set: src_dir = ../src
// || set: tmpl_dir = %src_dir/tmpl
Note that I wanted to use '$' instead of '%' but that conflicts with ninja build variables.