finer granularity in omitting errors from include statements sensible?

View: New views
2 Messages — Rating Filter:   Alert me  

finer granularity in omitting errors from include statements sensible?

by Michele Zamparelli-2 :: Rate this Message:

| View Threaded | Show Only this Message

Hi,
I have been trying to avoid these errors:
acsMakefileCore.mk:418: ../object/aaa.d: No such file or directory
== Dependencies: C++ ../object/aaa.d

using the dash in front of the include statement, just to find out that
it is apparently too large a hammer.

There is a customary rule for the automatic creation of dependencies files:

../object/aaa.o ../object/aaa.d : Makefile  aaa.C ../include/toto.h

but if for whatever reason the commands for that rule fail (e.g. a
syntax error), the user merely gets a non zero return code but will
never know the reason for it.

I have also tried using the advanced auto dependency generation
technique explained by Paul D. Smith at
http://mad-scientist.net/make/autodep.html  but concluded that avoiding
the first-run inclusion of freshly generated dependency files would deal
a deadly blow to using code generation solutions, in which one of the
prerequisites (say, ../include/toto.h) is missing from the file system,
but a rule exists to generate it.

Needless to say, we would like to continue to use code generation,
without having to hard code a sequentiality in the main target (e.g.
all: generate do_the_rest, not good for parallel builds), but also
avoiding the many (benign) error messages above.

I am wondering whether it would make sense to request that the dash in
front of the include statement merely silences off the "No such file or
directory" case, but not all other errors which may result from the
execution of the corresponding target.

Am I the only one in this situation? Is there an alternative?
Thanks in advance,

Michele

_______________________________________________
Help-make mailing list
Help-make@...
https://lists.gnu.org/mailman/listinfo/help-make

Re: finer granularity in omitting errors from include statements sensible?

by Paul Smith-20 :: Rate this Message:

| View Threaded | Show Only this Message

On Thu, 2012-03-22 at 09:18 +0100, Michele Zamparelli wrote:
> I have also tried using the advanced auto dependency generation
> technique explained by Paul D. Smith at
> http://mad-scientist.net/make/autodep.html  but concluded that avoiding
> the first-run inclusion of freshly generated dependency files would deal
> a deadly blow to using code generation solutions, in which one of the
> prerequisites (say, ../include/toto.h) is missing from the file system,
> but a rule exists to generate it.

You definitely need to explicitly define all dependencies on generated
headers.  That doesn't necessarily mean you can't use the advanced
method, it just means that IN ADDITION you have to declare any generated
header dependencies.

> I am wondering whether it would make sense to request that the dash in
> front of the include statement merely silences off the "No such file
> or directory" case, but not all other errors which may result from the
> execution of the corresponding target.

Can you provide a small, concrete example?

There are definitely some warts on this part of the code.  A number of
years ago I made a stab at fixing them but that area is somewhat hairy
and the changes I made ended up breaking other things.  A concentrated
effort would be needed to understand all the ramifications and come up
with a good solution.

--
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@...>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
Help-make@...
https://lists.gnu.org/mailman/listinfo/help-make