Intrinsic Rules
Besides user-defined rules, FoBiS.py ships four built-in intrinsic rules accessible via FoBiS.py rule:
| Rule | Description |
|---|---|
-get <option> | Print the value of any fobos option |
-get_output_name | Print the final output file path |
-ford <project-file> | Build FORD documentation |
-gcov_analyzer <dir> [summary] | Analyse gcov coverage files |
-get — retrieve a fobos option
Print the value of any option defined in the selected mode:
FoBiS.py rule -get build_dir
FoBiS.py rule -mode release -get build_dir
FoBiS.py rule -f my_fobos -get obj_dirThis is useful in shell scripts that need to locate build artefacts:
BUILD=$(FoBiS.py rule -mode release -get build_dir)
echo "Build directory: $BUILD"-get_output_name — retrieve the output file path
Print the full path of the final output (executable or library):
FoBiS.py rule -get_output_name
FoBiS.py rule -mode release -get_output_nameThe path is constructed from build_dir + output (or derived from target + mklib) as defined in the fobos mode.
-ford — FORD documentation
Run the FORD documentation generator on a project file:
FoBiS.py rule -ford doc/ford-project.mdEquivalent to ford doc/ford-project.md but integrated into the fobos workflow. Combine with a user rule for a one-command build + document workflow:
[rule-doc]
help = Build with FORD
quiet = True
rule = FoBiS.py rule -ford doc/ford-project.md-gcov_analyzer — coverage analysis
Parse all .gcov files found under the current directory, generate a Markdown report for each, and optionally write a summary:
# Reports saved to ./reports/, no summary
FoBiS.py rule -gcov_analyzer reports/
# Reports + summary Markdown file
FoBiS.py rule -gcov_analyzer reports/ coverage-summaryThe analyser generates:
- One
<filename>.gcov.mdper.gcovfile, with line and procedure coverage tables - An optional
<summary>.mdcontaining aggregate statistics and Mermaid pie charts
Coverage workflow
# 1. Build with coverage instrumentation
FoBiS.py build -coverage
# 2. Run the program (generates .gcov data)
./myapp
# 3. Generate .gcov files
gcov -o obj/ src/*.f90
# 4. Analyse
FoBiS.py rule -gcov_analyzer reports/ summary