help-make
[Top][All Lists]
Advanced

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

Re: Multiple patterns (or Wildcards) in targets?


From: Paul D. Smith
Subject: Re: Multiple patterns (or Wildcards) in targets?
Date: Wed, 8 Aug 2001 10:37:28 -0400

  na> Note that I cannot automatically generate a list of the possible
  na> targets from an "ls", since the files may or may not exist, and
  na> the combinations may be too many...

If you can't calculate a comprehensive list of either the contents of
the prefix pattern or the suffix pattern, you've got problems.

If you _can_ calculate one or the other, then you can use the "include a
makefile and re-exec" trick to automate its behavior.  Suppose you can
calculate all the suffixes that you'll use: write a rule that builds a
makefile containing an implicit rule for each suffix.  Then include that
makefile.  If the makefile doesn't exist, make will build it using your
rule, then re-exec itself to read it in.

You need to have the makefile target you create depend on something that
will change when the list of suffixes change (for example, the main
Makefile or whatever).

-- 
-------------------------------------------------------------------------------
 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



reply via email to

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