comp.lang.ada
 help / color / mirror / Atom feed
From: M E Leypold <development-2006-8ecbb5cc8aREMOVETHIS@ANDTHATm-e-leypold.de>
Subject: Re: Conditional compilation of debug traces without cpp
Date: 07 Jul 2006 16:08:01 +0200
Date: 2006-07-07T16:08:01+02:00	[thread overview]
Message-ID: <9zzmfl1pa6.fsf@hod.lan.m-e-leypold.de> (raw)
In-Reply-To: ufyhdu2me.fsf@acm.org


Stephen Leake <stephen_leake@acm.org> writes:

> In GNAT, the use of preprocessed files is not so transparent, because
> gnatmake does not know how to run the preprocessor. 

This has already annoyed me a number of times. I'd have liked to use
gnatmake exclusively, but because of this I've been forced to wrap a
Unix Makefile around gnatmake which will first do all preprocessing
before invoking gnatmake. Ugly.


> In addition, you need different naming conventions for the original
> and preprocessed files. If the preprocessed files follow the GNAT
> convention (the simplest choice), then the editing environment (Emacs
> or GPS or AdaGIDE) will still not understand the naming convention for
> the original files.

A way around this is, to store the not preprocessed files in a
subdirectory and let them have the same suffices as the Ada sources.

For instance, the perprocessor input for foo.adb would live in
template/foo.adb. When using Unix make, a rule like

template/%.adb: %.adb
        ... preprocess ...

can take care of the preprocessing.

> With a proper makefile, you can run the GNAT preprocessor on _all_
> files.  If you use the GNAT default naming convention for the
> original files (so the editor works nicely), and tell GNAT to use an
> alternate naming convention for the preprocessed files (via project
> files), using the GNAT preprocessor will be as transparent as using
> the Gnu C preprocessor.

This is another interesting approach. Probably better than mine. Thanks.

Regards -- Markus




  reply	other threads:[~2006-07-07 14:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-04 18:06 Conditional compilation of debug traces without cpp guillaume.portail
2006-07-04 19:07 ` Ludovic Brenta
2006-07-04 19:14   ` guillaume.portail
2006-07-04 21:39     ` Björn Persson
2006-07-04 21:43       ` guillaume.portail
2006-07-04 22:01         ` Björn Persson
2006-07-05  3:10     ` Matthew Goulet
2006-07-04 20:24 ` Gautier
2006-07-04 20:54 ` Simon Wright
2006-07-05 13:03 ` Jean-Pierre Rosen
2006-07-05 19:39   ` guillaume.portail
2006-07-06  5:53     ` Martin Krischik
2006-07-07 10:32       ` Stephen Leake
2006-07-07 14:08         ` M E Leypold [this message]
2006-07-06  7:59     ` Jean-Pierre Rosen
2006-07-06 20:25       ` guillaume.portail
2006-07-07  5:00         ` Matthew Goulet
2006-07-07 13:57           ` Thierry Bernier
2006-07-07 21:08           ` Randy Brukardt
replies disabled

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