#!/usr/bin/env ruby
require 'mkmf'
if ARGV.shift == 'clean'
  system( "rm -f *.cxx *.so *.o mlt.i ../.ruby Makefile" )
  exit 0
end
system( "ln -sf ../mlt.i" )
system( "swig -c++ -ruby -I../../mlt++ -I../.. mlt.i" )
$CFLAGS = $CFLAGS.to_s + " -I../.. " + (ENV.has_key?('CXXFLAGS')? ENV['CXXFLAGS'] : '')
$CXXFLAGS = $CXXFLAGS.to_s + " -I../.. " + (ENV.has_key?('CXXFLAGS')? ENV['CXXFLAGS'] : '')
$LDFLAGS = $LDFLAGS.to_s + " -L../../mlt++ -lmlt++"
create_makefile('mlt')
system( "make V=1" )
