<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>artifacts/beam/.gitignore</filename>
    </added>
    <added>
      <filename>artifacts/erl/.gitignore</filename>
    </added>
    <added>
      <filename>ebin/leex.beam</filename>
    </added>
    <added>
      <filename>ebin/lex.beam</filename>
    </added>
    <added>
      <filename>ebin/mapform0.beam</filename>
    </added>
    <added>
      <filename>ebin/smart_exc_rt.beam</filename>
    </added>
    <added>
      <filename>ebin/smart_exceptions.beam</filename>
    </added>
    <added>
      <filename>ebin/smart_handler_b.beam</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,75 +1,75 @@
-task :default =&gt; :build 
-task :build =&gt; %w[reia copy_ebin test]
+task :default =&gt; [:build, :test]
+task :build =&gt; [:smerl, :leex, :smart_exceptions, :reia, :ebin]
 
-rule &quot;.beam&quot; =&gt; &quot;.erl&quot; do |t|
-  sh &quot;bin/erlc -o #{File.dirname(t.name)} #{t.source}&quot;
+def output_file(input_file)
+  'ebin/' + File.basename(input_file).sub(/\.\w+$/, '.beam')
 end
 
-rule &quot;.beam&quot; =&gt; &quot;.re&quot; do |t|
-  sh &quot;bin/reiac -o #{t.name} #{t.source}&quot;
+# Reia
+ERL_SRC = FileList.new('src/reia/**/*.erl')
+ERL_SRC.each do |input|
+  file output_file(input) =&gt; input do
+    sh &quot;bin/erlc +debug_info -o artifacts/beam #{input}&quot;
+  end
 end
 
-# Reia sources
-SOURCES = FileList.new('src/reia/**/*') do |fl|
-  fl.include %w[*.erl *.re *.xrl *.yrl]
+REIA_SRC = FileList.new('src/reia/**/*.re')
+REIA_SRC.each do |input|
+  output = output_file(input)
+  file output =&gt; input do
+    sh &quot;bin/reiac -o artifacts/beam/#{File.basename(output, &quot;.re&quot;)}.beam #{input}&quot;
+  end
 end
 
-BEAMS = SOURCES.sub(/\.\w+$/, '.beam')
-
-task :reia =&gt; [:smerl, :leex, :smart_exceptions] + BEAMS
+task :reia =&gt; (ERL_SRC + REIA_SRC).map { |input_file| output_file(input_file) }
 
 # Smart exceptions
-SMEX_BEAM = FileList['src/smart_exceptions/*.erl'].sub(/.erl$/, '.beam')
-
-task :smart_exceptions =&gt; SMEX_BEAM
-
-SMEX_BEAM.each do |beam|
-  src = beam.sub(/.beam$/, '.erl')
-  file beam =&gt; src do |t|
-    sh &quot;erlc -W0 -o #{File.dirname(t.name)} #{src}&quot;
+SMEX_SRC = FileList['src/smart_exceptions/*.erl']
+SMEX_SRC.each do |input|
+  file output_file(input) =&gt; input do
+    sh &quot;erlc -W0 -o ebin #{input}&quot;
   end
 end
 
-# Compile smerl
-task :smerl =&gt; &quot;src/smerl/smerl.beam&quot;
+task :smart_exceptions =&gt; SMEX_SRC.map { |input_file| output_file(input_file) }
+
+# Smerl (Simple Metaprogramming for Erlang)
+task :smerl =&gt; &quot;ebin/smerl.beam&quot;
 
-file &quot;src/smerl/smerl.beam&quot; =&gt; &quot;src/smerl/smerl.erl&quot; do
-  sh &quot;erlc -W0 -o src/smerl src/smerl/smerl.erl&quot;
+file &quot;ebin/smerl.beam&quot; =&gt; &quot;src/smerl/smerl.erl&quot; do
+  sh &quot;erlc -W0 -o ebin src/smerl/smerl.erl&quot;
 end
 
-# Compile leex
-task :leex =&gt; &quot;src/leex/leex.beam&quot;
+# Leex (lexer generator for Erlang)
+task :leex =&gt; &quot;ebin/leex.beam&quot;
 
-file &quot;src/leex/leex.beam&quot; =&gt; &quot;src/leex/leex.erl&quot; do
-  sh &quot;erlc -W0 -o src/leex src/leex/leex.erl&quot;
+file &quot;ebin/leex.beam&quot; =&gt; &quot;src/leex/leex.erl&quot; do
+  sh &quot;erlc -W0 -o ebin src/leex/leex.erl&quot;
 end
 
 # Compile reia_scan using leex
-file &quot;src/reia/compiler/reia_scan.erl&quot; =&gt; %w[src/reia/compiler/reia_scan.xrl src/leex/leex.beam] do
+file &quot;artifacts/erl/reia_scan.erl&quot; =&gt; %w[ebin/leex.beam src/reia/compiler/reia_scan.xrl] do
   sh &quot;bin/leex src/reia/compiler/reia_scan.xrl&quot;
+  mv &quot;src/reia/compiler/reia_scan.erl&quot;, &quot;artifacts/erl/reia_scan.erl&quot;
 end
 
-file &quot;src/reia/compiler/reia_scan.beam&quot; =&gt; &quot;src/reia/compiler/reia_scan.erl&quot; do
-  sh &quot;erlc +debug_info +nowarn_unused_vars -o src/reia/compiler src/reia/compiler/reia_scan.erl&quot;
+file &quot;ebin/reia_scan.beam&quot; =&gt; &quot;artifacts/erl/reia_scan.erl&quot; do
+  sh &quot;erlc +debug_info +nowarn_unused_vars -o artifacts/beam src/reia/compiler/reia_scan.erl&quot;
 end
 
 # Compile reia_parse using yecc
-file &quot;src/reia/compiler/reia_parse.erl&quot; =&gt; &quot;src/reia/compiler/reia_parse.yrl&quot; do
+file &quot;artifacts/erl/reia_parse.erl&quot; =&gt; &quot;src/reia/compiler/reia_parse.yrl&quot; do
   sh &quot;bin/yecc src/reia/compiler/reia_parse.yrl&quot;
+  mv &quot;src/reia/compiler/reia_parse.erl&quot;, &quot;artifacts/erl/reia_parse.erl&quot;
 end
 
-file &quot;src/reia/compiler/reia_parse.beam&quot; =&gt; &quot;src/reia/compiler/reia_parse.erl&quot; do
-  sh &quot;erlc +debug_info -o src/reia/compiler src/reia/compiler/reia_parse.erl&quot;
+file &quot;ebin/reia_parse.beam&quot; =&gt; &quot;src/reia/compiler/reia_parse.erl&quot; do
+  sh &quot;erlc +debug_info -o ebin src/reia/compiler/reia_parse.erl&quot;
 end
 
-# Create the ebin directory if it doesn't exist
-directory &quot;ebin&quot;
-
 # Copy all output BEAM files into the ebin directory
-task &quot;copy_ebin&quot; =&gt; &quot;ebin&quot; do
-  FileList[&quot;src/{reia,smerl}/**/*.beam&quot;].each do |file|
-    cp file, &quot;ebin&quot;
-  end
+task :ebin do
+  FileList[&quot;artifacts/*.beam&quot;].each { |file| cp file, &quot;ebin&quot; }
 end
 
 task :test do
@@ -77,12 +77,5 @@ task :test do
 end
 
 task :clean do
-  FileList['src/smart_exceptions/*.beam'].each { |beam| rm_f beam }
-  
-  rm_f &quot;src/smerl/smerl.beam&quot;
-  rm_f &quot;src/leex/leex.beam&quot;
-  rm_f &quot;src/reia/reia_scan.erl&quot;
-  rm_f &quot;src/reia/reia_parse.erl&quot;
-  
-  BEAMS.each { |beam| rm_f beam }
+  FileList['artifacts/**/*.{erl,beam}'].each { |f| rm_f f }
 end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 #!/bin/sh
 
-erlc +debug_info +'{parse_transform, smart_exceptions}' -pa src/smart_exceptions $*
\ No newline at end of file
+erlc +debug_info +'{parse_transform, smart_exceptions}' -pa ebin $*
\ No newline at end of file</diff>
      <filename>bin/erlc</filename>
    </modified>
    <modified>
      <diff>@@ -16,8 +16,8 @@ main([File]) -&gt;
   end.
   
 init() -&gt;
-  code:add_patha(&quot;./src/leex&quot;),
-  code:add_patha(&quot;../src/leex&quot;).
+  code:add_patha(&quot;./ebin&quot;),
+  code:add_patha(&quot;../ebin&quot;).
   
 usage() -&gt;
   io:format(&quot;Usage: leex file.yrl~n&quot;).</diff>
      <filename>bin/leex</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2ca62bf5b049ad3076ad5f004d5adfb10a81ada4</id>
    </parent>
  </parents>
  <author>
    <name>Tony Arcieri</name>
    <email>tony@medioh.com</email>
  </author>
  <url>http://github.com/tarcieri/reia/commit/3ff9a5824955b3e1beac47d30efc20e0125f917e</url>
  <id>3ff9a5824955b3e1beac47d30efc20e0125f917e</id>
  <committed-date>2008-09-06T00:53:29-07:00</committed-date>
  <authored-date>2008-09-06T00:53:29-07:00</authored-date>
  <message>New build system</message>
  <tree>5a11392f0fa7c74d6479ab1db69064eb311ec409</tree>
  <committer>
    <name>Tony Arcieri</name>
    <email>tony@medioh.com</email>
  </committer>
</commit>
