Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install BSD make on a Mac (while preserving GNU make)?

Tags:

macos

makefile

I have two questions regarding make on my Mac: one regarding installation of a second make flavor, the second regarding how to manage the two flavors.

  1. I need to install BSD make on my Mac, but I don't want to remove the GNU make that is standard on the Mac; Berkeley is for a special project. In spite of the extensive resources for installing BSD, I haven't been able to figure out where to get and how to install that single program. What is the best way to do this?

  2. I'm thinking that I'll need to put it in /usr/local/bin while GNU make, which was provided by the Mac OS developer tools, will stay where it is in /bin. Then I can manage which make is called with an alias. I'm still a *nix newbie; is this a reasonable strategy or is there a better way?

like image 453
Gregory Avatar asked Oct 07 '22 02:10

Gregory


1 Answers

Installing BSD make

If you don't already have a /usr/bin/bsdmake (apparently it used to come with OS X/Xcode, but no longer does), install Homebrew, then:

brew install bsdmake

GNU co-habitation

To avoid conflicts with GNU make, Homebrew will install BSD make as bsdmake. In most cases it should be sufficient to build your software with bsdmake all. Sometimes you may have to tell it that your BSD make is called bsdmake and not make.

Removal

If you decide to get rid of BSD make for whatever reason, Homebrew will be happy to clean up for you by invoking:

brew uninstall bsdmake
like image 125
Ingmar Hupp Avatar answered Oct 13 '22 11:10

Ingmar Hupp