You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by jo...@apache.org on 2011/05/31 08:52:39 UTC

[lucy-commits] svn commit: r1129514 - /incubator/lucy/trunk/devel/bin/gen_charmonizer_makefiles.pl

Author: joes
Date: Tue May 31 06:52:38 2011
New Revision: 1129514

URL: http://svn.apache.org/viewvc?rev=1129514&view=rev
Log:
code no longer dependent on Test.c appearing before
the other tests in the File::Find walk

Modified:
    incubator/lucy/trunk/devel/bin/gen_charmonizer_makefiles.pl

Modified: incubator/lucy/trunk/devel/bin/gen_charmonizer_makefiles.pl
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/devel/bin/gen_charmonizer_makefiles.pl?rev=1129514&r1=1129513&r2=1129514&view=diff
==============================================================================
--- incubator/lucy/trunk/devel/bin/gen_charmonizer_makefiles.pl (original)
+++ incubator/lucy/trunk/devel/bin/gen_charmonizer_makefiles.pl Tue May 31 06:52:38 2011
@@ -47,13 +47,14 @@ sub gen_win_obj {
 
 sub gen_unix_tests {
     my @src = @_;
-    my @test = map m!\b(Test\w+)\.c$!, @src; # \w+ skips the first entry Test.c
+    my @test = map /\b(Test\w+)\.c$/, @src; # \w+ skips the Test.c entry
     my @obj = gen_unix_obj @src;
-    my $first_obj = shift @obj;
+    my $test_obj;
+    @obj = grep /\bTest\.o$/ ? ($test_obj = $_) && 0 : 1, @obj;
     my $rv = "";
     $rv .= <<EOT for 0..$#test;
-$test[$_]: $first_obj $obj[$_]
-	\$(CC) \$(CFLAGS) -o \$@ $first_obj $obj[$_] \$(LIBS)
+$test[$_]: $test_obj $obj[$_]
+	\$(CC) \$(CFLAGS) -o \$@ $test_obj $obj[$_] \$(LIBS)
 
 EOT
     return $rv, \@test;
@@ -61,14 +62,15 @@ EOT
 
 sub gen_win_tests {
     my @src = @_;
-    my @test = map m!\b(Test\w+)\.c$!, @src; # \w+ skips the first entry Test.c
+    my @test = map /\b(Test\w+)\.c$/, @src; # \w+ skips the Test.c entry
     $_ .= '.exe' for @test;
     my @obj = gen_win_obj @src;
-    my $first_obj = shift @obj;
+    my $test_obj;
+    @obj = grep /\bTest\.obj$/ ? ($test_obj = $_) && 0 : 1, @obj;
     my $rv = "";
     $rv .= <<EOT for 0..$#test;
-$test[$_]: $first_obj $obj[$_]
-	\$(LINKER) $first_obj $obj[$_] /OUT:\$@ \$(LIBS)
+$test[$_]: $test_obj $obj[$_]
+	\$(LINKER) $test_obj $obj[$_] /OUT:\$@ \$(LIBS)
 
 EOT
     return $rv, \@test;