[Emacs-ada-mode] Thanks and my first enquiry
The masked-coder known as Randux
randux at Safe-mail.net
Sun Aug 20 14:33:35 PDT 2006
Hi Stephe,
I wanted to respond but I'm a bit bleary eyed so here's what I have for now and tomorrow I'll try to send a better reply.
> > Yes, and also to explain the installation process for the contents of
> > the tarball.
>
> Do you mean the Emacs tarball, or ada-mode.tar.gz. I guess you
> mean the latter. Yes, that needs some explaining.
Sorry, yes, I meant the ada-mode tarball. The one I saw had lots of comments for Lisp programmers but no installation notes.
> >> The menu also provides "ada-compile-current", not bound to a key,
> >> which generates object code for the current file.
> >
> > Apparently it doesn't do the full gnatmake, so I think while it's
> > aptly named, it's not enough. There should be something such as
> > ada-make-current if that makes any sense.
>
> I don't understand what you mean by it.
If I understand properly (which would be quite the miracle at this hour) gnatmake does one of the following:
1. if issued against a main program A (A has with B; with C;) compiles all the dependencies (B and C) that have changed, compiles the main program A, and links the main program A.
2. if issued against against programs B or C which provides services(A has with B; with C;), compiles that program B or C, then compiles and links all of the consumers such as A.
If this is true, it's why I say that there should be a function (probably the most important one) to do gnatmake on whatever the buffer is I'm working with. If I'm working with a main program, gnatmake is necessary because of #1 above. And if I'm working with a package withed by anyone, it's necessary for reason #2 above.
> I think we need some simple examples to help explain/understand this.
> I'll work on some in the context of a tutorial in the manual. In the
> meantime, can you post some example files, and how you are trying to
> compile them?
I'm hoping that my explanation here will have been enough, as my Ada is no doubt an embarrassment. But if nobody "gets" me then I will send along what I have.
> There is an important difference between files that are Ada main
> programs, and files that are Ada, but not main programs.
It's not exactly clear to me how those are defined. I suppose a program that is not withed by anything else would qualify as a main program, and programs that are withed by something else are "files that are Ada, but not main programs?"
> It only makes sense to invoke compile and link (gnatmake) on Ada main
> programs.
Ah, but gnatmake is supposed to be intelligent enough to do what's necessary. So if I understand what the people have been saying on comp.lang.ada about gnatmake checking dependencies and compiling and/or linking as necessary, then I think the above statement is not true. Because gnatmake against a subprogram will compile the subprogram and rebuild all the programs that with it. Is that not correct?
> It normally makes sense to invoke only syntax check (gnatmake -gnatc)
> on non-main programs. It sometimes makes sense to invoke "compile
> only, no link" (gnatmake -c) on non-main programs.
Same objection as above.
> But the recommended process is to always invoke 'gnatmake -gnatc' on
> the main program, even when you've just edited some other file. That
> will identify all of the compilation errors for all the files that
> make up the program. When that completes with no errors, then you
> invoke 'gnatmake' on the main program, to generate the executable.
That seems to suggest that there isn't any purpose in rebuilding other subprograms that have changed until the main program you're working on is correct. What if we have this scenario:
program A is main program that withs program X
program B is main program that withs program X
You are working on program A and program X. If I understand what's being said here, we don't want to relink program B automagically when program X's changes are complete? If we continuously do gnatmake incrementally, I think program B is always current. Otherwise, it seems to me that we have to do a separate gnatmake on program B even though gnatmake on X would have rebuilt B...
> The main use of a project file is to specify multiple directories that
> are part of the project.
>
> However, there must also be a way to specify which file is the main
> program; apparently that's not clear with the current Ada mode.
I think it would be nice to be able to work on any number of Ada source modules (main programs and subprograms) in one Emacs session and not have Emacs be required to know anything about the relationships. Just invoke gnatmake on the current buffer name and be done with it. Will this not work?
Sorry if my thinking or writing is foggy. Long day learning Ada ;)
>
> --
> -- Stephe
Randall
More information about the Emacs-ada-mode
mailing list