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,6458d1ee91b224ec X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.81.8 with SMTP id v8mr453724wix.7.1360922603105; Fri, 15 Feb 2013 02:03:23 -0800 (PST) Path: g1ni12261wig.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.meeh.mikalv.net!aioe.org!rt.uk.eu.org!weretis.net!feeder4.news.weretis.net!news.teledata-fn.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 09 Feb 2013 18:59:31 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: chopping Ada source that have preprocessor symbols in them References: <5111a9d5$0$6567$9b4e6d93@newsspool3.arcor-online.net> <85txpnm1vp.fsf@stephe-leake.org> <5114fb61$0$6561$9b4e6d93@newsspool4.arcor-online.net> <85ehgqkxnf.fsf@stephe-leake.org> In-Reply-To: <85ehgqkxnf.fsf@stephe-leake.org> Message-ID: <51168e7e$0$6566$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 09 Feb 2013 18:59:26 CET NNTP-Posting-Host: 3804d65f.newsspool3.arcor-online.net X-Trace: DXC=aH`^:_B5_V\mG86`U=_nC_McF=Q^Z^V3X4Fo<]lROoRQ8kFejVXGhXVjhSKI3]J9Z X-Complaints-To: usenet-abuse@arcor.de Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: 2013-02-09T18:59:26+01:00 List-Id: On 09.02.13 03:51, Stephen Leake wrote: > You have a file in CM: > > a_file.ada.gp > > It needs to be processed by gnatprep, then by gnatchop, and finally by > gprbuild. The problem is that running the chain of tools again and again is prohibitively inefficient. It boils down to recompiling the world after each edit. The full picture is this: I am given, and will give back, a file, a_file.ada.gp It has about two dozen compilation units in it, some of them have many generic instantiations that will keep the compiler busy. I need to edit just some unit and then compile the program again. There are two "configurations", C1, and C2. Starting in C1, suppose I first run gnatprep on a_file.ada.gp, then gnatchop the preprocessed output. The two steps will produce about two dozen files. I can then call gnatmake as usual. Next I want to edit unit U1. There now is a file F1, fully preprocessed and chopped. Again, I can run gnatmake as usual and the compiler will recompile only the units that depend on F1. To switch configurations from C1 to C2, I'd need to go back to the original a_file.ada.gp, which lacks the edits. Edit, or concatenate. Then gnatprep, gnatchop, and compile. If chopping would preserve the preprocessor symbols in the output files, I could switch conigurations after edits without having to (re)construct a_file.ada.gp and starting the process from scratch. (An Ada implementation that has a detailed mapping between compilation units and files of source text seems a bit more flexible here.) Directories to the rescue? Not quite, because editing unit F1 in one directory for C1 will not adjust F1 in another directory for C2. When I can keep the preprocessor symbols in the chopped output, then then gcc -gnatep=C1.gp, will work as usual after edits, i.e. it will only compile files as necessary. A Makefile seems good for switching configurations, though, or recreating a_file.ada.gp from chopped and edited unit files.