From: Ludovic Brenta on
Stefan Bellon <sbellon(a)sbellon.de> writes:
> Gautier wrote:
>
>> - time stamps to check need of recompilations
>
> I've always wondered about the focussing on time stamps. I think the way
> to do it would be to calculate a hash sum (md5, sha1, ...) on the token
> stream without comments. This way you wouldn't have to recompile if you
> do layout and commentary changes, and even if you touch the file, you
> don't inadvertently trigger a recompilation.

That's what GNAT does, only it uses a simple checksum for performance
reasons. Calculating the checksum and comparing it with the one in
the library (.ali files in the case of GNAT) has to be faster than
recompiling the file.

--
Ludovic Brenta.
From: Stefan Bellon on
Ludovic Brenta wrote:

> Stefan Bellon <sbellon(a)sbellon.de> writes:
> > Gautier wrote:
> >
> >> - time stamps to check need of recompilations
> >
> > I've always wondered about the focussing on time stamps. I think
> > the way to do it would be to calculate a hash sum (md5, sha1, ...)
> > on the token stream without comments. This way you wouldn't have to
> > recompile if you do layout and commentary changes, and even if you
> > touch the file, you don't inadvertently trigger a recompilation.
>
> That's what GNAT does, only it uses a simple checksum for performance
> reasons. Calculating the checksum and comparing it with the one in
> the library (.ali files in the case of GNAT) has to be faster than
> recompiling the file.

But timestamps are considered as well. If you touch a file without
modifying it otherwise, it triggers a recompilation.

--
Stefan Bellon
From: Ludovic Brenta on
Stefan Bellon writes:
> Ludovic Brenta wrote:
>
>> Stefan Bellon writes:
>> > Gautier wrote:
>> >
>> >> - time stamps to check need of recompilations
>> >
>> > I've always wondered about the focussing on time stamps. I think
>> > the way to do it would be to calculate a hash sum (md5, sha1, ...)
>> > on the token stream without comments. This way you wouldn't have to
>> > recompile if you do layout and commentary changes, and even if you
>> > touch the file, you don't inadvertently trigger a recompilation.
>>
>> That's what GNAT does, only it uses a simple checksum for performance
>> reasons. Calculating the checksum and comparing it with the one in
>> the library (.ali files in the case of GNAT) has to be faster than
>> recompiling the file.
>
> But timestamps are considered as well. If you touch a file without
> modifying it otherwise, it triggers a recompilation.

Not in my experience. Changing the timestamp causes a recalculation
of the checksum, that's all. Even after adding whitespace or
pretty-printing the file, there is no recompilation.

--
Ludovic Brenta.
From: Jean-Pierre Rosen on
Stefan Bellon a �crit :
> Gautier wrote:
>
>> - time stamps to check need of recompilations
>
> I've always wondered about the focussing on time stamps. I think the way
> to do it would be to calculate a hash sum (md5, sha1, ...) on the token
> stream without comments. This way you wouldn't have to recompile if you
> do layout and commentary changes, and even if you touch the file, you
> don't inadvertently trigger a recompilation.
>
Gnatmake can do that (see option -m)

--
---------------------------------------------------------
J-P. Rosen (rosen(a)adalog.fr)
Visit Adalog's web site at http://www.adalog.fr
From: Stefan Bellon on
Ludovic Brenta wrote:

> Stefan Bellon writes:

> > But timestamps are considered as well. If you touch a file without
> > modifying it otherwise, it triggers a recompilation.
>
> Not in my experience. Changing the timestamp causes a recalculation
> of the checksum, that's all. Even after adding whitespace or
> pretty-printing the file, there is no recompilation.

Hmmmm:

bellonsn(a)cube$ gnatmake foo.adb
gnatmake: "foo" up to date.
bellonsn(a)cube$ touch foo.adb
bellonsn(a)cube$ gnatmake foo.adb
gcc -c foo.adb
gnatbind -x foo.ali
gnatlink foo.ali


--
Stefan Bellon
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9
Prev: JGNAT - HTML generation
Next: GtkAda Tree_View properties