[gccsdk] make: File '-c' not found

Ron beeb at woosh.co.nz
Sat Jan 31 13:49:01 PST 2015

In message <op.xtbugtqyizronj at bluey>
          WPB <wpb.feed at gmx.com> wrote:

> On Sat, 31 Jan 2015 06:51:55 -0000, Ron <beeb at woosh.co.nz> wrote:
> > In message <cb70628e54.beeb at ron1954.woosh.co.nz>
> >           Ron <beeb at woosh.co.nz> wrote:
> >
> >
> >> I'm pretty sure the -c  thing is because your Makefile SHELL variable
> >> is resolving to something that doesn't understand the -c switch.
> >> I think the default for /bin/bash is just the RISC OS CLI unless you
> >> add a ported shell and adjust the path accordingly.
> >>
> >> You could try the existing port of bash, or email me for a copy of the
> >> slimmer dash, which I found (recently) to work well with make.
> >>
> >> If you are using a Linux style Makefile there may be other commands you
> >> find missing.
> >>
> >
> > From the gnu make manual
> >
> > 'The program used as the shell is taken from the variable SHELL. If this
> > variable is not set in your makefile, the program /bin/sh is used as the
> > shell. The argument(s) passed to the shell are taken from the variable
> > .SHELLFLAGS. The default value of .SHELLFLAGS is -c normally, or -ec in
> > POSIX-conforming mode.'
> >
> > You may see a difference just by using (in the makefile)
> >
> >
> > Ron M.
> Thank you very much for your insights, Ron. I thought you'd nailed it with
> that, but actually setting .SHELLFLAGS seems to make no difference. That
> maybe a bug in make 3.81 (which is the current version on riscos.info), as
> reported here:
> http://lists.gnu.org/archive/html/help-make/2012-10/msg00014.html

OK it hasn't changed anything, but using bash has, so you are probably
right, that variable isn't doing the expected thing.

> I don't really understand how the SHELL variable works for the RISC OS
> port of make. As Ron says, and according to the manual, the default value
> of SHELL is "/bin/sh", which makes no sense on RISC OS. Does the port in
> fact just direct commands at the RISC OS command line unless SHELL is set
> to something else?

I'ts built into the cross-compiler to grab the instances of /bin/sh
so a port will find the CLI.

> I did install the port of bash and added "SHELL = bash" to the Makefile,
> and then it works, but only if I substitute "echo" for "printf" - "printf"
> obviously isn't a bash command.
OK, so the error reported did move from 'cannot find -c'
But check that bash can find printf, maybe try bash in interactive mode.
I have found ported shells dont always find things on the path and have
had to use an explicit path. I found that this can be preferrable, for
example you dont really want to use RISC OS echo in place of a shell
builtin or ported binary of echo.
There are many ways to swing this cat, and it is a matter of getting a
setup that works by trial.

I like the idea of using DASH (and binaries it can find) as it can cope
with more of the makefiles I can bring into RISC OS from linux. I have
found some exceptions (end of line handling for one)

> I'd ideally like to use the RISC OS command line as the shell, not bash,
> but this "-c" issue is flummoxing me.
Using dash might not be the only solution but it stop the occurrences
for me.
There is a possibility that 'cant find -c' is actually referring to a
problem following the '/bin/sh -c'
I have seen this when using ls on it's own and it ignores the CSD.
Once again, there is a variation of interpretation of paths and CSD in
different ports/shells, that sometimes takes some trial and error.
A binary path can be set with the makefile variables if necessary.

> If anyone else can confirm the .SHELLFLAGS issue is peculiar to make 3.81,
> that would be great.
> Many thanks for any help,

More information about the gcc mailing list