comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey D. Cherry" <yrrehcdj@hcetu.ten>
Subject: Re: GCC 3.1 with GNAT ... Cool!
Date: Thu, 20 Jun 2002 18:09:09 -0000
Date: 2002-06-20T18:09:09+00:00	[thread overview]
Message-ID: <Xns92337198D397Ajdcherryutechnet@216.168.3.40> (raw)
In-Reply-To: 8db3d6c8.0206200134.1ff139f7@posting.google.com

nma124@hotmail.com (steve_H) wrote in
news:8db3d6c8.0206200134.1ff139f7@posting.google.com: 

> Can you show examples of how to use gcc to compile Ada?

Yes, but this is in the documentation that comes with the Ada component of 
the GCC.  Look in the "GNAT User's Guide" that should be in the "info-html" 
subdirectory of the installation.  There is an example in the section titled 
"Running a Simple Ada Program" details the steps of using the gcc, gnatbind, 
gnatlink sequence and the equivalent process using gnatmake.

> 
> if one uses 'gcc foo.ada', what about 'gnatmake'? that is what is used
> more of the time. do you then now use normal Makfile to build your
> software and call 'gcc' from inside the makefile, or do you still use
> gnatmake? 

I haven't come accross an Ada project yet that couldn't use gnatmake to build 
an executable.  For example, the largest Ada project I've seen is composed of 
around 250K SLOC partitioned into about a dozen different executables.  The 
gnatmake program, with the proper command line options, was able to build 
each of those programs.

The Ada language, the GNAT compilation model, and the GNAT configuration 
pragmas, combined with the versatility of the GCC utilities makes the need 
for a separate make facility almost completely unnecessary.  However, some 
projects do things like combining units provided from third-party vendors, or 
object modules and libraries compiled using different high-level languages, 
or target different platforms, and this requires special steps.  In these 
cases the GNU make facility can provide the needed versatility, and yes, the 
make file will call the gcc compiler to create the dependent units.  Of 
course, gcc determines which compiler to use depending on the source file's 
extension or a command line switch.

> 
> this is confusing to me. Examples would help. 
> 
> It is strange of how important adding Ada to gcc is, there is almost
> nothing on the net that shows examples of how this is done, nothing on
> gcc web page and nothing on ACT web page. they mentioned GNAT and gcc,
> but no examples, nothing I could find.

I would love to provide examples and help make things more clear; however, 
the documentation that comes with the GNAT component of the GCC provides 
examples of compiling, linking, and running along with a vast array of 
suplementary information.  I doubt I could do better than what is already 
available, but if you provide a specific request, I'm sure that I or others 
reading CLA can elaborate on the processes involved.

Keep in mind that the process of creating executables from Ada source is the 
same as it's always been, and so finding documentation on something that 
hasn't changed will not be easy.  For me, the big savings is having one 
compiler installation that handles just about all the programming languages 
that I use either personally or professionaly.

-- 
Regards,
Jeffrey D. Cherry
Senior IV&V Analyst
Northrop Grumman Information Technology




  parent reply	other threads:[~2002-06-20 18:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-19 23:53 GCC 3.1 with GNAT ... Cool! Jeffrey D. Cherry
2002-06-20  1:06 ` Ted Dennison
2002-06-20 15:56   ` Jeffrey D. Cherry
2002-06-20 17:51   ` Florian Weimer
2002-06-20  5:22 ` achrist
2002-06-20 17:30   ` Jeffrey D. Cherry
2002-06-20 19:53     ` achrist
2002-06-20  9:34 ` steve_H
2002-06-20 16:09   ` David Marceau
2002-06-20 18:09   ` Jeffrey D. Cherry [this message]
2002-06-21 12:05   ` Georg Bauhaus
2002-06-21 11:24 ` Marc A. Criley
2002-06-21 14:39 ` Wes Groleau
2002-06-21 14:58   ` SIMON Claude
replies disabled

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