help-make
[Top][All Lists]
Advanced

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

Re: wildcard character in target


From: Luke Shumaker
Subject: Re: wildcard character in target
Date: Mon, 06 Sep 2010 12:04:09 -0400

On Mon, 2010-09-06 at 10:20 +0430, ali hagigat wrote:
> print: *.c
>       @echo "example"
> 
> Considering the above rule in a makefile, what strings will be
> replaced with *.c in the first phase and the second phase of make
> process?

This is equivalent to
print: $(wildcard *.c)
        @echo "example"

`*.c' will expand to a list of all files ending in `.c' in $(CURDIR).

> How about the following rule?
> *.c : *.o  ;

Both expansions will take place.  Since `*' only matches existing files,
this rule is useful only for updating files, not creating them.  If no
files ending in `.c' currently exist, `*.c' will expand to an empty
string.

~ LukeShu




reply via email to

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