help-make
[Top][All Lists]
Advanced

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

Re: .for f in ${FOO} support?


From: Paul D. Smith
Subject: Re: .for f in ${FOO} support?
Date: Fri, 20 Sep 2002 00:01:01 -0400

%% address@hidden writes:

  m> I'm not sure I understand what the 'auto-re-exec' feature is.  I've
  m> scanned over the manual and nothing is jumping out at me.  Can you
  m> elaborate a little?

GNU make will try to rebuild all makefiles it reads, both normal
"Makefile" etc., as well as any included makefiles.  If it can rebuild
one or more of them, it will do so then re-exec itself to re-read them.

So, if you have dynamic make rules which can't be expressed as normal
pattern or static pattern rules, then you can write a rule whose target
is a makefile and whose command script generates it to contain whatever
you need (typically explicit rules).

Then, you include it and Bob's your uncle.

So...

    dynamic.mk: Makefile
            rm -f $@
            @for f in $(FILES); do \
                .... >> $@; \
             done

    include dynamic.mk

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "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]