[add quick and dirty was to cache the 'jhc' build for regression testing
John Meacham <john@repetae.net>**20100726235921
 Ignore-this: eece8d1197a9f585c77d13cdb2a0f68f
] hunk ./Makefile.am 126
-	$(HC) $(GHCOPTS) --make $< $(CFILES) -o $@
+	$(BUILD_STOW) $(HC) $(GHCOPTS) --make $< $(CFILES) -o $@
addfile ./utils/stow.prl
hunk ./utils/stow.prl 1
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Getopt::Std;
+
+our $opt_t;
+getopts('t:') or die "bad option";
+
+
+
+my $stowdir = "/tmp/stow-$>";
+mkdir $stowdir;
+
+-e '_darcs' || die "not in darcs dir";
+
+my $sum = `( darcs whatsnew ; darcs changes) | md5sum`;
+chomp $sum;
+$sum =~ s/\s.*//;
+
+print STDERR "stow: sum=$sum\n";
+
+my $target = $opt_t;
+$target or die "must specify target with -t";
+
+my $sfile = "$stowdir/$sum-$target";
+
+if(-e "$stowdir/$sum-$target") {
+    if(system "cp -f '$sfile' '$target'") { unlink "$target"; die "could not copy";}
+    print STDERR "found $sfile -> $target\n";
+    exit 0;
+}
+
+
+system @ARGV and die "could not make $target";
+
+-e $target || die "target not built";
+
+if(system "cp -f '$target' '$sfile'")  { unlink "$sfile"; die "could not copy";}
+
+print STDERR "stow $target -> $sfile\n";
+
+exit 0;
+
+
+
+#BUILD_STOW='perl utils/stow.prl -t $@  -- ' make