["-I", b.root, "-I", b.root.join("include")] cc = b.find_executable(%w[cc clang gcc], env: "CC") have_checks = HEADERS_TO_CHECK.map do |header| b.add_task(HaveHeader.new(header)) end config_h = b.erb(b.output("config.h"), <<~ERB, have_checks: have_checks) <% have_checks.each do |have_check| %> <= b.select(have_check, "#define HAVE_<%= have_check.upcase %> 1", "") %> <% end %> ERB c_objs = INTERPRETER_C_SOURCE_FILES.map do |src| src_path = b.root.join(src) out_path = b.output(src + ".o") b.add_task(CCompile.new(out_path, cc, src_path, cflags)) end miniruby = b.add_task(Rk2::CLink.new(b.output("miniruby"), c_objs)) b.aggregate(:default, [miniruby]) end 45