Run correct make
authorMax Maischein <corion@corion.net>
Sat, 5 Oct 2013 18:01:44 +0000 (20:01 +0200)
committerMax Maischein <corion@corion.net>
Sun, 6 Oct 2013 17:48:09 +0000 (19:48 +0200)
Use Config.pm to determine correct kind of `make` tool

For Windows, the make process is supposed to get kicked off
in ./Win32.

We now run `make test-prep` before trying the module self-tests

Porting/sync-with-cpan

index fc65150..a0a26d6 100755 (executable)
@@ -130,6 +130,7 @@ use Getopt::Long;
 use Archive::Tar;
 use File::Path qw( remove_tree );
 use File::Find;
+use Config qw( %Config );
 
 $| = 1;
 
@@ -184,6 +185,16 @@ sub de_exec {
 }
 
 sub make {
+    my @args= @_;
+    if( $^O eq 'MSWin32') {
+        chdir "Win32";
+        system "$Config{make} @args> ..\\make.log 2>&1" and die "Running make failed, see make.log";
+        chdir '..';
+    } else {
+        system "$Config{make} @args> make.log 2>&1" and die "Running make failed, see make.log";
+    };
+};
+
 my ($module)  = shift;
 my  $cpan_mod = @ARGV ? shift : $module;
 
@@ -433,7 +444,8 @@ if (@commit) {
 
 
 print "Running a make ... ";
-system "$Config{make} > make.log 2>&1" and die "Running make failed, see make.log";
+# Prepare for running (selected) tests
+make 'test-prep';
 print "done\n";
 
 #
@@ -445,7 +457,6 @@ print "About to clean up; hit return or abort (^C) "; <STDIN>;
 remove_tree( "cpan/$old_dir" );
 unlink "cpan/$new_file" unless $tarball;
 
-
 #
 # Run the tests. First the test belonging to the module, followed by the
 # the tests in t/porting