|The stupid question is the question not asked|
[SOLVED] Capture the make statusby baxy77bax (Chaplain)
|on Aug 26, 2013 at 11:53 UTC||Need Help??|
baxy77bax has asked for the
wisdom of the Perl Monks concerning the following question:
UPDATE: solved , the problem was so obvious system("cd ... ; make this; cd ..."); should be spitted as Corion stated. Thank you all for comments
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
UPDATE: cd ... are used to move through directories since each build directory contains different make file and is build according to different make rules
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 ?