[klibc] [PATCH] klcc: Remove the need for bash

Olliver Schinagl oliver at schinagl.nl
Wed Sep 9 02:02:33 PDT 2020

Hey Greg,

On 08-09-2020 22:07, Thorsten Glaser wrote:
> Greg Thelen dixit:
>> This doesn't work with older versions of make.  make 4.2.1 seems common
>> now and does not support $(shell command).
>> $ cat Makefile
>> $(info take1: $(shell command -v ls))
>> $(info take2: $(shell bash -c 'type -p ls'))
>> all:
>>         @true
>> $ make-3.81/make
>> make: command: Command not found
> Eh, what?

well command can be either a shell built-in or an external program, 
right? but both are posix required [0]?

So that's a bit odd, also, wouldn't shell sh do a double shell? Shell 
inseption? I'm not super familiar with make though, especially ancient 
ones :p

[0] https://www.unix.com/man-page/posix/1p/command

> … checks with gmake 3.81… indeed.
> But no, this isn’t correct. You just do this instead:
> $(info take1: $(shell sh -c 'command -v ls'))
> This works and avoids GNU bash just the same. (I ran this
> on a system with no GNU bash installed.)
> bye,
> //mirabilos, shell maintainer/developer

More information about the klibc mailing list