<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>functions.sh</filename>
    </added>
    <added>
      <filename>implementations/ruby/btm</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,19 +1,38 @@
+SHELL        = bash --rcfile functions.sh
 IMPLS        = $(wildcard implementations/*)
 SCRIPTS      = $(wildcard scripts/*)
 IMPL_NAMES   = $(notdir $(IMPLS))
 SCRIPT_NAMES = $(notdir $(SCRIPTS))
-LOGS         = $(foreach impl,$(IMPL_NAMES),$(foreach script,$(SCRIPT_NAMES),log/$(impl)-$(script).log))
+EXECUTABLES  = $(addsuffix /btm, $(IMPLS))
 EXPECT       = expect
 EXPECTFLAGS  =
-export IMPL  ?= btm_ruby.rb
-
-all:
-	@for log in $(LOGS); do \
-		$(MAKE) $$log; \
-	done
-
-log/$(IMPL)-%.log : scripts/% implementations/$(IMPL)
-	@echo ===================================================================
-	@echo &quot;Script: $&lt;; Implementation: $(IMPL)&quot;
-	@echo ===================================================================
-	$(EXPECT) $(EXPECTFLAGS) $&lt; implementations/$(IMPL) $@
+
+
+all: $(EXECUTABLES)
+	@. functions.sh;													\
+	for impl in $(dir $?); do $(MAKE) `impl_logs $$impl`; done
+
+log/%.log: log
+	@. functions.sh;													\
+	run_script `log_impl $@` `log_script $@` $@
+
+log:
+	mkdir $@
+
+shell:
+	exec $(SHELL) -i
+
+list_implementations:
+	@for impl in $(IMPL_NAMES); do echo $$impl; done
+
+list_scripts:
+	@for script in $(SCRIPT_NAMES); do echo $$script; done
+ 
+$(EXECUTABLES):
+	@impl_dir=$(dir $@);										\
+	if [ -e $$impl_dir/Makefile ]; then							\
+		$(MAKE) -C $$impl_dir;									\
+	else														\
+		echo &quot;No Makefile for $$impl_dir; skipping.&quot;;			\
+	fi															\
+</diff>
      <filename>Makefile</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>implementations/btm_ruby.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>aad0ba5a358528f50fe401a513618a411105def9</id>
    </parent>
  </parents>
  <author>
    <name>Avdi Grimm</name>
    <email>avdi@avdi.org</email>
  </author>
  <url>http://github.com/avdi/bewarethemoose/commit/52e47d067e1c448e398581d42f70b3d52001e12e</url>
  <id>52e47d067e1c448e398581d42f70b3d52001e12e</id>
  <committed-date>2009-05-14T03:23:25-07:00</committed-date>
  <authored-date>2009-05-14T03:23:25-07:00</authored-date>
  <message>Rewrote Makefile</message>
  <tree>52e52151a8d97843a260540fac1676341cf0bb55</tree>
  <committer>
    <name>Avdi Grimm</name>
    <email>avdi@avdi.org</email>
  </committer>
</commit>
