RISC OS Build EnvironmentROBE

Workflow guides12Packaging and Source Maintenance

Introduction and Overview

Once a project builds successfully, two further concerns are common: getting the built output to someone else in a usable archive, and keeping the C source itself in good shape. Neither is required to build a project, but both come up often enough in normal development to be worth covering alongside Building, linking, and outputs.

Packaging and source maintenance

Packaging and extracting archives

Built outputs are often distributed or inspected through archive formats rather than as raw files in a directory. The build environment includes tools for both modern ZIP-based packaging and older RISC OS archive formats that still appear in source drops, application releases, and reference material.

ZIP packaging for release output

Use riscos-zip to package built files while preserving RISC OS filetype and timestamp information. Use riscos-unzip to list or extract those archives later. These tools are the normal choice for release ZIPs because they preserve RISC OS metadata in a form that survives transfer through non-RISC OS systems.

This is the common release pattern:

riscos-zip -v mytool.zip aif32/MyTool,ff8
Zip compress: File 'aif32.MyTool', size 10892 bytes, type &FF8 (Absolute)
riscos-unzip -l mytool.zip
aif32.MyTool WR/WR Absolute 14:52:51 21-Jun-2026 10Kbytes

The reported filetype, size, and timestamp will naturally differ between runs; what matters is that the RISC OS filetype (Absolute here) is preserved through the archive rather than reduced to a generic host file.

The RISC OS ZIP extension fields used by these tools are summarised in ../appendix/riscos-zip-file-format.

Older archive formats

Older RISC OS software is often distributed as Spark or ArcFS archives, or in the TBAFS archive format. Use riscos-nspark to list, test, or extract Spark and ArcFS archives. Use riscos-tbafs to inspect and extract ,b21 TBAFS archives.

These commands are typical when recovering files from legacy archives. Both tools report a clear error naming the archive if it cannot be found or opened, rather than failing silently:

riscos-nspark -lv archive.arc
riscos-nspark -xT archive.arc
riscos-tbafs list -v archive,b21
riscos-tbafs extract -o restored archive,b21

The TBAFS archive structure is described in ../appendix/tbafs-file-format.

Squash-compressed files

Some older files are not multi-file archives at all, but single files compressed with the Squash format. Use riscos-sqsh to decompress those files either into a new output file or to standard output when you want to inspect the uncompressed content directly.

For example:

riscos-sqsh ROMImage,fca
riscos-sqsh -c ROMImage,fca > ROMImage

Checking and formatting C sources

The normal build loop for C projects often includes one or both of the source quality wrappers riscos-cppcheck and riscos-indent. These are not required to build a project, but they are useful when cleaning older code, checking portability assumptions, or making a source tree conform to a consistent house style before submitting a change.

Static checking with riscos-cppcheck

riscos-cppcheck wraps the standard cppcheck tool with defaults that better match the build environment. In 32-bit mode it assumes Norcroft-style C89 code on the riscos platform, and in 64-bit mode it switches to 64-bit RISC OS defaults. The wrapper also rewrites reported filenames back into RISC OS form by default.

A common whole-tree check is:

riscos-cppcheck .
Checking c.main ...
Checking c.main: __riscos=1;__arm=1...

Each source file is reported using its RISC OS-style name (c.main, not the host c/main), confirming the filename rewrite mentioned above. No further output means no issues were found; reported warnings appear as additional lines after the matching "Checking" line.

If you need a different language standard or platform description, supply --std=... or --platform=... explicitly. The wrapper will then use your values instead of its defaults.

Reformatting with riscos-indent

riscos-indent is the matching formatting wrapper for C sources. It accepts RISC OS-style filenames, uses the environment's default /etc/indent.pro profile if you do not already have a personal ~/.indent.pro, and suppresses backup-file creation so routine reformatting does not leave extra files in the working tree.

The normal usage is simply:

riscos-indent c/module

riscos-indent is silent on success; the file is reformatted in place, with no confirmation printed.

If you want a different personal formatting style, create your own ~/.indent.pro on the host side and the wrapper will leave that choice alone.