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'?
|
feedback
|
migrated from stackoverflow.com Jun 7 '10 at 17:19
This question came from our site for professional and enthusiast programmers.
|
Normally common users "use" ./configure make 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 | |||
|
feedback
|
|
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:
| |||
|
feedback
|
|
If you just want to use it (to build and install something) you can usually get along with:
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. | |||
|
feedback
|
|
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.
Will give you detailled information about possible options of the tool itself like making a dry-run or set a verbosity level. | |||
|
feedback
|
|
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 | |||
|
feedback
|
|
"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." | |||
|
feedback
|

make. It's been a mystery since day one... – Mark Rushakoff Jun 6 '10 at 22:18sudo magic-smoke-mirrors– Urda Jun 6 '10 at 22:25