help-make
[Top][All Lists]
Advanced

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

Re: Target specific dependencies


From: Paul Smith
Subject: Re: Target specific dependencies
Date: Thu, 2 Sep 2010 15:29:37 -0400

On Thu, 2010-09-02 at 21:15 +0200, Iwan Aucamp wrote:
> Now the problem is - one makefile is used to build quite a few
> documents 
> - and dependencies are generated regardless of what targets are being 
> triggered because include is "global" and not linked to a target. So 
> basically when you try to build html.zip the .fo is generated for 
> calculating the dependencies of .pdf - and when an attempt is made to 
> only build a pdf for one document (make foo.pdf) .fo and html is 
> generated for all files.

I recommend you read this:

http://make.mad-scientist.us/autodep.html

and see if you can apply those lessons to your environment.

> If this is the only way - what is the process to request a feature in 
> gnu make ? Should I post to bug-make list ? I think target specific 
> includes will make life allot nicer.

"target specific includes" can never be implemented, at least not
without reimplementing significant portions of the program.  make has a
very strict and bright line between its two main phases of work: reading
makefiles (which is where include files are processed) to create the
dependency graph, and walking the dependency graph (which is where rules
are invoked).

There is simply no way, without the above-referenced costly
reimplementation, to allow make to skip back and forth between those two
phases, where it can read makefiles, start to run through the dependency
graph, then jump back to reading more makefiles and add more stuff to
the dependency graph, then go back to running the dependency graph, etc.


Consider that those makefiles you're including could contain ANYTHING,
not just prerequisite definitions.  They could redefine variables,
create new pattern rules, reset explicit rules, etc.: things that
completely up-end all the state make currently knows.




reply via email to

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