2

The make command is missing on my mac, running OS X version 10.6 (Snow Leopard). What should I do to install make?

Ignignokt
  • 25
  • 2
  • 5
  • This says its for Lion, but installing Developer Tools using any recent version of Xcode is the same story: http://stackoverflow.com/questions/6767481/where-can-i-find-make-program-for-mac-os-x-lion – andrewdotn Nov 12 '12 at 22:17

3 Answers3

8

You'll need to install the OS X developer tools from the Mac OS X installation discs.

EDIT: Directions here.

Christopher Armstrong
  • 7,907
  • 2
  • 26
  • 28
1

You need to install XCode, which comes along with make. You can download the latest XCode for free (if you're on Lion or Mountain Lion) from the Mac App store.

abcd
  • 41,765
  • 7
  • 81
  • 98
0

Update

It seems the link in the selected answer is a better solution, in that you don't have to add it to your path, it installs it in /usr/bin. I was originally thrown off by this as the answer mentions installation disks, which do not exist anymore (and are not needed here).


Original Post

make went missing on my installation of OSX Lion, even with XCode installed.

What I discovered was that, it was not in /usr/bin, but was in /Developer/usr/bin, which is not in $PATH environment variable by default. This is most likely a result of the XCode install.

You have a few options:

  • install it to one of the directories that is in your path
  • make a symbolic link to point to the Developer bin directory (for example, from /usr/bin)
  • modify your path to include the Developer directory (what I did) - see below

Add the developer bin to your path:

Somewhere in ~/.bashrc place the following code:

export PATH=$PATH:/Developer/usr/bin
#Remove Duplicates:
PATH=`perl -e '@A=split(/:/,$ENV{PATH});%H=map {$A[$#A-$_]=>$#A-$_} (0..$#A);@A=join(":",sort{$H{$a} <=> $H{$b} }keys %H);print "@A"'`
export PATH
  1. Line 1: add /Developer/usr/bin to the end of the current path so it has low priority
  2. Line 3: because we're adjusting path, we want to remove duplicates (in case you source more than once). Duplicates aren't really problematic, but this should cause the same directory to not be searched more than once, which may make it faster.
  3. Line 4: Make it available to your environment

Note:
If you're using a different shell (for instance csh), you'll have to adjust the script above and make the changes in that corresponding resource file (~/.cshrc).

To apply changes you'll have to source ~/.bashrc or reopen your terminal.


Community
  • 1
  • 1
vol7ron
  • 40,809
  • 21
  • 119
  • 172