[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Brittle -includes
From: |
David Deutsch |
Subject: |
Re: Brittle -includes |
Date: |
Mon, 21 Oct 2019 07:51:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
Hi Paul,
On 10/21/19 7:29 AM, Paul Smith wrote:
> I can only assume that the rules in question are pattern rules. If
> they were explicit rules then make would indeed give you a more clear
> declaration of which file is missing.
Actually, I'm quite sure that they are explicit rules. I will try to put
together a simple example to recreate the issue.
> Unfortunately I didn't really understand the process you're using. Why
> do you need to write hundreds or thousands of makefiles?
I think the process I'm using is best understood by its requirement:
Pattern rules with multiple, named %'s. I call them blueprints and they
produce makefiles that give you the set of targets and recipes to create
complex prerequisites.
Think: A document will incorporate and thus depends on multiple versions
of the same source image with different aspect ratios. Those are
referenced as public/image/filename-[width]-[height].jpg (matching
src/filename.jpg and using [width] and [height] in their recipe) and
that path in turn matches against a blueprint to produce such a file.
Those rules, however, are very regular and it feels not that far removed
from pattern rules.
A fake syntax that is more make-like might look like this:
public/image/%filename%-%width%-%height%.jpg: src/%filename%.jpg
mybin/magicaspectratio $< $(width) $(height) > $@
There is of course some overlap with regular variables - those "recipe
variables" are scoped only to the recipe. Maybe it'd make more sense to
have a syntax like $*(name) to match with the automatic $* stem variable.
Did that clarify my process?
best regards,
David