comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
Subject: Re: SGI GNAT Question? (Long)
Date: 1999/03/02
Date: 1999-03-02T00:00:00+00:00	[thread overview]
Message-ID: <MJ3xAGKZ#GA.252@pet.hiwaay.net> (raw)
In-Reply-To: 7bflkk$78i$1@news.ro.com

In your lengthy message (which might have better been submitted to
chat@gnat.com), you didn't specify in which directory you were when you
issued the various commands.

However, I'll tell you how I build programs on SGI platforms of a similar
kind, and with similar library structures.

Some details of my work differ, so I'm only 99.9 % sure about the -n32
details.  We must use -o32 because we depend on some third-party libraries
with o32 objects, and we deal with that by editing the specs file which can
be located using the gcc -v command.

Also, since I edit and do test compiles from within Emacs, I use Emacs
Ada-mode project files as described in the Gnat User's Guide.

I also use a Makefile to "remember" the various options and commands, but
I'll show how I would do it manually.

When I want to build an executable (using your directory names) I cd to the
linklib directory, and issue:

gnatmake -i -m \
-I/src/common \
-I/src/models/model_1 \
-I/src/models/model_2 \
-I/src/models/model_3 \
-o <main-unit-name> \
<main-unit-name> \
-cargs -g -O0 -n32 \
-largs -n32

This compiles any out-of-date objects _in the directory in which the source
code resides_, then binds and links.

The switches which you didn't mention, and their purposes are:

  -i  Excerpting from the Gnat User's Guide here -- In normal mode, gnatmake
compiles all object files and ALI files into the current directory. If
the -i switch is used, then instead object files and ALI files that already
exist are overwritten in place. This means that once a large project is
organized into separate directories in the desired manner, then gnatmake
will automatically maintain and update this organization. If no ALI files
are found on the Ada object path (section Search Paths and the Run-Time
Library (RTL)), the new object and ALI files are created in the directory
containing the source being compiled. If another organization is desired,
where objects and sources are kept in different directories, a useful
technique is to create dummy ALI files in the desired directories. When
detecting such a dummy file, gnatmake will be forced to recompile the
corresponding source file, and it will be put the resulting object and ALI
files in the directory where it found the dummy file.

My make file does a "touch <file-name>.ali" in the appropriate directory for
all compilation units (i.e. for each body file thet is not a separate, and
for each spec file which has no body), to create the "dummy" files to which
the Gnat User's Guide refers.

  -m  Again, excerpting from the Gnat User's Guide -- Specifies that the
minimum necessary amount of recompilation be performed. In this mode
(gnatmake) ignores time stamp differences when the only modifications to a
source file consist in adding/removing comments, empty lines, spaces or
tabs. This means that if you have changed the comments in a source file or
have simply reformatted it, using this switch will tell gnatmake not to
recompile files that depend on it (provided other sources on which these
files depend have undergone no semantic modifications).

We use this because some of our source files are created at build time by
gnatchop followed by gnatprep.  We have multiple platforms for which we
compile with platform-dependent code conditionally compiled with the aid of
gnatprep, and we still must use VADS, as well, so our source code repository
files are all .a files.  This means that source files are always generated
anew by passing through gnatchop (where we cannot a-priori determine the
filenames of gnat chop's output), then through gnatprep for the conditional
compilation.

The upshot is that all source files then have newer timestamps than the
corresponding .o and .ali files, but the -m switch never fails to do the
right thing in terms of only compiling files which have changed
semantically.

I generally only explicitly compile with gcc when I have edited a file with
Emacs, preferring to let gnatmake and my Makefile figure out the minimum
compilation required.

By using the project files to specify the dependencies and compile switches,
etc., for each directory, I insure that all files compiled from within Emacs
will have been compiled with the same options which I specify in the
Makefile.

I know this has been long, but I hope it's helpful.

It's been about three months since I did SGI work with GNAT, but we were
using gnat-3.11b, and I've moved on to a new company, so I have noting but
my memory to go on.

Except for the -n32, however, This is typical of the way I do things on all
platforms using gnat.  I've used this technique on SGI, Alpha, Solaris
Linux, Win32, and DOS.

David C. Hoos, Sr.







  reply	other threads:[~1999-03-02  0:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-02  0:00 SGI GNAT Question? (Long) Paul Colvert
1999-03-02  0:00 ` David C. Hoos, Sr. [this message]
1999-03-02  0:00   ` GNAT discussions should be here as well kvisko
1999-03-02  0:00     ` Larry Kilgallen
1999-03-02  0:00     ` dennison
1999-03-02  0:00     ` robert_dewar
1999-03-02  0:00     ` Mike Silva
1999-03-02  0:00     ` Samuel Mize
1999-03-02  0:00 ` SGI GNAT Question? (Long) dewar
1999-03-03  0:00   ` Paul Colvert
1999-03-03  0:00     ` robert_dewar
1999-03-04  0:00       ` SpamSpamSpam
1999-03-04  0:00         ` dennison
1999-03-04  0:00         ` dewar
1999-03-05  0:00           ` SpamSpamSpam
1999-03-05  0:00             ` GNAT Field Test scope (was SGI GNAT Question) Larry Kilgallen
1999-03-05  0:00             ` SGI GNAT Question? (Long) dennison
1999-03-05  0:00               ` dewar
1999-03-07  0:00               ` root
1999-03-07  0:00                 ` dewar
1999-03-08  0:00               ` Marin David Condic
1999-03-05  0:00             ` dewar
1999-03-05  0:00               ` dennison
1999-03-05  0:00                 ` robert_dewar
1999-03-07  0:00                   ` root
1999-03-07  0:00                     ` dewar
1999-03-08  0:00                       ` root
1999-03-09  0:00                         ` Some GNAT history (was Re: SGI GNAT Question? (Long)) dewar
1999-03-09  0:00                           ` Tom Moran
1999-03-09  0:00                           ` dennison
1999-03-09  0:00                             ` robert_dewar
1999-03-11  0:00                           ` Arthur Evans Jr
1999-03-11  0:00                             ` dennison
1999-03-09  0:00                         ` SGI GNAT Question? (Long) dewar
1999-03-10  0:00                           ` SpamSpamSpam
1999-03-10  0:00                             ` robert_dewar
1999-03-10  0:00                             ` Chris Morgan
1999-03-10  0:00                               ` dewar
1999-03-10  0:00                                 ` Chris Morgan
1999-03-10  0:00                                   ` dewar
1999-03-07  0:00                     ` David Botton
1999-03-07  0:00                       ` robert_dewar
1999-03-05  0:00             ` bourguet
1999-03-05  0:00               ` dennison
1999-03-05  0:00                 ` dewar
1999-03-02  0:00 ` Gautier
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox