[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Static Pattern Rules
From: |
Paul D. Smith |
Subject: |
Re: Static Pattern Rules |
Date: |
Mon, 11 Feb 2002 18:22:42 -0500 |
%% Thibaut Bultiaux <address@hidden> writes:
tb> targets ...: target-pattern: dep-patterns ...
tb> commands
tb> I am facing to the following problem. I would like to build the
tb> dep-patterns part with a script taking as argument the stem.
tb> $(target): %: $(shell ./script %)
tb> @echo "Run all the target : $^"
tb> This is not working because the stem (%) is resolved AFTER to have
tb> launched the script.
Yes, exactly. Just like with pattern rules.
tb> Is there a way to avoid that ?
No. This is how variable expansion is defined (functions are just a
special case of variables).
All you can do is use either a submake, or included makefile where you
have a rule that constructs the makefile. In the latter case, if the
makefile to be included either doesn't exist or is out-of-date then make
will re-build it then re-exec itself.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist