149 lines
4.9 KiB
HTML
149 lines
4.9 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<!-- This HTML file has been created by texi2html 1.54
|
|
from ../texi/make.texinfo on 19 July 2000 -->
|
|
|
|
<TITLE>GNU make - Overview of make</TITLE>
|
|
<link href="make_2.html" rel=Next>
|
|
<link href="make_toc.html" rel=ToC>
|
|
|
|
</HEAD>
|
|
<BODY>
|
|
<p>Go to the first, previous, <A HREF="make_2.html">next</A>, <A HREF="make_19.html">last</A> section, <A HREF="make_toc.html">table of contents</A>.
|
|
<P><HR><P>
|
|
|
|
|
|
<H1><A NAME="SEC1" HREF="make_toc.html#TOC1">Overview of <CODE>make</CODE></A></H1>
|
|
|
|
<P>
|
|
The <CODE>make</CODE> utility automatically determines which pieces of a large
|
|
program need to be recompiled, and issues commands to recompile them.
|
|
This manual describes GNU <CODE>make</CODE>, which was implemented by Richard
|
|
Stallman and Roland McGrath. Development since Version 3.76 has been
|
|
handled by Paul D. Smith.
|
|
|
|
</P>
|
|
<P>
|
|
GNU <CODE>make</CODE> conforms to section 6.2 of <CITE>IEEE Standard
|
|
1003.2-1992</CITE> (POSIX.2).
|
|
<A NAME="IDX1"></A>
|
|
<A NAME="IDX2"></A>
|
|
<A NAME="IDX3"></A>
|
|
|
|
</P>
|
|
<P>
|
|
Our examples show C programs, since they are most common, but you can use
|
|
<CODE>make</CODE> with any programming language whose compiler can be run with a
|
|
shell command. Indeed, <CODE>make</CODE> is not limited to programs. You can
|
|
use it to describe any task where some files must be updated automatically
|
|
from others whenever the others change.
|
|
|
|
</P>
|
|
|
|
<P>
|
|
To prepare to use <CODE>make</CODE>, you must write a file called
|
|
the <STRONG>makefile</STRONG> that describes the relationships among files
|
|
in your program and provides commands for updating each file.
|
|
In a program, typically, the executable file is updated from object
|
|
files, which are in turn made by compiling source files.
|
|
</P>
|
|
<P>
|
|
Once a suitable makefile exists, each time you change some source files,
|
|
this simple shell command:
|
|
|
|
</P>
|
|
|
|
<PRE>
|
|
make
|
|
</PRE>
|
|
|
|
<P>
|
|
suffices to perform all necessary recompilations. The <CODE>make</CODE> program
|
|
uses the makefile data base and the last-modification times of the files to
|
|
decide which of the files need to be updated. For each of those files, it
|
|
issues the commands recorded in the data base.
|
|
|
|
</P>
|
|
<P>
|
|
You can provide command line arguments to <CODE>make</CODE> to control which
|
|
files should be recompiled, or how. See section <A HREF="make_9.html#SEC85">How to Run <CODE>make</CODE></A>.
|
|
|
|
</P>
|
|
|
|
|
|
<H2><A NAME="SEC2" HREF="make_toc.html#TOC2">How to Read This Manual</A></H2>
|
|
|
|
<P>
|
|
If you are new to <CODE>make</CODE>, or are looking for a general
|
|
introduction, read the first few sections of each chapter, skipping the
|
|
later sections. In each chapter, the first few sections contain
|
|
introductory or general information and the later sections contain
|
|
specialized or technical information.
|
|
The exception is section <A HREF="make_2.html#SEC4">An Introduction to Makefiles</A>,
|
|
all of which is introductory.
|
|
|
|
</P>
|
|
<P>
|
|
If you are familiar with other <CODE>make</CODE> programs, see section <A HREF="make_12.html#SEC114">Features of GNU <CODE>make</CODE></A>, which lists the enhancements GNU
|
|
<CODE>make</CODE> has, and section <A HREF="make_13.html#SEC115">Incompatibilities and Missing Features</A>, which explains the few things GNU <CODE>make</CODE> lacks that
|
|
others have.
|
|
|
|
</P>
|
|
<P>
|
|
For a quick summary, see section <A HREF="make_9.html#SEC92">Summary of Options</A>, section <A HREF="make_15.html#SEC123">Quick Reference</A>,
|
|
and section <A HREF="make_4.html#SEC36">Special Built-in Target Names</A>.
|
|
|
|
</P>
|
|
|
|
|
|
<H2><A NAME="SEC3" HREF="make_toc.html#TOC3">Problems and Bugs</A></H2>
|
|
<P>
|
|
<A NAME="IDX4"></A>
|
|
<A NAME="IDX5"></A>
|
|
<A NAME="IDX6"></A>
|
|
|
|
</P>
|
|
<P>
|
|
If you have problems with GNU <CODE>make</CODE> or think you've found a bug,
|
|
please report it to the developers; we cannot promise to do anything but
|
|
we might well want to fix it.
|
|
|
|
</P>
|
|
<P>
|
|
Before reporting a bug, make sure you've actually found a real bug.
|
|
Carefully reread the documentation and see if it really says you can do
|
|
what you're trying to do. If it's not clear whether you should be able
|
|
to do something or not, report that too; it's a bug in the
|
|
documentation!
|
|
|
|
</P>
|
|
<P>
|
|
Before reporting a bug or trying to fix it yourself, try to isolate it
|
|
to the smallest possible makefile that reproduces the problem. Then
|
|
send us the makefile and the exact results <CODE>make</CODE> gave you. Also
|
|
say what you expected to occur; this will help us decide whether the
|
|
problem was really in the documentation.
|
|
|
|
</P>
|
|
<P>
|
|
Once you've got a precise problem, please send electronic mail to:
|
|
|
|
</P>
|
|
|
|
<PRE>
|
|
bug-make@gnu.org
|
|
</PRE>
|
|
|
|
<P>
|
|
Please include the version number of <CODE>make</CODE> you are using. You can
|
|
get this information with the command <SAMP>`make --version'</SAMP>.
|
|
Be sure also to include the type of machine and operating system you are
|
|
using. If possible, include the contents of the file <TT>`config.h'</TT>
|
|
that is generated by the configuration process.
|
|
|
|
</P>
|
|
<P><HR><P>
|
|
<p>Go to the first, previous, <A HREF="make_2.html">next</A>, <A HREF="make_19.html">last</A> section, <A HREF="make_toc.html">table of contents</A>.
|
|
</BODY>
|
|
</HTML>
|