make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: $(shell) strips CRLF


From: Bryan Miller
Subject: RE: $(shell) strips CRLF
Date: Fri, 26 Apr 2002 10:14:05 -0700

Paul,

It's not your fault.  You are perfectly clear.  It is I who has the speech
impediment.

I am successfully using CONFIG_SPEC so I don't know how you can say that I 
cannot
_USE_ it for anything.  I AM using it and it works wonderfully (sheesh I hate
yelling).  The only caveat is that when this embedded binary runs and is asked
for debugging information the config spec comes out in one non-delimited (hence
unreadable) line.

In a nutshell CONFIG_SPEC is added to a list of DEFINES for the compilation of
one file that contains something like:

const char *c_spec = CONFIG_SPEC;

Obviously I would strip the newlines out of $(CONFIG_SPEC) once I have captured
it and replaced them with some other character for a delimiter so that the 
config
spec could be sprintf'd out.  The issue is that since the newlines are already
gone I cannot replace them with anything.  char(20) is not a terribly useful
delimiter at this point.

In summary, I am using $(CONFIG_SPEC) and it works quite well.  It would be
perfect if I could replace the newlines with another delimiter before they were
replaced with spaces.  Since I cannot I will probaby use Perl to create a
debug_info.h header file instantiated with all the proper data.

ttfn,
Bryan

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf Of
> Paul D. Smith
> Sent: Friday, April 26, 2002 9:15 AM
> To: address@hidden
> Cc: address@hidden
> Subject: RE: $(shell) strips CRLF
>
>
> %% "Bryan Miller" <address@hidden> writes:
>
>   bm> I have read the documentation and noted the entry
> regarding s/\n/
>   bm> /g.  The GNU Make manual is the most dogeared reference
> on my desk
>   bm> outside of Johan's Perl Pocket Reference.  I guess my question
>   bm> could have been more carefully worded.  Is there a
> similar way to
>   bm> grab something from an OS call and not strip the new line
>   bm> characters?  Paul says "no" so I will look for a
> solution outside
>   bm> of make.
>
> I think I'm not making myself clear :).
>
> It doesn't matter whether there's a way to grab something from the OS
> and put it into a make variable without stripping the newlines.
>
> Why not?
>
> Because even if you _have_ a variable with contents that contains
> newlines, you can't _USE_ it for anything.  You can prove that to
> yourself by making an internal variable with newlines using
> define, and
> then trying to use it:
>
>   define CONFIG_SPEC
>   element * CHECKEDOUT
>   element * /main/LATEST
>   enddef
>
> Now this variable $(CONFIG_SPEC) contains a real newline character.
>
> So, that's why we're asking what you're trying to use the value for;
> that is where you have to redesign your approach, not where you try to
> read the value in.
>
> Have fun!
>
>
> -----
> [1] Actually, I can think of _one_ legal thing you could do
> with it, but
>     it's not what you want to do :).
>
> --
> --------------------------------------------------------------
> -----------------
>  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

_______________________________________________
Make-w32 mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/make-w32




reply via email to

[Prev in Thread] Current Thread [Next in Thread]