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

WPB wpb.feed at gmx.com
Sat Jan 31 05:52:04 PST 2015

On Sat, 31 Jan 2015 13:11:00 -0000, Duncan Moore <duncan.moore at gmx.com>  

> On 30/01/2015 14:13, WPB wrote:
>> With this very simple test case of a Makefile:
>>     dir :
>> 	printf "Making dir...\n"
>> 	mkdir OBJECTS
> You need the executable file 'printf' in your run path - check that it  
> is.
> The trouble then is with the \n. I could get it to work by just removing  
> \n.
> You don't then get a carriage return of course.
> But this does work (note, single quotes, two slashes):
> printf 'Making dir...\\n'
> I'm not sure if variable substitution will work with that - I haven't  
> tried.
> If you try 'echo', beware of picking up the RISC OS Echo instead.
> As to why \n is causing problems, I'm not sure. It looks like some weird  
> interaction between 'make' and 'printf'.
> Duncan

Thanks Duncan,

Actually printf is on the run path already. And from the command line, the  
printf command works just fine. The error "File '-c' not found" only  
occurs when the command is executed my make.

Thanks for the pointers on '\n' - I was wondering why escaping things  
doesn't work as expected. I don't think it's make's fault. From the  
command line, too, printf commands seem to ignore '\n', and just take out  
the '\'.

I find it hard to believe that this error doesn't come up all the time.  
There must be umpteen makefiles for GCC on RISC OS that use echo or  
printf, and on my setup at least, they all bomb out with the error message  
that is the subject of this thread.


More information about the gcc mailing list