OK, new subject as this specific behavior gets stranger.
Le jeudi 03 août 2017 à 17:27 +0200, Benjamin Cama a écrit :
> Le jeudi 03 août 2017 à 15:06 +0000, Edward Welbourne a écrit :
> > Benjamin Cama (3 August 2017 17:00)
> > > Well, I tried:
> > >
> > > SUBDIR = $(dir $@)
> > > $(SUBDIR)/target-%:
> > > …
> > >
> > > But it doesn't work. But without a slash (which is already present at
> > > the end of $(SUBDIR)), it actually works!:
> > >
> > > SUBDIR = $(dir $@)
> > > $(SUBDIR)target-%:
> > > …
> > >
> > > Is this a bug?
> >
> > No: thing/target-suffix and thing//target-suffix are different names.
> > They may be functionally equivalent, but make just sees different
> > strings, one with a doubled-slash, the other with just one slash.
>
> Well, the thing is that passing target names to make with any number of
> slashes normalize it to one, so I tended to think that the definition
> followed the same normalization. Thanks for the explanation, then.
Still, when I try to concatenate the slashless directory name and the
file name with a slash in between, it does not work!:
SUBDIR = $(@D)
$(SUBDIR)/target-%:
echo $(SUBDIR)
does not work:
$ make foo/target-1234
make: *** No rule to make target 'foo/target-1234'. Arrêt.
Without the slash, it works:
$ make foo/target-1234
echo foo
foo
This looks very strange to me.
--
Benjamin Cama - Tél : 258
_______________________________________________
Bug-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-make