Sha256: b1367e358609438c61a6feb8115ec6ded7d044821889baac295047db88a81404

Contents?: true

Size: 1.3 KB

Versions: 75

Compression:

Stored size: 1.3 KB

Contents

# Builds rubylinux executable

cc = "gcc"
cflags = "-O2 -g -Wall -Wno-parentheses"
lnk_flags = "-L. -rdynamic -Wl,-export-dynamic"
incl = "-I../shared/ruby -I../shared/ruby/linux -I../shared/ruby/include -I../shared/ruby/generated -I../shared -I../shared/ruby/rhoruby -I../shared/sqlite"
compile = "#{cc} #{cflags} #{incl} -DRUBYLINUX -DRUBY_EXPORT -c "
link = "#{cc} #{lnk_flags}"
target = "target/compiler/rubylinux"
out = "-lpthread -lrt -ldl -lcrypt -lm -o #{target}"
src_dir = "../shared"
code = true
objfiles = []

task :default => :all

desc "Build all ruby sources"
task :all, :continue do |t,args|
  mkdir_p "obj" unless File.exists? "obj"
  File.open("files.txt").each_line do |file|
    file.chomp!
    s_file = "#{src_dir}/#{file}.c"
	o_file = "obj/#{File.basename file}.o"
    objfiles << "#{o_file}"
    if not uptodate?("#{o_file}", "#{s_file}")
      cmd = "#{compile} -o #{o_file} #{s_file}"
      puts cmd
      code = system cmd
    end
    abort("Aborting due to compile errors...") if not code and not args.continue
  end
  
  if not uptodate?(target, objfiles)
    cmd = "#{link} #{objfiles.join(" ")} #{out}"
    puts cmd
    code = system cmd
    abort("Aborting due to link errors...") if not code

    cp_r target, "../../res/build-tools"
  end
end

desc "Clean all artifacts"
task :clean do
  rm_rf "obj"
end

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
rhodes-3.0.2 platform/linux/Rakefile
rhodes-3.0.2.beta.1 platform/linux/Rakefile
rhodes-3.0.1 platform/linux/Rakefile
rhodes-3.0.1.beta.8 platform/linux/Rakefile
rhodes-3.0.1.beta.7 platform/linux/Rakefile
rhodes-3.0.1.beta.6 platform/linux/Rakefile
rhodes-3.0.1.beta.5 platform/linux/Rakefile
rhodes-3.0.1.beta.4 platform/linux/Rakefile
rhodes-3.0.1.beta.3 platform/linux/Rakefile
rhodes-3.0.1.beta.2 platform/linux/Rakefile
rhodes-3.0.0 platform/linux/Rakefile
rhodes-3.0.0.beta.7 platform/linux/Rakefile
rhodes-3.0.0.beta.6 platform/linux/Rakefile
rhodes-3.0.0.beta.5 platform/linux/Rakefile
rhodes-3.0.0.beta.4 platform/linux/Rakefile
rhodes-3.0.0.beta.3 platform/linux/Rakefile
rhodes-3.0.0.beta.2 platform/linux/Rakefile
rhodes-3.0.0.beta.1 platform/linux/Rakefile
rhodes-2.4.1 platform/linux/Rakefile
rhodes-2.4.1.beta.1 platform/linux/Rakefile