Hash sign in a make file
Colin (478) 2433 posts |
is there a way to echo a # in a make file. I want to do:
The problem is the #sign is seen as a comment. |
Rick Murray (539) 13850 posts |
Not at a computer (and I use Amu because Make annoys me), but have you tried wrapping the string in single quotes? |
Colin (478) 2433 posts |
I always think of amu as make. Yes I’ve tried single quotes. I’ve tried / \ | % # before the # |
Rick Murray (539) 13850 posts |
Okay, I’ve read through the relevant parts of the Desktop Tools guide (actual dead trees, not some crappy PDF, whee! :-) ) and it doesn’t look like Make/AMU supports any form of escaping other than $$ and maybe a double (back?)slash. As it isn’t open source, one can’t rummage to confirm. Nothing I tried works. So, time to not so much think outside the box as to simply deny there is any box… echo <35>include "test.h" { > h.somefile } Notice that the final filename is back to front. This is because the secret to how this works is that the echo line is simply passed on through to the RISC OS shell. So there’s no fudging to make file.ext style names the right way around. You must give it in a form RISC OS understands. Your trace window, as you run Amu, will happily quote that line verbatim. You’re welcome. |
Colin (478) 2433 posts |
Worked a treat. Unfortunately the redirection has CRLF line endings and the compiler throws warnings which I don’t want. |
Rick Murray (539) 13850 posts |
When I’ve wanted to dynamically make something like that, I wrote a little BASIC program, and just had the MakeFile run it… |
Dave Higton (1515) 3534 posts |
It’s worse than that – the endings are LFCR. |