help-make
[Top][All Lists]
Advanced

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

Re: a few basic doubts


From: Paul Smith
Subject: Re: a few basic doubts
Date: Wed, 30 Sep 2009 08:44:13 -0400

On Tue, 2009-09-29 at 23:04 -0700, Payal wrote:

> 1) $ cat Makefile 
> My doubt it why did it print "hi" the last time too. I expected,
> make: `d.tar' is up to date.

Sam answered this one.

> 2) What is the difference in wildcard "%" & "*"?

Not sure what you mean: in the $(wildcard ...) function?  "%" has no
special meaning to $(wildcard ...).  That function uses the standard
UNIX glob expressions (see "man 7 glob" for example).

> 3) How do I define a variable whose value are files abc, "cde xyz" & lmn?

I assume you're really asking here, how to handle filenames containing
whitespace in make.  The short answer is, you cannot do this reliably.

The longer answer is that there are a few limited things you can do that
will allow some uses of filenames with whitespace.

> 4) How do I define a variable-name with a space in between like 'my
> tar'?  (I understand tht it is a bad habit to do so.

Sam answered this, almost:

        empty :=
        space := $(empty) $(empty)
        my$(space)tar := my tar

But this is a terrible idea.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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