<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -11,21 +11,47 @@ EXPECTFLAGS  =
 ################################################################################
 # FUNCTIONS
 ################################################################################
+impl_name		= $(notdir $(1))
+script_name		= $(notdir $(1))
+impl_logs		= $(foreach script,										\
+							$(SCRIPT_NAMES),							\
+							log/$(call impl_name,$(1))-$(script).log)	
+log_script		= $(shell basename $(1) .log | cut -d - -f 2)
+log_impl		= $(shell basename $(1) .log | cut -d - -f 1)
+log_exec		= implementations/$(call log_impl, $(1))/btm
+log_result      = $(wildcard $(basename $(1))-*.log)
+
 
 ################################################################################
 # RULES
 ################################################################################
-all:
-	@. functions.sh;													\
-	for impl in $(dir $?); do $(MAKE) `impl_logs $$impl`; done
+all: $(foreach impl, $(IMPL_NAMES), $(call impl_logs,$(impl)))
 
 clean:
 	-rm -r ./log
 
-log/%.log: log
-	@. functions.sh;													\
-	$(MAKE) -C implementations/`log_impl $@` btm;						\
-	run_script `log_impl $@` `log_script $@` $@
+log/%.log: 
+	$(MAKE) run_script LOG=$@
+
+run_script: IMPL   = $(call log_impl, $(LOG))
+run_script: SCRIPT = $(call log_script, $(LOG))
+run_script: HEADER = $(IMPL) / $(SCRIPT)
+run_script: $(IMPL) $(SCRIPT) log
+	@echo
+	@echo &quot;============================================================&quot;
+	@echo &quot;Running $(HEADER)&quot;
+	@echo &quot;------------------------------------------------------------&quot;
+
+	@if scripts/$(SCRIPT) implementations/$(IMPL)/btm; then \
+      ln -s `basename $(LOG)` log/`basename $(LOG) .log`-PASS.log; \
+    else \
+      ln -s `basename $(LOG)` log/`basename $(LOG) .log`-FAIL.log; \
+    fi | tee $(LOG)
+
+	@echo
+	@echo &quot;------------------------------------------------------------&quot;
+	@ls log/`basename $(LOG) .log`-*.log
+	@echo &quot;============================================================&quot;
 
 log:
 	mkdir $@</diff>
      <filename>Makefile</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f72763a9bf06bb51644d2e761a7be0a08241652b</id>
    </parent>
  </parents>
  <author>
    <name>Avdi Grimm</name>
    <email>avdi@avdi.org</email>
  </author>
  <url>http://github.com/avdi/bewarethemoose/commit/a0db5181ee903ca52a670e9e10278599fabc6e37</url>
  <id>a0db5181ee903ca52a670e9e10278599fabc6e37</id>
  <committed-date>2009-05-21T03:40:18-07:00</committed-date>
  <authored-date>2009-05-21T03:40:18-07:00</authored-date>
  <message>Working Makefile again</message>
  <tree>479f3bd11c33a8b142041e1e51bed2cf9e4cb684</tree>
  <committer>
    <name>Avdi Grimm</name>
    <email>avdi@avdi.org</email>
  </committer>
</commit>
