Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend/fileutils.rb: make the make convenience routine more robust #1100

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions Library/Homebrew/extend/fileutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ def rake(*args)
system RUBY_BIN/"rake", *args
end

# Run `make` 3.81 or newer.
# Uses the system make on Leopard and newer, and the
# path to the actually-installed make on Tiger or older.
# Run `make` 3.81 or newer. Uses system make from Leopard onward, otherwise brewed make.
def make(*args)
if Utils.popen_read("/usr/bin/make", "--version").match(/Make (\d\.\d+)/)[1] > "3.80"
system "/usr/bin/make", *args
_make = "/usr/bin/make"
elsif Formula["make"].installed?
_make = Formula["make"].opt_bin/"make"
_make = _make.exist? ? _make.to_s : Formula["make"].opt_bin/"gmake".to_s
else
make = Formula["make"].opt_bin/"make"
make_path = make.exist? ? make.to_s : (Formula["make"].opt_bin/"gmake").to_s
system make_path, *args
abort "Your system’s Make program is too old. Please install the “make” package."
end
system _make, *args
end

if method_defined?(:ruby)
Expand Down