[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: $(shell) strips CRLF
From: |
Paul D. Smith |
Subject: |
RE: $(shell) strips CRLF |
Date: |
Fri, 26 Apr 2002 14:19:44 -0400 |
%% "Bryan Miller" <address@hidden> writes:
bm> I am successfully using CONFIG_SPEC so I don't know how you can
bm> say that I cannot _USE_ it for anything. I AM using it and it
bm> works wonderfully (sheesh I hate yelling). The only caveat is
bm> that when this embedded binary runs and is asked for debugging
bm> information the config spec comes out in one non-delimited (hence
bm> unreadable) line.
This is not what I said at all.
I said you cannot use a make variable with embedded newlines for
anything.
Since, as you say, you can't figure out how to create one there is no
way that you can be using it now and having it work wonderfully.
bm> In a nutshell CONFIG_SPEC is added to a list of DEFINES for the
bm> compilation of one file that contains something like:
bm> const char *c_spec = CONFIG_SPEC;
This is not a make variable, this is a C variable (or #define).
How is this file created?
It's created by some make rule.
How does the make rule work?
It works by writing the contents of a make variable to the file.
What I'm saying is that this rule that writes the contents of the make
variable to the file cannot work if the variable contained newlines.
bm> Obviously I would strip the newlines out of $(CONFIG_SPEC) once I
bm> have captured it and replaced them with some other character for a
bm> delimiter so that the config spec could be sprintf'd out. The
bm> issue is that since the newlines are already gone I cannot replace
bm> them with anything. char(20) is not a terribly useful delimiter
bm> at this point.
Aha!!
First, how do you think you will replace a newline with some other
character in a make variable using make operations? ;) [*]
So, you don't _really_ want a make variable that contains newlines at
all. What you want is a make variable that contains the config spec
with the newlines replaced with some other delimiter character so you
can write it out.
Well, that's not hard, just do it in the $(shell ...) instead, so that
the results of the shell command is the proper output with the
appropriate characters already replaced.
-----
[*] Actually I think this might be possible, but it's very tricky.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
- $(shell) strips CRLF, Bryan Miller, 2002/04/25
- Re: $(shell) strips CRLF, Eli Zaretskii, 2002/04/26
- RE: $(shell) strips CRLF, Bryan Miller, 2002/04/26
- RE: $(shell) strips CRLF, Paul D. Smith, 2002/04/26
- RE: $(shell) strips CRLF, Bryan Miller, 2002/04/26
- RE: $(shell) strips CRLF,
Paul D. Smith <=
- RE: $(shell) strips CRLF, Bryan Miller, 2002/04/26
- RE: $(shell) strips CRLF, Paul D. Smith, 2002/04/26
- RE: Exiting make upon error..., Bryan Miller, 2002/04/27
- Re: $(shell) strips CRLF, Eli Zaretskii, 2002/04/28