Hi Paul,

I find this peculiar thing happening in gmake. As per your mail the env variable 
should not expanded. But what happens here is
the following:

bhaskar@hpas10 331> cat makefile
LISTROOT_FILENAME = /home/bhaskar/test.txt
REQFILE_LST := $(shell cat $(LISTROOT_FILENAME))
REQFILES := $(strip $(REQFILE_LST))
LIST_OF_FILES   := $(foreach file, $(REQFILES), $(wildcard $(file)))

default:
        @echo $(LISTROOT_FILENAME)
        @echo $(REQFILES)
        @echo $(LIST_OF_FILES)

bhaskar@hpas10 332> echo $_ROOT
/usr
bhaskar@hpas10 333> cat test.txt
/home/bhaskar $_ROOT /tmp

You can see the output of the REQFILES has been expanded to /usr. The list REQFILES 
contains /usr init but this
is not transferred onto the wildcard function. I am wondering if the list has the 
expanded list in it should not matter.

Please correct if I am wrong here.

bhaskar@hpas10 334> gmake
/home/bhaskar/test.txt
/home/bhaskar /usr /tmp
/home/bhaskar /tmp
bhaskar@hpas10 335>

regards
bhaskar



                                                                                       
                                
                    "Paul D.                                                           
                                
                    Smith"                  To:  Bhaskar G/BTC/SC/PHILIPS@EMEA2        
                                
                    <[EMAIL PROTECTED]           cc:  [EMAIL PROTECTED]                     
                                
                    rg>                     Subject:  Re: details required on wildcard 
function                        
                    Sent by:                                                           
                                
                    help-make-adm           Classification:                            
                                
                    [EMAIL PROTECTED]                                                         
                                
                                                                                       
                                
                                                                                       
                                
                    25-02-2002                                                         
                                
                    18:52                                                              
                                
                    Please                                                             
                                
                    respond to                                                         
                                
                    "Paul D.                                                           
                                
                    Smith"                                                             
                                
                                                                                       
                                
                                                                                       
                                




%% Regarding details required on wildcard function; you wrote:

  bg> I am trying to get a list of files required, from a file which
  bg> contains the root location of the required files. The contents of
  bg> file can be any thing

  bg> 1. absolute location
  bg> 2. An env variable pointing to the absolute location.

  bg> When I try to use wildcard function, wildcard gives only the files
  bg> present in the root location whose absolute location is given, but
  bg> doesnot list the files at root location obtained from the
  bg> environment variable.

Definitely.  And why should it?

The wildcard function is a builtin function in GNU make (using the GNU C
runtime globbing functions directly).  Make does not invoke a shell or
anything to handle wildcarding.

So, the shell does not expand your environment variables; instead if you
had a filename like $ROOT/foodir make looks for path with the literal
string '$ROOT/foodir', not whatever $ROOT expands to.

--
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make





_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to