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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,112ee4ae931079e6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-06 07:38:31 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!demon!proxad.net!skynet.be!skynet.be!louie!tlk!not-for-mail Sender: lbrenta@lbrenta Newsgroups: comp.lang.ada Subject: Re: Using GNU make with ObjectAda References: From: Ludovic Brenta Date: 06 Sep 2003 16:37:31 +0200 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: 80.200.131.243 X-Trace: 1062859109 reader2.news.skynet.be 432 80.200.131.243:45009 X-Complaints-To: usenet-abuse@skynet.be Xref: archiver1.google.com comp.lang.ada:42208 Date: 2003-09-06T16:37:31+02:00 List-Id: "Tim Spargo" 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.