help-make
[Top][All Lists]
Advanced

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

Re: Automatic variables


From: Jeffrey Ratcliffe
Subject: Re: Automatic variables
Date: Thu, 8 May 2008 15:24:27 +0200

2008/5/6 Tom Tromey <address@hidden>:
> >>>>> "Jeffrey" == Jeffrey Ratcliffe <address@hidden> writes:
>
>  Jeffrey> I have a Makefile with several rules:
>  Jeffrey> dir/1/file_1.bdfi : $(shell deps file_1.bdf) | dir/1
>  Jeffrey>        command file_1.bdf > dir/1/file_1.bdfi
>  [...]
>
>  Jeffrey> Is there a way of reducing these to 1 rule with automatic
>  Jeffrey> variables?
>  Jeffrey> %.bdfi : $(shell deps $(basename $(@F)).bdf) | $(@D)
>  Jeffrey>        command $(basename $(@F)).bdf > $@
>
>  For this kind of thing you need secondary expansion.
>  See the node "Secondary Expansion" in the GNU Make manual.

Thanks for the tip. I tried

.SECONDEXPANSION
%.bdfi : $$(shell deps $$(*F).bdf) | $$(@D)
       command $(*F).bdf > $@

but I get "make: *** No rule to make target" errors, seemingly because
$$(*F).bdf isn't expanded as expected. Is there anyway of getting make
to print the prerequisites for a particular pattern? In the --debug=A
output, the correct pattern is tried, but discarded.

Please CC me on replies, as I am not subscribed.

Regards

Jeff




reply via email to

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