comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic.brenta@skynet.be>
Subject: Re: Using GNU make with ObjectAda
Date: 06 Sep 2003 16:37:31 +0200
Date: 2003-09-06T16:37:31+02:00	[thread overview]
Message-ID: <m3k78mnftg.fsf@insalien.org> (raw)
In-Reply-To: rjk6b.4250$I_2.637875@news20.bellglobal.com

"Tim Spargo" <tim.spargo@NO_SPAMsympatico.ca> writes:

> Hmm... speaking in general, if by "translation tools" I assume you mean
> compilers, linkers etc. then compilers can normally generate dependencies
> (in C/C++ with the "-M" option previously mentioned) for a particular source
> file. But normally it is up to the make file to rebuild an entire project.

Not true.  Make files were invented only to overcome the shortcomings
of the C language with respect to separate compilation, and C++
happily kept these shortcomings.

> For example if a single header/spec file has changed, which files in the
> project need to be rebuilt? The compiler doesn't know this.

An Ada compiler does know this; Java compilers also make an attempt at
this, but IMHO are not very good at it.

> Of course these files may be in different directories etc. So the
> makefile is needed to capture the dependency relationships between
> the project files.

Again, this is not true of Ada compilers.

In Ada, you have the concept of a "library" of compilation units
(packages or subprograms that are "at library level"); the Ada
compiler is in charge of maintaining this library and making sure the
units it contains remain consistent with one another.  It is this
"library" that lets the compiler keep track of where source files are.

In Ada, separate compilation, as well as the rules for consistency,
are defined by the language (the ARM devotes the entire Chapter 10,
"Program Structure and Compilation Issues", to this).

In C and C++, separate compilation is defined not by the language but
by the particular tools ("make" and linker) you use.  For example, the
ISO C99 standard defines the "extern" keyword (6.2), external
definitions (6.9), and the #include preprocessor directive (6.10.2)
but does not define how object files must be linked together, much
less any rules for consistency.  "make" provides you with a separate
language and interpreter (very different from C) that allows you to
describe the relationships between your source and object files.  Not
only is "make" not part of C/C++, you can even use alternatives such
as "ant" or "cook".

As P.J. Plaugher once said, "above 100,000 lines of code, we should
all be coding in Ada".

-- 
Ludovic Brenta.



  parent reply	other threads:[~2003-09-06 14:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-04 22:16 Using GNU make with ObjectAda Tim Spargo
2003-09-05 12:13 ` Georg Bauhaus
2003-09-06 12:21   ` Tim Spargo
2003-09-06 13:00     ` Marin David Condic
2003-09-06 14:37     ` Ludovic Brenta [this message]
2003-09-07 20:42       ` Robert I. Eachus
2003-09-15  4:16       ` Dave Thompson
2003-09-06 20:42 ` Guillaume Foliard
2003-09-08 13:48   ` Stephen Leake
2003-09-08 22:22     ` Guillaume Foliard
2003-09-09  0:05       ` Ludovic Brenta
2003-09-09 13:38       ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2003-09-08  9:00 Lionel.DRAGHI
replies disabled

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