[Top][All Lists]

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

Re: Wording in GNU Make manual regarding phony targets

From: Johan Bezem
Subject: Re: Wording in GNU Make manual regarding phony targets
Date: Thu, 22 Dec 2005 07:14:32 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

Hi Dave,

Dave Hylands wrote:
... I need to execute my recursive make.
I have declared my subdirectory names to be .PHONY targets, so
they get executed as soon as they are given as targets. But I want them executed on targets like 'all' or 'clean'....

Ahhh. I understand now.

The only disadvantage I see is that all targets that depend on FORCE
are now executed recursively (which isn't necessarily wrong).

Intentionally. Besides 'all' and 'clean' I have targets for doing a
full run of PC Lint (or flexelint for that matter), QA-C, PolySpace
and some more self-written statistical tools. And, since for all of them
I need depth-first execution, both in make 3.80 and 3.79.1, this has been
my preferred solution for some time now.
And to make the situation even more flexible (or complex, depending on
viewpoint), I collect both the directories to traverse as well as the
files to process dynamically using $(wildcard and some exclusion options.

I haven't seen it done that way before. I've been using the trailing
'/' convention that the 2.6 linux kernel uses to specify directories
and having a clean-dirs target descends and performs the clean

If I understand correctly, you'd have to specify the recursion for each
target where you need it manually, and should the recursion set change,
you'd have to change in several places, which has never been an attractive
proposition in my situation, since it appears to happen occasionaly when
you have multiple projects using the same make structure.
And in some cases, the directories have to be traversed in a special order
(e.g. if you have your CORBA-IDL files collected in a subdirectory, you'll
need the generated *.h files for inclusion in other subdirectories' files),
which may not be important for a 'clean' operation, but it will be for a
normal compiler run. I wouldn't want to specify that several times in different places.


JB Enterprises - Johan Bezem         Tel:   +49 172 5463210
Software Architect - Project Manager Fax:   +49 172 50 5463210
Realtime / Embedded Consultant       Email: address@hidden
Design - Development - Test - QA     Web:

reply via email to

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