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,bab3a898ff9c3e0 X-Google-Attributes: gid103376,public From: "David C. Hoos" Subject: Re: Is there a "makedepend" equivalent that works with GNAT? Date: 1998/12/16 Message-ID: <759gj9$rma@hobbes.crc.com>#1/1 X-Deja-AN: 423135080 References: <3677F5DF.4D8F@ssd.fsi.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Coleman Research Corporation Newsgroups: comp.lang.ada Date: 1998-12-16T00:00:00+00:00 List-Id: Michael Bates wrote in message <3677F5DF.4D8F@ssd.fsi.com>... >Using GNAT 3.11b on SGI IRIX 6.5: > >Because I need to integrate Ada compilation into an existing system >of makefiles which we use to compile C and Fortran source, I need >something like "makedepend" to generate dependency rules for Ada files >to match GNAT's compilation model. > >Before someone says, "just use gnatmake", let me say that there are >things I need to be able to do with the source, object, and .ali files >that gnatmake doesn't know how to do. For example, I need the makefile >to be smart enough to try to check a file it needs (e.g., an Ada spec, >or a subunit) out of RCS if it doesn't see it in the current directory. > >So my question is: Does anyone have a script or program to generate >such dependency rules? Have you tried gnatmake -M on an up-to-date library? Here's what the GNAT User's Guide says on the subject: -M Check if all objects are up to date. If they are, output the object dependences to stdout in a form that can be directly exploited in a `Makefile'. By default, each source file is prefixed with its (relative or absolute) directory name. This name is whatever you specified in the various -aI and -I switches. If you use gnatmake -M -q (see below), only the source file names, without relative paths, are output. If you just specify the -M switch, dependencies of the GNAT internal system files are omitted. This is typically what you want. If you also specify the -a switch, dependencies of the GNAT internal files are also listed. Note that dependencies of the objects in external Ada libraries (see switch -aLdir in the following list) are never reported.