Re: False positive "doesn't match the target pattern" error

2022-08-24 Thread Ingo Schwarze
Hi, Masahiro Yamada wrote in his original bug report: > ./foo.x: %/foo.x: %/foo.z > cp $< $@ This is not make(1) syntax. POSIX does not define "%", nor multiple colons on the same line, and i fail to see right now how any similar problem might occur with POSIX make(1) - of course, i might

Re: False positive "doesn't match the target pattern" error

2022-08-22 Thread Alejandro Colomar
Hi David, Ingo, For others starting to read this thread now, it started here: On 8/22/22 16:46, David A. Wheeler wrote: On Aug 22, 2022, at 12:02 AM, Alejandro Colomar wrote: Hi David, On 8/22/22 04:45, David A. Wheeler w

Re: False positive "doesn't match the target pattern" error

2022-08-22 Thread David A. Wheeler
> On Aug 22, 2022, at 12:02 AM, Alejandro Colomar > wrote: > > Hi David, > > On 8/22/22 04:45, David A. Wheeler wrote: >>> On Aug 20, 2022, at 11:35 AM, Alejandro Colomar >>> wrote: >>> I'd say there is: make(1) treats file names as text strings, not really >>> file names, for most of it

Re: False positive "doesn't match the target pattern" error

2022-08-21 Thread Alejandro Colomar
Hi David, On 8/22/22 04:45, David A. Wheeler wrote: On Aug 20, 2022, at 11:35 AM, Alejandro Colomar wrote: I'd say there is: make(1) treats file names as text strings, not really file names, for most of its operations. As an example, foo/ and foo/. are different targets. I don't see why

Re: False positive "doesn't match the target pattern" error

2022-08-21 Thread David A. Wheeler
> On Aug 20, 2022, at 11:35 AM, Alejandro Colomar > wrote: > I'd say there is: make(1) treats file names as text strings, not really file > names, for most of its operations. As an example, foo/ and foo/. are > different targets. I don't see why ./bar and bar should be the same. > Consi

Re: False positive "doesn't match the target pattern" error

2022-08-21 Thread Alejandro Colomar
Hi Dmitry On 8/21/22 05:52, Dmitry Goncharov wrote: On Sat, Aug 20, 2022 at 8:28 PM Masahiro Yamada wrote: build-dirs := . drivers sound net virt arch/x86/pci arch/x86/power lib arch/x86/lib subdir-modorder := $(addsuffix /.modules.order, $(build-dirs)) $(sort $(subdir-modorder)): %/.modules.o

Re: False positive "doesn't match the target pattern" error

2022-08-20 Thread Dmitry Goncharov
On Sat, Aug 20, 2022 at 8:28 PM Masahiro Yamada wrote: > build-dirs := . drivers sound net virt arch/x86/pci arch/x86/power lib > arch/x86/lib > subdir-modorder := $(addsuffix /.modules.order, $(build-dirs)) > $(sort $(subdir-modorder)): %/.modules.order: % Can you remove . from build-dirs and ad

Re: False positive "doesn't match the target pattern" error

2022-08-20 Thread Masahiro Yamada
On Sun, Aug 21, 2022 at 12:48 AM Dmitry Goncharov wrote: > > On Sat, Aug 20, 2022 at 11:36 AM Alejandro Colomar > wrote: > > Why does make(1) need to special-case a leading ./ ? > > If your makefile has a rule like > foo.x: foo.z; cp $< $@ > then make foo.x and make ./foo.x both produce the same

Re: False positive "doesn't match the target pattern" error

2022-08-20 Thread Masahiro Yamada
On Sun, Aug 21, 2022 at 12:32 AM Dmitry Goncharov wrote: > > On Sat, Aug 20, 2022 at 5:52 AM Masahiro Yamada wrote: > > I appreciate GNU Make normalize the path > > by removing "./" > > > > This is helpful in some cases, but I think it is a bad side-effect > > in this case. > > Is there a reason

Re: False positive "doesn't match the target pattern" error

2022-08-20 Thread Dmitry Goncharov
On Sat, Aug 20, 2022 at 11:36 AM Alejandro Colomar wrote: > Why does make(1) need to special-case a leading ./ ? If your makefile has a rule like foo.x: foo.z; cp $< $@ then make foo.x and make ./foo.x both produce the same file. regards, Dmitry

Re: False positive "doesn't match the target pattern" error

2022-08-20 Thread Alejandro Colomar
Hi Dmitry, On 8/20/22 17:32, Dmitry Goncharov wrote: On Sat, Aug 20, 2022 at 5:52 AM Masahiro Yamada wrote: I appreciate GNU Make normalize the path by removing "./" This is helpful in some cases, but I think it is a bad side-effect in this case. Is there a reason to treat './foo.x' as diff

Re: False positive "doesn't match the target pattern" error

2022-08-20 Thread Dmitry Goncharov
On Sat, Aug 20, 2022 at 5:52 AM Masahiro Yamada wrote: > I appreciate GNU Make normalize the path > by removing "./" > > This is helpful in some cases, but I think it is a bad side-effect > in this case. Is there a reason to treat './foo.x' as different from 'foo.x'? > If this is a bug, I can f

False positive "doesn't match the target pattern" error

2022-08-20 Thread Masahiro Yamada
Hi. [Sample Makefile] ./foo.x: %/foo.x: %/foo.z cp $< $@ ./foo.z: touch $@ [Test result] $ make Makefile:2: target 'foo.x' doesn't match the target pattern cp foo.x cp: missing destination file operand after 'foo.x' Try 'cp --help' for more information. make: *** [Makefile:3