librdesc
Loading...
Searching...
No Matches
Building

librdesc uses a modular build system with separate Makefiles for the library, tests, and examples.

Refer to librdesc for integration.

Library

Build the main library:

make # Build release version (default)
make MODE=debug # Build with debug symbols
make MODE=test # Build with coverage instrumentation

Features

Providing FEATURES variable, you can toggle modules linked to the library. By default, stack and flip_left features are enabled. You may use feature flag full to include all features.

make FEATURES='stack flip_left ...'
Feature Description
stack (default) Use built-in stack implementation in backtracing, which uses malloc/free family functions.
flip_left (default) Convert right-recursive match to left-recursive.
dump_bnf Dump rdesc_grammar in Backus-Naur form.
dump_cst Dump rdesc_node (Concrete Syntax Tree) as dotlang graph.

Flags

Providing FLAGS variable, you can toggle injection macros. Similar to Features, you may use feature flag full to include all flags.

Flag Description
ASSERTIONS Enable runtime boundary and logic validation checks.

Tests

Tests are organized into three categories and built independently:

cd tests
make integration # Integration tests links librdesc as-is
make unit # Tests with dependency injections
make fuzz # Build optimized fuzz tests

Or from project root:

./runtests.sh # Build and run all tests with coverage

Examples

Examples build using their Makefile, and example output will be present in dist/examples/ folder.

cd examples
make # Build example programs

Examples statically links librdesc in tests mode.