Makefile trying to use eval Example from manual
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Makefile trying to use eval Example from manual




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Makefile trying to use eval Example from manual  
billy


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-16-06 01:48 AM

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






[ Post a follow-up to this message ]



    Re: Makefile trying to use eval Example from manual  
Bjorn Reese


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-16-06 10: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





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:30 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register