Whamcloud - gitweb
Fixed to make version_tag.pl work outside srcdir.
authoramrutjoshi <amrutjoshi>
Thu, 20 Feb 2003 11:51:12 +0000 (11:51 +0000)
committeramrutjoshi <amrutjoshi>
Thu, 20 Feb 2003 11:51:12 +0000 (11:51 +0000)
lustre/obdclass/Makefile.am
lustre/scripts/version_tag.pl

index 6f7f8fc..03f1e59 100644 (file)
@@ -19,7 +19,7 @@ include $(top_srcdir)/Rules
 
 # XXX I'm sure there's some automake mv-if-different helper for this.
 lustre_build_version:
-       perl $(top_srcdir)/scripts/version_tag.pl $(top_srcdir) > tmpver
+       perl $(top_srcdir)/scripts/version_tag.pl $(top_srcdir) $(top_builddir)> tmpver
        cmp -z $(top_builddir)/include/linux/lustre_build_version.h tmpver \
                2> /dev/null &&                                            \
                $(RM) tmpver ||                                            \
index a92fef4..3575b87 100644 (file)
@@ -145,13 +145,27 @@ sub generate_ver($$$)
         print "$tag-$show_last-CHANGED-$linuxdir-$kernver\"\n";
     }
 }
+chomp(my $cwd = `pwd`);
+
+# ARGV[0] = srcdir
+# ARGV[1] = builddir
+
+# for get_latest_mtime and get_tag you need to be in srcdir
 
 if ($ARGV[0]) {
     chdir($ARGV[0]);
 }
-my $linuxdir = get_linuxdir();
 my $tag = get_tag();
 my $mtime = get_latest_mtime();
+
+# for get_linuxdir you need to be in builddir 
+
+if ($ARGV[1]) {
+   chdir($cwd);
+   chdir($ARGV[1]);
+}
+my $linuxdir = get_linuxdir();
+
 generate_ver($tag, $mtime, $linuxdir);
 
 exit(0);