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 07:19:16 -0500

Paul,
  My message sounded a little harsh,  It wasn't meant that way.  You
have been a very big help.

I got it to work.  Here is my test case:

include gmsl

#REFRESH+ldb+env+pub := dogs cats pigs sheep
REFRESH+ldb+dogs+pub := dogs cats pigs sheep

define refresh_proj_bb_sub
$(1)+$(2)+$(3)+$(4) :
        @echo "refresh_proj_bb_sub   $(1)+$(2)+$(3)+$(4)"
endef

# rule refresh+<proj>+<bb>+<pub,shr,extra> :
$(foreach flow,refresh, \
  $(foreach sub,pub, \
    $(foreach proj,ldb,\
      $(foreach bb,env dogs,\
        $(if $(findstring file,$(origin $(call merge,+,$(call
uc,$(flow)) $(proj) $(bb) $(sub)))),\
          $(warning $(call
refresh_proj_bb_sub,$(flow),$(proj),$(bb),$(sub))))))))

.PHONY: all

all :
        @echo "all"

> -----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]