> 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 <psm...@gnu.org>: > 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 <shi...@gnu.org> PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3 _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make