[... deleted...]
The problem with `--automake' is that it consideres any modification of the file a reason to recompile everything that depends on it (so it tries to be too conservative in doubt).
The often-announced `gp' utility will solve this (by keeping a checksum of the interface). But, as I said before, it's not finished yet (in particular, it doesn't work with modules yet, only with units).
This might be another reason to make the release of gp a higher priority. But I don't think I'll be able to finish it this year. BTW, what's your time scale, would it still be useful to you some time later, or will you have to find another way then, anyway?
Frank
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E
Hi!
After playing with automake I have to say that `gp' utility will be very usefull. And it doesn't matter when it will arrive. But automake would be usefull if the following bug will be fixed: I use the Extended Pascal syntax for interface and implementation. Sometimes I need to import modules in implementation only. The problem is that when I change the imported module and recompile with --automake nothing is compiled in module which imports the changed one in implementation only.
Example: ------------- mod1.pas ------------------ module mod1 interface; export mod1 = all; procedure mod1_write; end. module mod1 implementation; procedure mod1_write; begin writeln ('mod1.mod1_write'); end; end. -------------- mod2.pas ---------------------- module mod2 interface; export mod2 = all; procedure mod2_write; end. module mod2 implementation; import mod1; procedure mod2_write; begin mod1_write; end; end. ------------------- main.pas -------------------- program main (input,output); import mod1; import mod2; begin mod1_write; mod2_write; end.
Now I change mod1_write to accept string parameter and change nothing in the rest of the files gpc --automake main.pas causes me to change the mod1_write invocation in main.pas line 5. When I change it I succeed to build new a.out and when I run I fail with Segmentation fault after the first print trying to invoce the mod1_write from the mod2.
I still use 20020510 gpc build but no bug concerning `-automake' has been fixed since then!
Regarding the automake "conservativity" - I find it usefull to allow split of interface and implementation in different files. Then change of the implementation only will not cause the recompile of the whole project. The gpc user workflow would be like this: 1. change the implementation (say mod1.pas) 2. recompile - gpc -c mod1.pas (important - in case of implementation only only mod1.o should be changed) 3. relink the project.
If interface was change then : 1. recompile the interface file (say mod1_.pas) 2. recompile the project with gpc --automake project_main.pas
This way ADA environment works on VMS systems and I find it very usefull. Actually its' (ADA) smart recompile is much much smarter - it can recognize whether the objects used in importing module (package in ADAish) had been changed in imported module interface and thus decides what should be recompiled.
I think it is the best you can get and somehow too much. Say it would be nice to have but I'd be glad if the decisions would be on the level - used interface changed so recompile is needed and when I recompile the module and the interface remains the same - it causes no further recompile.
I hope it was clear enough and if not then I can explain myself better...
Meanwhile I'll have to find some workaround, but as soon as `gp' will see the sun-light I'll use it!
Nick