help-make
[Top][All Lists]
Advanced

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

Re: A question about Suffix -> no suffix rule


From: Shigio YAMAGUCHI
Subject: Re: A question about Suffix -> no suffix rule
Date: Wed, 2 Mar 2016 08:18:56 +0900

> Well, if you don't need to create the .m4 file from another file you
> can change your pattern rule to be terminal like this:
>
>  %:: %.m4
>          m4 $^ > $@
>
> Alternatively you can run make with the -r flag to get rid of all built
> -in rules, including the "special built-in dummy patterns".

Both methods works well. It's great!

Thank you for the quick answer.
Shigio


2016-03-02 8:01 GMT+09:00 Paul Smith <address@hidden>:

> On Wed, 2016-03-02 at 07:20 +0900, Shigio YAMAGUCHI wrote:
> > This program built for i386-apple-darwin11.3.0
> > $ ls
> > Makefile
> > $ cat Makefile
> > %: %.m4
> >         m4 $^ > $@
> > $ touch test.html.m4
> > $ make test.html
> > m4 test.html.m4 > test.html
> > $ touch test.c.m4
> > $ make test.c
> > make: *** No rule to make target `test.c'.  Stop.
> >
> > Why does the build of test.c fail?
>
> This is because you're using a "match-anything" rule and GNU make has
> special operations for "match-anything" rules.  See:
>
>
> http://www.gnu.org/software/make/manual/html_node/Match_002dAnything-Rules.html
>
> In particular the last 5 or so paragraphs.
>
> > Is there a way to make it succeed?
>
> Well, if you don't need to create the .m4 file from another file you
> can change your pattern rule to be terminal like this:
>
>   %:: %.m4
>           m4 $^ > $@
>
> Alternatively you can run make with the -r flag to get rid of all built
> -in rules, including the "special built-in dummy patterns".
>



-- 
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


reply via email to

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