contrib/buildsystems: optionally capture the dry-run in a file
Add an option for capturing the output of the make dry-run used in determining the msvc-build structure for easy debugging. You can use the output of `--make-out <path>` in subsequent runs via the `--in <path>` option. Signed-off-by: Philip Oakley <philipoakley@iee.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
03aa7118c3
commit
a530a59a6f
@ -32,6 +32,7 @@ generate usage:
|
|||||||
-g <GENERATOR> --gen <GENERATOR> Specify the buildsystem generator (default: $gen)
|
-g <GENERATOR> --gen <GENERATOR> Specify the buildsystem generator (default: $gen)
|
||||||
Available: $genlist
|
Available: $genlist
|
||||||
-o <PATH> --out <PATH> Specify output directory generation (default: .)
|
-o <PATH> --out <PATH> Specify output directory generation (default: .)
|
||||||
|
--make-out <PATH> Write the output of GNU Make into a file
|
||||||
-i <FILE> --in <FILE> Specify input file, instead of running GNU Make
|
-i <FILE> --in <FILE> Specify input file, instead of running GNU Make
|
||||||
-h,-? --help This help
|
-h,-? --help This help
|
||||||
EOM
|
EOM
|
||||||
@ -39,6 +40,7 @@ EOM
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Parse command-line options
|
# Parse command-line options
|
||||||
|
my $make_out;
|
||||||
while (@ARGV) {
|
while (@ARGV) {
|
||||||
my $arg = shift @ARGV;
|
my $arg = shift @ARGV;
|
||||||
if ("$arg" eq "-h" || "$arg" eq "--help" || "$arg" eq "-?") {
|
if ("$arg" eq "-h" || "$arg" eq "--help" || "$arg" eq "-?") {
|
||||||
@ -46,6 +48,8 @@ while (@ARGV) {
|
|||||||
exit(0);
|
exit(0);
|
||||||
} elsif("$arg" eq "--out" || "$arg" eq "-o") {
|
} elsif("$arg" eq "--out" || "$arg" eq "-o") {
|
||||||
$out_dir = shift @ARGV;
|
$out_dir = shift @ARGV;
|
||||||
|
} elsif("$arg" eq "--make-out") {
|
||||||
|
$make_out = shift @ARGV;
|
||||||
} elsif("$arg" eq "--gen" || "$arg" eq "-g") {
|
} elsif("$arg" eq "--gen" || "$arg" eq "-g") {
|
||||||
$gen = shift @ARGV;
|
$gen = shift @ARGV;
|
||||||
} elsif("$arg" eq "--in" || "$arg" eq "-i") {
|
} elsif("$arg" eq "--in" || "$arg" eq "-i") {
|
||||||
@ -80,6 +84,12 @@ my $ErrsFile = "msvc-build-makedryerrors.txt";
|
|||||||
# test for an empty Errors file and remove it
|
# test for an empty Errors file and remove it
|
||||||
unlink $ErrsFile if -f -z $ErrsFile;
|
unlink $ErrsFile if -f -z $ErrsFile;
|
||||||
|
|
||||||
|
if (defined $make_out) {
|
||||||
|
open OUT, ">" . $make_out;
|
||||||
|
print OUT @makedry;
|
||||||
|
close OUT;
|
||||||
|
}
|
||||||
|
|
||||||
# Parse the make output into usable info
|
# Parse the make output into usable info
|
||||||
parseMakeOutput();
|
parseMakeOutput();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user