Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I just recently started learning different Linux commands but I still don't understand how to use the 'make' command. Please is there anyone that understands how to use 'make'?

share|improve this question

migrated from stackoverflow.com Jun 7 '10 at 17:19

This question came from our site for professional and enthusiast programmers.

Nobody knows how to use make. It's been a mystery since day one... –  Mark Rushakoff Jun 6 '10 at 22:18
sudo magic-smoke-mirrors –  Urda Jun 6 '10 at 22:25
sudo: magic-smoke-mirrors: command not found –  Oli Jun 6 '10 at 22:26
If you just started learning linux commands you probably don't need make anyway... :) –  Unknown Jun 7 '10 at 6:38
Learning make is like looking into the eyes of God. Half of the people go insane, the rest of us become programmers and sysadmins. What are you trying to do with 'make'? If you tell us, we might be able to provide a better answer for you. Make is very powerful and complex, and may be beyond what you are trying to learn at the moment. I was a Linux user for many years before I ever seriously started to use 'make' for anything except compiling software (We had to do that often, back in the day. These days, most people use a package management system like 'rpm', 'yum' and 'apt'). –  Stefan Lasiewski Jun 7 '10 at 18:51

6 Answers 6

make(1) is an extremely powerful tool.

Generally, when a program is distributed as source code, the archive containing the code will also include Makefiles. make can read these files and turn the source code into an executable program.

Despite the fact that you'll most often see make used to turn .c files into .o files and .o files into executables, make is often useful in any case where you need to do one or more of the following:

  • Transform or process one or more files as input to produce one or more files of output.
  • Define actions that may depend on one or more other actions being triggered first (potentially requiring make to calculate the order in which to execute a hierarchy of dependent actions).
  • Automatically perform or skip actions based on the criteria of file modification since the last time make was run.
share|improve this answer

Normally common users "use" make just calling it in a sequence like

make install

so that what you need to know is not too much about this program. If you mean instead you want to learn how to create a Makefile to do something, then you have to read at least the manual, e.g. the GNU make manual

share|improve this answer

If you just want to use it (to build and install something) you can usually get along with:

cd source_dir
sudo make install

Of course this depends on the project following "traditional" rules and you having the required dependencies installed. A review of the README and/or INSTALL file should help you out.

share|improve this answer

There are many flavors of make tools (Gnu make, cmake, ...) and make files. Usually you need to create a make file (using a configure script or manually). Then calling make in the root project directory will build the software, usually make install will install it. Take care to specify the options you want during the configuration step.

How to create a configure script is another silly game (autotools) but there are better alternatives like using cmake instead.

man make
info make

Will give you detailled information about possible options of the tool itself like making a dry-run or set a verbosity level.

share|improve this answer

Make reads commands form MakeFile. You must specify directory, where MakeFile exist.

Example: make -D /home/developer/Documents/developing/projects/SuperProject.c/

Make will change current directory onto /home/developer/Documents/developing/projects/SuperProject.c/, reads MakeFile and do all think specified in makefile

share|improve this answer

"The make utility executes a list of shell commands associated with each target, typically to create or update a file of the same name. makefile contains entries that describe how to bring a target up to date with respect to those on which it depends, which are called dependencies."


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.