Note that there is no required order of compilation when using GNAT.
In particular it is perfectly fine to compile the main program first.
Also, it is not necessary to compile package specs in the case where
there is an accompanying body; you only need to compile the body. If you want
to submit these files to the compiler for semantic checking and not code
generation, then use the
-gnatc switch:

$ gcc -c greetings.ads -gnatc

Although the compilation can be done in separate steps as in the
above example, in practice it is almost always more convenient
to use the gnatmake tool. All you need to know in this case
is the name of the main program's source file. The effect of the above four
commands can be achieved with a single one:

$ gnatmake gmain.adb

In the next section we discuss the advantages of using gnatmake in
more detail.