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-Thread: a07f3367d7,163994d4f34e92d0 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.74.225 with SMTP id x1mr1794933pav.45.1344318898544; Mon, 06 Aug 2012 22:54:58 -0700 (PDT) Path: p10ni724pbh.1!nntp.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!ctu-peer!ctu-gate!news.nctu.edu.tw!usenet.stanford.edu!postnews.google.com!r9g2000yqr.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: how to tell gnatmake to send executables to a different directory when compiling multi source? Date: Wed, 1 Aug 2012 02:37:29 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1ffdae87-74c9-4900-9645-bf1c5828e448@r9g2000yqr.googlegroups.com> References: <214bbd15-f7cb-4710-a6a7-64f37923bf4e@googlegroups.com> <87wr1moexq.fsf@ludovic-brenta.org> <87sjcaoa08.fsf@ludovic-brenta.org> <50167d29$0$6570$9b4e6d93@newsspool4.arcor-online.net> <873947cbja.fsf@catnip.gol.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 X-Trace: posting.google.com 1343813849 26451 127.0.0.1 (1 Aug 2012 09:37:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 1 Aug 2012 09:37:29 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r9g2000yqr.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.4) Gecko/20120509 Firefox/10.0.4,gzip(gfe) X-Received-Bytes: 3042 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-08-01T02:37:29-07:00 List-Id: Miles Bader wrote: > "J-P. Rosen" writes: >>> I do not know if this is what you refer to or not, but gcc can generate, >>> _automatically_, a dependency file (.d extension) using the gcc -M flag. >> (Disclaimer: I didn't know about that option). > >> However, I assume that this works only if the programmer properly used >> the appropriate .h files, which is in no way required by C. > > It assumes nothing about the way .h files are used. > > It essentially emits the include-file graph in an appropriate format, > usable by make. In fact it does assume something. The assumption is, as is usual in the C world, hidden, so you don't see it. The hidden assumption here is that the -I flags and environment variables passed to the compiler to find the include files are the same when extracting the dependencies with -M and later when compiling using the extracted dependencies. Breaking this assumption breaks the build in ways impossible to predict and almost impossible to debug. It takes a proper software engineer to detect hidden assumptions. Jean-Pierre is one. Hidden assumptions are *also* the devil. -- Ludovic Brenta. The plannings leverage a forward planning.