Make Utility
Make Utility
Make Utility:
Make gets its knowledge of how to build your program from a file
called the makefile, which lists each of the non-source files and
how to compute it from other files. When you write a program, you
should write a makefile for it, so that it is possible to use
Make to build and install the program.
Capabilities of Make
Make enables the end user to build and install your package
without knowing the details of how that is done -- because these
details are recorded in the makefile that you supply.
www.vectorindia.org 1
Make Utility
The Makefile :
A file called makefile tells the make utility in a structured manner which
source and object files depend on other files. It also defines the commands
required to compile and link the files.
Each file to build, or step to perform, is called a target. Each entry in a
makefile is a rule expressing a target object's dependencies and the
commands needed to build or make that object. The structure of a rule in the
makefile is:
target:
dependencies-list
TAB build-
commands
For the dependencies, each entry starts with a line that names the target
file, followed by all the files the target depends on. For the build commands,
each entry has one or more subsequent lines that specify the Bourne shell
commands that will build the target file for this entry. Each of these
command lines must be indented by a tab character.
www.vectorindia.org 2
Make Utility
Note :
www.vectorindia.org 3