help-make
[Top][All Lists]
Advanced

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

Re: iteration thru makefile reloading


From: Ken Smith
Subject: Re: iteration thru makefile reloading
Date: Mon, 25 Dec 2006 12:16:19 -0800

On 12/25/06, Kevin Route <address@hidden> wrote:
I am trying to create a makefile that will auto-discover dependencies by
using what I call "iteration thru makefile reloading" (no recursive make).

I played with your makefile for a bit and, after watching it do what I
think its trying to do, I'm puzzled as to why you choose this
approach?  During my investigation, I came up with this
reimplementation that superficially does something like your original.

zero-through-five := 0 1 2 3 4 5
one-through-six := 1 2 3 4 5 6

.PHONY: all
all:

$(foreach i,$(one-through-six), \
 $(eval c$(word $(i),$(zero-through-five)): ; echo $(i) > $$@) \
 $(eval all: p$(word $(i),$(zero-through-five))) \
)

p%: c% ; echo "x += `cat $<`" > $@

.PHONY: clean
clean: ; rm -f p* c*

One thing I notice right away with yours is that you're relying on GNU
make's reparsing of the makefile when include files it can build are
changed.  You mention consciously avoiding recursive make so I
conclude you are possibly interested in the performance of your build.
Causing make to reinvoke itself as a means of iteration is not going
to scale well.

Can you explain more concretely what you are trying to accomplish and
why you think this is the best approach?

 Ken Smith




reply via email to

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