UPDATE: solved , the problem was so obvious system("cd ... ; make this; cd ..."); should be spitted as Corion stated. Thank you all for comments

Hi

Recently I have been developing some stuff in c and to compile the code i am using classic makefile approach. But my code kept getting bigger and bigger and more complicated. So i realized that i need to make a shell script to orchestrate the entire make procedure. Since all linux platforms (and unix) support basic perl I decided to build my sources using a simple perl script (How smart is that ?? - not a rhetorical question). and every time i need to execute make i use regular system command

system("cd ... ; make this; cd ...");
UPDATE: cd ... are used to move through directories since each build directory contains different make file and is build according to different make rules

END UPDATE

now if i run into errors i would like to know when they happened at make runtime, that is why system is a good option for me. But on the other hand, if any errors do occur, then my perl script since it has no info about that err, just continues further on s, which is bad.

My question is how to bypass this problem and capture the error or just the status that the error occurred? (Limits: if i use qx then i do not get the runtime compilation reports which is bad) I tried redirecting the error to a file and the reading it after each make but then my errors are clustered together in one place, which, againi is bad.

any suggestions ?

Thank you

baxy


In reply to [SOLVED] Capture the make status by baxy77bax

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.