Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Jul 2005 16:13:31 -0400
From:      Chuck Swiger <cswiger@mac.com>
To:        Michael Dexter <dexter@ambidexter.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: List all make targets?
Message-ID:  <42C9986B.6040901@mac.com>
In-Reply-To: <a0623091ebeef28addc59@[192.168.1.100]>
References:  <a06230909beeec801f4e1@[192.168.1.100]> <42C96953.9020406@mac.com> <a0623091ebeef28addc59@[192.168.1.100]>

next in thread | previous in thread | raw e-mail | index | archive | help
Michael Dexter wrote:
>> Michael Dexter wrote:
>>> Is there a 'make' flag to list all make targets for any given 
>>> directory containing Makefile* ?
>>
>> grep ':' Makefile  ...comes pretty close.
> 
> Another reader suggested I cat the file... I take it the answer is "no."

The answer is "it's probably not useful".

Make uses implied rules for suffix transformations, so for example there is an 
implied target for foo.o which depends on foo.c, which looks something like:

.c.o            :
         ${CC} ${CFLAGS} -c ${.IMPSRC}

These rules represent a few hundred lines worth of build rules which could be 
applied to any file as needed in order to build things without having these 
rules actually specified in the Makefile itself.

> Specifically I am looking for a quick way to see the make targets as 
> 'make' would accept them while hunting for 'uninstall' and other 
> surprises. I see that it gets complicated as i.e. "_legacy" is a 
> legitimate target along with "buildworld." More to investigate!

"make -n -d g1 | less"...?  Take a look at the main target and at the "parents" 
target at the top.

-- 
-Chuck



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42C9986B.6040901>