LinuxCommandLibrary

gnatmake

Ada program build utility

TLDR

Compile an Ada program

$ gnatmake [main.adb]
copy
Compile with optimization
$ gnatmake -O2 [main.adb]
copy
Compile with debugging info
$ gnatmake -g [main.adb]
copy
Compile with parallel jobs
$ gnatmake -j4 [main.adb]
copy
Specify output executable name
$ gnatmake [main.adb] -o [program]
copy
Force recompilation of all sources
$ gnatmake -f [main.adb]
copy

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.

SEE ALSO

gcc(1), gnatbind(1), gnatlink(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community