Hi Eric,
> I will look into making sure the autoloads dependency is managed by
> Project.ede, but that can go into a later beta. There is no obvious
> way to do it in EDE. I may just re-order Project.ede as it is a
> dependency that is specific only to this project.
Following our work to fix target dependencies in Project.ede, I
hacked the attached patch to semantic-ede-grammar.el.
My main concern was to give more flexibility when generating compiler
commands, that is to be able to define dynamic things in the
:commands slot.
What I propose is in fact very simple. For now the :commands slot
is a list of strings. What I have added is the possibility to
include symbols that should represent method names. When a such
symbol is encountered the corresponding method of the current target
is called, and the returned value is inserted in the command stream.
For now, I just hacked semantic-ede-grammar. However it is certainly
better to provide that feature at a higher level (in ede-pmake.el?).
Also I used a local variable `semantic-ede-grammar--target' to hold
the current target before calling nested objects methods. IMO, it
would be better if nested objects (compilers, linkers, etc.) have a
`parent' or `target' slot initialized with the target object that
contains them. Unfortunately my EIEIO skills are still too limited
and I didn't found where to do that in EDE. Probably you could help
there ;-)
I modified the semantic Project.ede to illustrate how the new feature
can be useful.
In the `metagrammar' target I added a dependency on the `autoloads'
target (which is no more needed in the `all' target). The
`metagrammar' Makefile rule now looks like this:
metagrammar: $(metagrammar_SEMANTIC_GRAMMAR) autoloads
...
The problem was that the compiler commands where static and used "$^"
to reference the dependencies:
${EMACS} ... -f semantic-grammar-batch-build-packages $^
With the autoloads new dependency the above will result in this bad call:
${EMACS} ... -f semantic-grammar-batch-build-packages
semantic-grammar.wy autoloads <--- Oops!
Using dynamic commands it is now possible to generate this compiler call:
${EMACS} -batch ... -f semantic-grammar-batch-build-packages \
$(metagrammar_SEMANTIC_GRAMMAR) <--- The target sourcevar :-)
Which correctly expands to:
${EMACS} ... -f semantic-grammar-batch-build-packages
semantic-grammar.wy
Hope my explanations are clear enough!
Here is the change log:
2003-11-13 David Ponce <david@...>
* cedet/semantic/Makefile
Re-generated.
* cedet/semantic/Project.ede
(autoloads): Not part of the "all" target.
(metagrammar): Depend on "autoloads".
* cedet/semantic/semantic-ede-grammar.el
(semantic-ede-grammar-compiler-class): Doc fix.
(ede-proj-makefile-sourcevar-ref): New method.
(semantic-ede-grammar-compiler-wisent)
(semantic-ede-grammar-compiler-bovine): Use it to dynamically
insert a reference to the source variable of the current target.
(semantic-ede-grammar--target): New variable.
(ede-proj-makefile-insert-commands): New method.
(ede-proj-makefile-insert-commands): New method.
* cedet/semantic/bovine/Makefile
Re-generated.
* cedet/semantic/wisent/Makefile
Re-generated.
Thoughts?
David
|