I’m working on integrating nnvg
from Nunavut into our build process, which is based on Makefile. The files generated by nnvg
include a disclaimer about version control, suggesting they should be generated as part of the build process:
// Checking this file under version control is not recommended unless it is used as part of a high-SIL
// safety-critical codebase. The typical usage scenario is to generate it as part of the build process.
I’m looking for examples or recommendations on creating Makefile rules that trigger nnvg
only when changes occur in either the source or the lookup DSDL files. While I’ve discovered the --list-outputs
and --list-inputs
options in nnvg
, integrating their outputs into the Makefile-based build process isn’t straightforward.
Here are the development steps I aim to achieve:
0. Install nunavut
.
- Clone the project and its subprojects without the committed DSDL-generated code.
- Execute
make
:- The build process should detect the absence of DSDL-generated code and generate it from the configured DSDL directories before compiling the project code.
- Make changes in the project code without modifying DSDL files.
- Execute
make
again:- The build process should recognize that the DSDL-generated code exists and hasn’t changed, hence doing nothing before compiling the project code.
- Make changes in the project code that affect DSDL files.
- Execute
make
once more:- The build process should detect changes in the DSDL files and either regenerate the modified files optimally or regenerate all the code before compiling the project code.
Any guidance or examples on setting up these Makefile rules with the appropriate nnvg
options would be greatly appreciated.