help-make
[Top][All Lists]
Advanced

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

% does not match / in pattern rules?


From: Pan ruochen
Subject: % does not match / in pattern rules?
Date: Wed, 13 Aug 2008 15:57:24 +0800

Hi All,

$cat Makefile
mkdir-%:
    @mkdir -p $*
$make mkdir-dir1/dir2
Make: *** No rule to make target `mkdir-dir1/dir2'.  Stop.

It seems % does not match / in pattern rules. But the GNU Make doc says:
|-------------------------------------------------------------------------------------------|
|  10.5 Defining and Redefining Pattern Rules
                     |
|
                     |
|  You define an implicit rule by writing a pattern rule. A pattern
rule looks like         |
|  an ordinary rule, except that its target contains the character `%'
                     |
|  (exactly one of them). The target is considered a pattern for
matching file names;       |
|  the `%' can match any nonempty substring, while other characters
match only themselves.  |
|  The prerequisites likewise use `%' to show how their names relate
to the target name.    |
|-------------------------------------------------------------------------------------------|
So, what's wrong?

Best Regards,
PRC
Apr 13, 2008




reply via email to

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