[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: generating helpful message when an invalid target specified
From: |
Philip Guenther |
Subject: |
Re: generating helpful message when an invalid target specified |
Date: |
Sun, 19 Aug 2012 12:33:24 -0700 |
On Sat, Aug 18, 2012 at 11:31 AM, Rakesh Sharma <address@hidden> wrote:
> I am a new user of Make & my question is whether is it possible to generate a
> help sort of a message,
> or maybe, have a help target in the makefile, then when an invalid target is
> specified, make should
> just run the "make help" target.
I don't know what you mean by "invalid target", but the .DEFAULT
target might be a step towards what you want. To quote the info
pages:
`.DEFAULT'
The recipe specified for `.DEFAULT' is used for any target for
which no rules are found (either explicit rules or implicit rules).
*Note Last Resort::. If a `.DEFAULT' recipe is specified, every
file mentioned as a prerequisite, but not as a target in a rule,
will have that recipe executed on its behalf. *Note Implicit Rule
Search Algorithm: Implicit Rule Search.
The downside is that you'll need to list all valid prerequisites as
targets somewhere.
Philip Guenther