help-make
[Top][All Lists]
Advanced

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

RE: Check for the existance of variable.


From: PATTON, BILLY \(SBCSI\)
Subject: RE: Check for the existance of variable.
Date: Tue, 11 Apr 2006 06:49:53 -0500

Paul,  my reply seemed a little harsh after reading it.  I did not mean
to sound that way. You have been VERY helpful.  Just getting it through
my thick head about the separation of make and shell and expansion.


> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On Behalf 
> Of PATTON, BILLY (SBCSI)
> Sent: Tuesday, April 11, 2006 6:47 AM
> To: address@hidden
> Subject: Check for the existance of variable.
> 
> 
> Ok Paul,
>  commands are shell syntax and make file is for make syntax.  I cannot
> check for the existence
> of a make variable in the commands of a rule.  So with that 
> said I must
> check for the existence
> of the variable before I create the rule.
> 
> Here's what I have:
> $(foreach flow,refresh real_refresh, \
>         $(foreach sub,pub shr extra, \
>                 $(foreach proj,$(PROJECTS),\
>                         $(foreach bb,$(BB+$(proj)),\
>                                 $(eval $(call
> refresh_proj_bb_sub,$(flow),$(proj),$(bb),$(sub)))))))
> 
> The variable I need : proj has 7 values, bb may have 1 to 80 names,
> depends on proj
> REFRESH+proj+bb+pub
>   
> Steps I would need to create this
> 1. create the string
>    $(call merge,+,$(call uc,$(flow)) $(proj) $(bb) $(sub))
> 2. find the origin of the string
>    $(origin $(call merge,+,$(call uc,$(flow)) $(proj) $(bb) $(sub))
> 3. find the string "file"
>    $(findstring file,$(origin $(call merge,+,$(call 
> uc,$(flow)) $(proj)
> $(bb) $(sub))
> 4 do if then
>    $(if $(findstring file,$(origin $(call merge,+,$(call uc,$(flow))
> $(proj) $(bb) $(sub))
>    then do the eval.
> 
> So I believe I would need something like
> $(foreach flow,refresh real_refresh, \
>         $(foreach sub,pub shr extra, \
>                 $(foreach proj,$(PROJECTS),\
>                         $(foreach bb,$(BB+$(proj)),\
>                               $(if $(findstring file,$(origin $(call
> $(merge +,$(call uc,$(flow)) $(proj) $(bb) $(sub)))))
>                                   ,$(eval $(call
> refresh_proj_bb_sub,$(flow),$(proj),$(bb),$(sub))))))
> missing lots of  ) parens :)
> 
> 
> I'll be testing this, but if you see anything wrong with my 
> logic please
> tell me :)
> 
> 
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make
> 




reply via email to

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