24 lines
475 B
Crystal
24 lines
475 B
Crystal
|
|
class Package::Backend::Build
|
|
|
|
def self.make : Backend::Building
|
|
Backend::Building.new "build", "make" do |context, recipe|
|
|
next BuildStatus::Pass unless Dir.exists? recipe.dirname
|
|
Dir.cd recipe.dirname
|
|
|
|
unless File.exists? "Makefile"
|
|
next BuildStatus::Pass
|
|
end
|
|
|
|
child = Do.sh "make -j#{context.build_cores} #{recipe.options["make"]? || ""}"
|
|
|
|
if child.exit_status == 0
|
|
BuildStatus::Success
|
|
else
|
|
BuildStatus::Failed
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|