gnatmake
Ada program build utility
TLDR
Compile an Ada program
$ gnatmake [main.adb]
Compile with optimization$ gnatmake -O2 [main.adb]
Compile with debugging info$ gnatmake -g [main.adb]
Compile with parallel jobs$ gnatmake -j4 [main.adb]
Specify output executable name$ gnatmake [main.adb] -o [program]
Force recompilation of all sources$ gnatmake -f [main.adb]
SYNOPSIS
gnatmake [options] filename [options_]
DESCRIPTION
gnatmake is the primary build utility for Ada programs in the GNAT (GNU Ada Toolset) environment. It automatically determines dependencies by analyzing Ada's with clauses, compiles modified source files, and performs binding and linking to create an executable. Unlike traditional make utilities, gnatmake always recomputes dependencies from sources, ensuring accurate tracking of changes.
PARAMETERS
-jN
Use N parallel jobs for compilation.-g
Generate debugging information.-Olevel
Optimization level (0, 1, 2, 3, or s for size).-o name
Output executable name.-c
Compile only, do not bind or link.-f
Force recompilation of all sources.-q
Quiet mode, less output.-v
Verbose mode.-Idir
Add directory to source search path.--RTS=runtime
Specify Ada runtime library.
CAVEATS
Multiple main files can be specified to build several executables. Dependencies are computed from Ada source files rather than object file timestamps.
