Automating the build process and RETURN 0 from batch files
Question
It seems that no matter what the actual result is from a build step
that occurs in ABLD, the return value is '0'. In other words, it
appears to return success even if the build breaks based on some
compile or link problem.
Answer
We ran across the same problem and solved it by scanning the output of
the ABLD command in a perl script. Run_abld.pl:
#!/usr/bin/perl
$cmd="abld.bat " . join(" ", @ARGV);
open(RES, "$cmd 2>&1 |");
$error=0;
while(<RES>) {
print $_;
$error=1 if (/fatal error/i);
$error=1 if (/^make.*Error/);
}
close(RES);
exit $error;
And when doing the build, instead of running 'ABLD XXX' you
'run perl run_abld.pl XXX'