tech-toolchain archive

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

Re: bmake: :sh vs :!cmd!



In article <20190331183843.GA1965%netbsd.org@localhost>,
David Holland  <dholland-tech%netbsd.org@localhost> wrote:
>On Sun, Mar 31, 2019 at 07:46:08PM +0200, Edgar Fu? wrote:
> > On the occasion of a discussion of != vs. :sh on tech-pkg/pkgsrc-users, 
> > I remembered I long wanted to ask why bmake has both :sh and :!cmd!, 
> > i.e., what the difference or intended usage is.
>
>:sh works as follows:
>
>   CMD=ls *.c
>   build:
>           $(CC) -c $(CMD:sh)
>
>and :! like this:
>
>   build:
>           $(CC) -c $(WHATEVER:!ls *.c!)
>
>Since the latter ignores the value of $(WHATEVER) it's kinda gross (it
>is not the only such "modifier" though) but it avoids needing a
>different syntax for command substitutions.

I added :sh for compatibility. It is the same reason we support include
and .include etc.

christos



Home | Main Index | Thread Index | Old Index