Skip to content

Commit b836446

Browse files
Philip Oakleydscho
Philip Oakley
authored andcommitted
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 <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent e54d197 commit b836446

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

contrib/buildsystems/engine.pl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,24 @@ sub showUsage
3232
-g <GENERATOR> --gen <GENERATOR> Specify the buildsystem generator (default: $gen)
3333
Available: $genlist
3434
-o <PATH> --out <PATH> Specify output directory generation (default: .)
35+
--make-out <PATH> Write the output of GNU Make into a file
3536
-i <FILE> --in <FILE> Specify input file, instead of running GNU Make
3637
-h,-? --help This help
3738
EOM
3839
exit 0;
3940
}
4041

4142
# Parse command-line options
43+
my $make_out;
4244
while (@ARGV) {
4345
my $arg = shift @ARGV;
4446
if ("$arg" eq "-h" || "$arg" eq "--help" || "$arg" eq "-?") {
4547
showUsage();
4648
exit(0);
4749
} elsif("$arg" eq "--out" || "$arg" eq "-o") {
4850
$out_dir = shift @ARGV;
51+
} elsif("$arg" eq "--make-out") {
52+
$make_out = shift @ARGV;
4953
} elsif("$arg" eq "--gen" || "$arg" eq "-g") {
5054
$gen = shift @ARGV;
5155
} elsif("$arg" eq "--in" || "$arg" eq "-i") {
@@ -80,6 +84,12 @@ sub showUsage
8084
# test for an empty Errors file and remove it
8185
unlink $ErrsFile if -f -z $ErrsFile;
8286

87+
if (defined $make_out) {
88+
open OUT, ">" . $make_out;
89+
print OUT @makedry;
90+
close OUT;
91+
}
92+
8393
# Parse the make output into usable info
8494
parseMakeOutput();
8595

0 commit comments

Comments
 (0)