Unix Programming - Makefile trying to use eval Example from manual

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > March 2006 > Makefile trying to use eval Example from manual





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Makefile trying to use eval Example from manual
billy

2006-03-15, 8:48 pm

Tonight on my mac osx10.4 make version 3.79
I trying a small example from the pages of the make manual, slightly
altered.

PROJ := a b c d e f g

..PHONY : all ${PROJ}

define A_template
$(1) : ; echo $@
endef

all : ${PROJ}

$(foreach proj,${PROJ},$(eval $(call A_template,${proj})))


All I get is
make : Nothing to be done for `all'

Is this something that will only work on 3.8 + ?

Bjorn Reese

2006-03-16, 5:53 pm

billy wrote:

> PROJ := a b c d e f g
>
> .PHONY : all ${PROJ}
>
> define A_template
> $(1) : ; echo $@
> endef
>
> all : ${PROJ}
>
> $(foreach proj,${PROJ},$(eval $(call A_template,${proj})))


Could you please explain what you are trying to do?

My guess from the above is that you are trying to generate a rule for
each word in ${PROJ}. If so, then it may be much simpler to do as
follows:

all : ${PROJ}

${PROJ} :
@echo $@

--
mail1dotstofanetdotdk
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com