We need to distribute binaries and installation instructions for multiple Linux distributions. Since the installation instructions are mostly similar among the distros, we would like to keep a single document that contains the common sections as well as distro-specific sections, say with special markings. We would like to be able to run some sort of command (nroff/groff?) to generate the distro specific installation docs on demand.
What is the best way to achieve this? I don’t want to reinvent anything …
How about using cpp, the C pre-processor? You can use defines to specify the distro:
You can run the build on pretty much any GNU/Linux system:
or: