How to run Makefile in mac

44.7k Views Asked by At

I want to create a fat library in mac. So I foll this. I copied the content of makefile into an edit text and renamed it to Makefile.mak. I opened the terminal in where the makefile is located and types "make" in the terminal and hit enter. I am getting an error that "Makefile is not found". What would be the reason for this? Where I made a mistake? Please help me. Thanks

2

There are 2 best solutions below

2
On BEST ANSWER

Your makefile is incorrectly named. You need to rename your Makefile.mak back to 'makefile'; that's what the make command is looking for.

0
On

make looks for files with name GNUmakefile, makefile or Makefile. If you change your file's name to one of these, you can run it without a problem. If you still want to use that name, you must run the make with -f flag. Running command should be like this:

$make -f <file_name>

In your case:

$make -f Makefile.mak