[Top][All Lists]

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

Re: details required on wildcard function

From: bhaskar . g
Subject: Re: details required on wildcard function
Date: Tue, 26 Feb 2002 16:03:57 +0100

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:

address@hidden 331> cat makefile
LISTROOT_FILENAME = /home/bhaskar/test.txt
LIST_OF_FILES   := $(foreach file, $(REQFILES), $(wildcard $(file)))

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

address@hidden 332> echo $_ROOT
address@hidden 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.

address@hidden 334> gmake
/home/bhaskar /usr /tmp
/home/bhaskar /tmp
address@hidden 335>


                    "Paul D.                                                    
                    Smith"                  To:  Bhaskar 
                    <address@hidden           cc:  address@hidden               
                    rg>                     Subject:  Re: details required on 
wildcard function                        
                    Sent by:                                                    
                    help-make-adm           Classification:                     
                    respond to                                                  
                    "Paul D.                                                    

%% 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 <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

Help-make mailing list

reply via email to

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