Skip to content

Instantly share code, notes, and snippets.

@savonarola
Created March 17, 2010 06:47
Show Gist options
  • Select an option

  • Save savonarola/334984 to your computer and use it in GitHub Desktop.

Select an option

Save savonarola/334984 to your computer and use it in GitHub Desktop.
ERLDIRS = %w{
elibs
elibs/balancer
elibs/config
elibs/convert
elibs/driver
elibs/handler
elibs/helper
elibs/mysql
elibs/tcp
elibs/util
}
BEAMS = ERLDIRS.map{ |dir| FileList["#{dir}/*.erl"].pathmap("ebin/%n.beam") }.flatten
ERLDIRS.each do |dir|
rule ".beam" => "#{dir}/%n.erl" do |t|
compile(t)
end
end
def compile(t)
cmd = "erlc #{ERLC_FLAGS} #{t.source}"
sh cmd
end
task :build_erl => BEAMS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment