[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Targets directory name concatenation strangeness
From: |
Benjamin Cama |
Subject: |
Targets directory name concatenation strangeness |
Date: |
Thu, 03 Aug 2017 17:37:11 +0200 |
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
- Re: Target-specific variable in subdirectory problem, (continued)
Re: Target-specific variable in subdirectory problem, Paul Smith, 2017/08/02
Re: Target-specific variable in subdirectory problem, Benjamin Cama, 2017/08/03
Message not availableRe: Target-specific variable in subdirectory problem, Benjamin Cama, 2017/08/03
Targets directory name concatenation strangeness,
Benjamin Cama <=
RE: Targets directory name concatenation strangeness, Martin Dorey, 2017/08/03
Re: Targets directory name concatenation strangeness, Benjamin Cama, 2017/08/03
Re: Targets directory name concatenation strangeness, Kyle Rose, 2017/08/03
Fwd: Re: Target-specific variable in subdirectory problem, Sven C. Dack, 2017/08/03