help-make
[Top][All Lists]
Advanced

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

Target specific dependencies


From: Iwan Aucamp
Subject: Target specific dependencies
Date: Thu, 02 Sep 2010 21:15:43 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100713 Lightning/1.0b2 Thunderbird/3.1.1

 Hi

I'm using gnu make to build docbook xml documents - to both pdf and html

The chain used for this is

docbookxml -> pre-processing

preprocessed_files -> html -> html_folder -> html.zip
preprocessed_files -> fo -> pdf

For each step dependencies are generated.

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.

This makes the whole process extremely sluggish - I have tried the following to get around this:

   # attempt 1
   target: .DUMMY:=$(eval include target.d.mk)

   ## the above does not work as intended as the eval is triggered
   regardless of target ...

   # attempt 2
   target:
        $(eval include target.d.mk)

   ## this does what is intended but results in following error:
   ## target.d.mk:1: *** prerequisites cannot be defined in command
   scripts.  Stop.

I'm all out of ideas here and have come to the conclusion that the only way to do this is to call make from targets which then includes the appropriate dependencies and builds the real target if necessary.

Am I missing something or is this the only way ?

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.

Regards
Iwan Aucamp


reply via email to

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