From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,35ce1c7836290812 X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: SGI GNAT Question? (Long) Date: 1999/03/02 Message-ID: #1/1 X-Deja-AN: 450327433 References: <7bflkk$78i$1@news.ro.com> Newsgroups: comp.lang.ada X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Date: 1999-03-02T00:00:00+00:00 List-Id: 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 \ \ -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 .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.