help-make
[Top][All Lists]
Advanced

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

Re: Has anyone ever tried this technique for creating target parent dire


From: Bryan Ischo
Subject: Re: Has anyone ever tried this technique for creating target parent directories?
Date: Sat, 19 Nov 2011 22:52:13 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111108 Thunderbird/8.0

On 11/19/11 22:43, Bryan Ischo wrote:

I have seen alot of suggestions for how to handle directory creation for targets, but never the one that I have come up with. Has anyone done this previously?


Also - I am far from a make expert. Is there anything suboptimal or ugly about my solution that could be made tidier?

OK well I just found a page that lists a similar solution:

http://www.cmcrossroads.com/ask-mr-make/6936-making-directories-in-gnu-make

Solution 3: ("*use a directory 'marker' file*") seems to be very close to what I am proposing. In fact it is identical except for the fact that it doesn't use a pattern rule (the target is specific to an output directory), and it also touches the "marker" file rather than never creating it as I do.

Another solution, solution 5 ("*use pattern rules, second expansion and a marker file") is close as well, but it looks to me like an unnecessarily complicated way to use pattern rules. Instead of using SECONDEXPANSION to allow the directory name of the target to be computed (i.e. $$(@D)/.f), I just repeat the target pattern and add "/../.dir" to the end, e.g. "%/../.dir".*
**
*Is there a good reason to use SECONDEXPANSION as this person suggests in solution 5, instead of the simpler pattern-based prerequisite mechanism that I am using?*
**
*Also is there really a good reason to actually touch the marker file instead of just never bothering to create it?*
**
*Thanks!*
*Bryan*

**

*
*


reply via email to

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