[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-include is not completely silent?

From: Mohun Biswas
Subject: -include is not completely silent?
Date: Wed, 24 Mar 2004 16:00:01 -0500

I'd hesitate to call this a bug, as it's not actually inconsistent with the documentation, but it was a little surprising to me and I'm curious whether it's deliberate and/or well-known. The -include directive is documented as "acts like include in every way except that there is no error (not even a warning) if any of the filenames do not exist". But if the list of filenames is actually empty you still get a warning. This is a subtlety that wouldn't occur too often, because by standard shell behavior even if you say

-include *.P

and no files match the pattern, a literal "*.P" would be returned (presumably) and make would still be silent. But I just tried the following to pick up a few dependencies from a subdirectory:

-include $(shell find . -name \*.P -print)

and get the warning:

Makefile:282: no file name for `-include'

in the case where no .P files exist yet. IMHO, silent should mean silent but there may be history I don't know about here.

I remember some Unix variant used to behave like this with "rm -f" so you'd have to say something like "rm -f $(FILES) /dev/null" to make sure rm saw at least one file and didn't complain. I believe that was eventually "fixed".


reply via email to

[Prev in Thread] Current Thread [Next in Thread]