<s>
In	O
software	O
development	O
,	O
Make	O
is	O
a	O
build	B-Application
automation	I-Application
tool	O
that	O
builds	O
executable	B-Application
programs	I-Application
and	O
libraries	B-Library
from	O
source	O
code	O
by	O
reading	O
files	O
called	O
Makefiles	O
which	O
specify	O
how	O
to	O
derive	O
the	O
target	O
program	O
.	O
</s>
<s>
Though	O
integrated	B-Application
development	I-Application
environments	I-Application
and	O
language-specific	O
compiler	B-Language
features	O
can	O
also	O
be	O
used	O
to	O
manage	O
a	O
build	O
process	O
,	O
Make	O
remains	O
widely	O
used	O
,	O
especially	O
in	O
Unix	B-Application
and	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
.	O
</s>
<s>
Make	O
is	O
one	O
of	O
the	O
most	O
widespread	O
dependency-tracking	O
build	O
utilities	O
,	O
primarily	O
due	O
to	O
its	O
early	O
inclusion	O
in	O
Unix	B-Application
,	O
starting	O
with	O
PWB/UNIX	B-Operating_System
1.0	O
,	O
which	O
featured	O
a	O
variety	O
of	O
tools	O
for	O
software	O
development	O
tasks	O
.	O
</s>
<s>
Feldman	O
was	O
inspired	O
to	O
write	O
Make	O
by	O
the	O
experience	O
of	O
a	O
coworker	O
in	O
futilely	O
debugging	O
a	O
program	O
of	O
his	O
where	O
the	O
executable	B-Application
was	O
accidentally	O
not	O
being	O
updated	O
with	O
changes	O
:	O
</s>
<s>
Before	O
Make	O
's	O
introduction	O
,	O
the	O
Unix	B-Application
build	B-Application
system	I-Application
most	O
commonly	O
consisted	O
of	O
operating	B-General_Concept
system	I-General_Concept
dependent	O
"	O
make	O
"	O
and	O
"	O
install	O
"	O
shell	B-Application
scripts	O
accompanying	O
their	O
program	O
's	O
source	O
code	O
.	O
</s>
<s>
Being	O
able	O
to	O
combine	O
the	O
commands	O
for	O
the	O
build	O
targets	O
into	O
a	O
single	O
file	B-Operating_System
and	O
being	O
able	O
to	O
abstract	O
dependency	O
tracking	O
and	O
archive	O
handling	O
was	O
an	O
important	O
step	O
in	O
the	O
direction	O
of	O
modern	O
build	O
environments	O
.	O
</s>
<s>
Make	O
has	O
been	O
rewritten	O
numerous	O
times	O
,	O
including	O
new	O
implementations	O
that	O
use	O
the	O
same	O
file	B-Operating_System
format	O
and	O
basic	O
algorithmic	O
principles	O
and	O
also	O
provide	O
non-standard	O
enhancements	O
.	O
</s>
<s>
In	O
December	O
2006	O
,	O
Sun	O
DevPro	O
Make	O
was	O
made	O
open	O
source	O
as	O
part	O
of	O
the	O
efforts	O
to	O
open-source	O
Solaris	B-Application
.	O
</s>
<s>
dmake	O
or	O
Distributed	O
Make	O
that	O
came	O
with	O
Sun	B-Application
Solaris	I-Application
Studio	O
as	O
its	O
default	O
Make	O
,	O
but	O
not	O
the	O
default	O
one	O
on	O
the	O
Solaris	B-Application
Operating	I-Application
System	I-Application
(	O
SunOS	O
)	O
.	O
</s>
<s>
It	O
was	O
originally	O
required	O
to	O
build	O
OpenOffice	B-Application
,	O
but	O
in	O
2009	O
the	O
build	B-Application
system	I-Application
was	O
rewritten	O
to	O
use	O
GNU	B-Operating_System
Make	O
.	O
</s>
<s>
While	O
Apache	B-Application
OpenOffice	I-Application
still	O
contains	O
a	O
mixture	O
of	O
both	O
build	B-Application
systems	I-Application
,	O
the	O
much	O
more	O
actively	O
developed	O
LibreOffice	B-Application
only	O
uses	O
the	O
modernized	O
"	O
gbuild	O
"	O
now	O
.	O
</s>
<s>
BSD	B-Operating_System
Make	O
(	O
pmake	O
,	O
bmake	O
or	O
fmake	O
)	O
,	O
which	O
is	O
derived	O
from	O
Adam	O
de	O
Boor	O
's	O
work	O
on	O
a	O
version	O
of	O
Make	O
capable	O
of	O
building	O
targets	O
in	O
parallel	B-Operating_System
,	O
and	O
survives	O
with	O
varying	O
degrees	O
of	O
modification	O
in	O
FreeBSD	B-Operating_System
,	O
NetBSD	B-Device
and	O
OpenBSD	B-Operating_System
.	O
</s>
<s>
GNU	B-Operating_System
Make	O
(	O
short	O
gmake	O
)	O
is	O
the	O
standard	O
implementation	O
of	O
Make	O
for	O
Linux	O
and	O
macOS	O
.	O
</s>
<s>
It	O
also	O
provides	O
many	O
built-in	O
functions	O
which	O
can	O
be	O
used	O
to	O
eliminate	O
the	O
need	O
for	O
shell-scripting	O
in	O
the	O
makefile	O
rules	O
as	O
well	O
as	O
to	O
manipulate	O
the	O
variables	O
set	O
and	O
used	O
in	O
the	O
makefile	O
.	O
</s>
<s>
GNU	B-Operating_System
Make	O
is	O
required	O
for	O
building	O
many	O
software	O
systems	O
,	O
including	O
GCC	B-Application
(	O
since	O
version	O
3.4	O
)	O
,	O
the	O
Linux	O
kernel	O
,	O
Apache	B-Application
OpenOffice	I-Application
,	O
LibreOffice	B-Application
,	O
and	O
Mozilla	B-Application
Firefox	I-Application
.	O
</s>
<s>
Rocky	O
Bernstein	O
's	O
Remake	O
is	O
a	O
fork	O
of	O
GNU	B-Operating_System
Make	O
and	O
provides	O
several	O
extensions	O
over	O
GNU	B-Operating_System
Make	O
,	O
such	O
as	O
better	O
location	O
and	O
error-location	O
reporting	O
,	O
execution	O
tracing	O
,	O
execution	O
profiling	O
,	O
and	O
it	O
contains	O
a	O
debugger	O
.	O
</s>
<s>
Microsoft	O
nmake	O
,	O
a	O
command-line	O
tool	O
which	O
normally	O
is	O
part	O
of	O
Visual	B-Application
Studio	I-Application
.	O
</s>
<s>
Inference	O
rules	O
differ	O
from	O
Make	O
;	O
for	O
example	O
they	O
can	O
include	B-Language
search	O
paths	O
.	O
</s>
<s>
Qt	B-Language
Project	I-Language
's	O
Jom	O
tool	O
is	O
a	O
clone	O
of	O
nmake	O
.	O
</s>
<s>
Mk	O
replaced	O
Make	O
in	O
Research	B-Operating_System
Unix	I-Operating_System
,	O
starting	O
from	O
version	O
9	O
.	O
</s>
<s>
Mk	O
became	O
the	O
standard	O
build	B-Application
tool	I-Application
in	O
Plan	B-Operating_System
9	I-Operating_System
,	O
Bell	O
Labs	O
 '	O
intended	O
successor	O
to	O
Unix	B-Application
.	O
</s>
<s>
Kati	O
is	O
Google	O
's	O
replacement	O
of	O
GNU	B-Operating_System
Make	O
,	O
used	O
in	O
Android	B-Application
OS	I-Application
builds	O
.	O
</s>
<s>
It	O
translates	O
the	O
makefile	O
into	O
ninja	B-Application
for	O
faster	O
incremental	O
builds	O
.	O
</s>
<s>
Snakemake	O
is	O
a	O
python-driven	O
implementation	O
for	O
compiling	B-Language
and	O
running	O
bioinformatics	O
workflows	O
.	O
</s>
<s>
POSIX	O
includes	O
standardization	O
of	O
the	O
basic	O
features	O
and	O
operation	O
of	O
the	O
Make	O
utility	O
,	O
and	O
is	O
implemented	O
with	O
varying	O
degrees	O
of	O
completeness	O
in	O
Unix-based	O
versions	O
of	O
Make	O
.	O
</s>
<s>
GNU	B-Operating_System
Make	O
,	O
Makepp	O
and	O
some	O
versions	O
of	O
BSD	B-Operating_System
Make	O
default	O
to	O
looking	O
first	O
for	O
files	O
named	O
"	O
GNUmakefile	O
"	O
,	O
"	O
Makeppfile	O
"	O
and	O
"	O
BSDmakefile	O
"	O
respectively	O
,	O
which	O
allows	O
one	O
to	O
put	O
makefiles	O
which	O
use	O
implementation-defined	O
behavior	O
in	O
separate	O
locations	O
.	O
</s>
<s>
Make	O
is	O
typically	O
used	O
to	O
build	O
executable	B-Application
programs	I-Application
and	O
libraries	B-Library
from	O
source	O
code	O
.	O
</s>
<s>
Generally	O
though	O
,	O
Make	O
is	O
applicable	O
to	O
any	O
process	O
that	O
involves	O
executing	O
arbitrary	O
commands	O
to	O
transform	O
a	O
source	O
file	B-Operating_System
to	O
a	O
target	O
result	O
.	O
</s>
<s>
For	O
example	O
,	O
Make	O
could	O
be	O
used	O
to	O
detect	O
a	O
change	O
made	O
to	O
an	O
image	O
file	B-Operating_System
(	O
the	O
source	O
)	O
and	O
the	O
transformation	O
actions	O
might	O
be	O
to	O
convert	O
the	O
file	B-Operating_System
to	O
some	O
specific	O
format	O
,	O
copy	B-Device
the	O
result	O
into	O
a	O
content	O
management	O
system	O
,	O
and	O
then	O
send	O
e-mail	O
to	O
a	O
set	O
of	O
users	O
indicating	O
that	O
the	O
actions	O
were	O
performed	O
.	O
</s>
<s>
Make	O
decides	O
whether	O
a	O
target	O
needs	O
to	O
be	O
regenerated	O
by	O
comparing	O
file	B-Operating_System
modification	O
times	O
.	O
</s>
<s>
This	O
solves	O
the	O
problem	O
of	O
avoiding	O
the	O
building	O
of	O
files	O
which	O
are	O
already	O
up	O
to	O
date	O
,	O
but	O
it	O
fails	O
when	O
a	O
file	B-Operating_System
changes	O
but	O
its	O
modification	O
time	O
stays	O
in	O
the	O
past	O
.	O
</s>
<s>
Such	O
changes	O
could	O
be	O
caused	O
by	O
restoring	O
an	O
older	O
version	O
of	O
a	O
source	O
file	B-Operating_System
,	O
or	O
when	O
a	O
network	B-Protocol
filesystem	I-Protocol
is	O
a	O
source	O
of	O
files	O
and	O
its	O
clock	O
or	O
time	O
zone	O
is	O
not	O
synchronized	O
with	O
the	O
machine	O
running	O
Make	O
.	O
</s>
<s>
Conversely	O
,	O
if	O
a	O
source	O
file	B-Operating_System
's	O
modification	O
time	O
is	O
in	O
the	O
future	O
,	O
it	O
triggers	O
unnecessary	O
rebuilding	O
,	O
which	O
may	O
inconvenience	O
users	O
.	O
</s>
<s>
Makefiles	O
are	O
traditionally	O
used	O
for	O
compiling	B-Language
code	O
( *	O
.c	B-Language
,	O
*	O
.cc	O
,	O
*	O
.C	B-Language
,	O
etc	O
.	O
</s>
<s>
Make	O
searches	O
the	O
current	O
directory	O
for	O
a	O
makefile	O
,	O
e.g.	O
,	O
GNU	B-Operating_System
Make	O
searches	O
files	O
in	O
order	O
for	O
a	O
file	B-Operating_System
named	O
one	O
of	O
,	O
,	O
or	O
.	O
</s>
<s>
and	O
then	O
invokes	O
the	O
specified	O
(	O
or	O
default	O
)	O
target(s )	O
from	O
that	O
file	B-Operating_System
.	O
</s>
<s>
The	O
makefile	O
language	O
is	O
similar	O
to	O
declarative	B-Language
programming	I-Language
.	O
</s>
<s>
This	O
class	O
of	O
language	O
,	O
in	O
which	O
necessary	O
end	O
conditions	O
are	O
described	O
but	O
the	O
order	O
in	O
which	O
actions	O
are	O
to	O
be	O
taken	O
is	O
not	O
important	O
,	O
is	O
sometimes	O
confusing	O
to	O
programmers	O
used	O
to	O
imperative	B-Application
programming	I-Application
.	O
</s>
<s>
A	O
common	O
problem	O
in	O
build	B-Application
automation	I-Application
is	O
the	O
tailoring	O
of	O
a	O
build	O
process	O
to	O
a	O
given	O
platform	B-Device
.	O
</s>
<s>
For	O
example	O
,	O
the	O
compiler	B-Language
used	O
on	O
one	O
platform	B-Device
might	O
not	O
accept	O
the	O
same	O
options	O
as	O
the	O
one	O
used	O
on	O
another	O
.	O
</s>
<s>
This	O
problem	O
is	O
typically	O
handled	O
by	O
generating	O
platform-specific	O
build	O
instructions	O
,	O
which	O
in	O
turn	O
are	O
processed	O
by	O
Make	O
.	O
</s>
<s>
Common	O
tools	O
for	O
this	O
process	O
are	O
Autoconf	B-Application
,	O
CMake	B-Language
or	O
GYP	B-Operating_System
(	O
or	O
more	O
advanced	O
NG	B-Application
)	O
.	O
</s>
<s>
It	O
describes	O
how	O
a	O
target	O
may	O
depend	O
on	O
a	O
file	B-Operating_System
with	O
a	O
name	O
similar	O
to	O
the	O
target	O
and	O
gives	O
a	O
recipe	O
to	O
create	O
or	O
update	O
such	O
a	O
target	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
C	B-Language
.o	B-Application
object	B-Application
file	I-Application
is	O
created	O
from	O
.c	B-Language
files	O
,	O
so	O
.c	B-Language
files	O
come	O
first	O
(	O
i.e.	O
</s>
<s>
specific	O
object	B-Application
file	I-Application
target	O
depends	O
on	O
a	O
C	B-Language
source	O
file	B-Operating_System
and	O
header	B-Language
files	I-Language
)	O
.	O
</s>
<s>
It	O
is	O
possible	O
to	O
write	O
makefiles	O
which	O
generate	O
these	O
dependencies	O
by	O
calling	O
third-party	O
tools	O
,	O
and	O
some	O
makefile	O
generators	O
,	O
such	O
as	O
the	O
Automake	B-Application
toolchain	O
provided	O
by	O
the	B-Application
GNU	I-Application
Project	I-Application
,	O
can	O
do	O
so	O
automatically	O
.	O
</s>
<s>
The	O
GNU	B-Operating_System
Make	O
documentation	O
refers	O
to	O
the	O
commands	O
associated	O
with	O
a	O
rule	O
as	O
a	O
"	O
recipe	O
"	O
.	O
</s>
<s>
Make	O
can	O
decide	O
where	O
to	O
start	O
through	O
topological	B-Algorithm
sorting	I-Algorithm
.	O
</s>
<s>
This	O
aspect	O
of	O
the	O
syntax	O
of	O
makefiles	O
is	O
often	O
subject	O
to	O
criticism	O
;	O
it	O
has	O
been	O
described	O
by	O
Eric	O
S	O
.	O
Raymond	O
as	O
"	O
one	O
of	O
the	O
worst	O
design	O
botches	O
in	O
the	O
history	O
of	O
Unix	B-Application
"	O
and	O
The	O
Unix-Haters	O
Handbook	O
said	O
"	O
using	O
tabs	O
as	O
part	O
of	O
the	O
syntax	O
is	O
like	O
one	O
of	O
those	O
pungee	O
stick	O
traps	O
in	O
The	O
Green	O
Berets	O
"	O
.	O
</s>
<s>
Feldman	O
explains	O
the	O
choice	O
as	O
caused	O
by	O
a	O
workaround	O
for	O
an	O
early	O
implementation	O
difficulty	O
preserved	O
by	O
a	O
desire	O
for	O
backward	B-General_Concept
compatibility	I-General_Concept
with	O
the	O
very	O
first	O
users	O
:	O
</s>
<s>
GNU	B-Operating_System
Make	O
.	O
</s>
<s>
Each	O
command	O
is	O
executed	O
by	O
a	O
separate	O
shell	B-Application
or	O
command-line	O
interpreter	O
instance	O
.	O
</s>
<s>
Since	O
operating	B-General_Concept
systems	I-General_Concept
use	O
different	O
command-line	O
interpreters	O
this	O
can	O
lead	O
to	O
unportable	O
makefiles	O
.	O
</s>
<s>
For	O
example	O
,	O
GNU	B-Operating_System
Make	O
(	O
all	O
POSIX	O
Makes	O
)	O
executes	O
commands	O
with	O
/bin/sh	B-Device
by	O
default	O
,	O
where	O
Unix	B-Application
commands	O
like	O
cp	B-Application
are	O
normally	O
used	O
.	O
</s>
<s>
In	O
contrast	O
to	O
that	O
,	O
Microsoft	O
's	O
nmake	O
executes	O
commands	O
with	O
cmd.exe	O
where	O
batch	O
commands	O
like	O
copy	B-Device
are	O
available	O
but	O
not	O
necessarily	O
cp	B-Application
.	O
</s>
<s>
The	O
rule	O
above	O
would	O
be	O
triggered	O
when	O
Make	O
updates	O
"	O
file.txt	O
"	O
.	O
</s>
<s>
In	O
the	O
following	O
invocation	O
,	O
Make	O
would	O
typically	O
use	O
this	O
rule	O
to	O
update	O
the	O
"	O
file.txt	O
"	O
target	O
if	O
"	O
file.html	O
"	O
were	O
newer	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
macro	O
is	O
frequently	O
used	O
in	O
makefiles	O
to	O
refer	O
to	O
the	O
location	O
of	O
a	O
C	B-Language
compiler	B-Language
,	O
and	O
the	O
user	O
may	O
wish	O
to	O
specify	O
a	O
particular	O
compiler	B-Language
to	O
use	O
.	O
</s>
<s>
,	O
which	O
is	O
the	O
style	O
used	O
in	O
the	O
BSDs	B-Operating_System
.	O
</s>
<s>
Macros	O
can	O
be	O
composed	O
of	O
shell	B-Application
commands	O
by	O
using	O
the	O
command	B-Device
substitution	I-Device
operator	O
,	O
denoted	O
by	O
backticks	O
(	O
)	O
.	O
</s>
<s>
It	O
works	O
on	O
BSD	B-Operating_System
and	O
GNU	B-Operating_System
makes	O
alike	O
.	O
</s>
<s>
Suffix	O
rules	O
have	O
"	O
targets	O
"	O
with	O
names	O
in	O
the	O
form	O
and	O
are	O
used	O
to	O
launch	O
actions	O
based	O
on	O
file	B-Operating_System
extension	O
.	O
</s>
<s>
In	O
this	O
example	O
,	O
which	O
converts	O
any	O
HTML	O
file	B-Operating_System
into	O
text	O
,	O
the	O
shell	B-Application
redirection	O
token	O
is	O
part	O
of	O
the	O
command	O
line	O
whereas	O
is	O
a	O
macro	O
referring	O
to	O
the	O
HTML	O
file	B-Operating_System
:	O
</s>
<s>
GNU	B-Operating_System
Make	O
supports	O
suffix	O
rules	O
for	O
compatibility	O
with	O
old	O
makefiles	O
but	O
otherwise	O
encourages	O
usage	O
of	O
pattern	O
rules	O
.	O
</s>
<s>
The	O
target	O
is	O
considered	O
a	O
pattern	O
for	O
matching	O
file	B-Operating_System
names	O
:	O
the	O
can	O
match	O
any	O
substring	O
of	O
zero	O
or	O
more	O
characters	O
,	O
while	O
other	O
characters	O
match	O
only	O
themselves	O
.	O
</s>
<s>
Some	O
directives	O
in	O
makefiles	O
can	O
include	B-Language
other	O
makefiles	O
.	O
</s>
<s>
Below	O
is	O
a	O
very	O
simple	O
makefile	O
that	O
by	O
default	O
(	O
the	O
"	O
all	O
"	O
rule	O
is	O
listed	O
first	O
)	O
compiles	B-Language
a	O
source	O
file	B-Operating_System
called	O
"	O
helloworld.c	O
"	O
using	O
the	O
system	O
's	O
C	B-Language
compiler	B-Language
and	O
also	O
provides	O
a	O
"	O
clean	O
"	O
target	O
to	O
remove	O
the	O
generated	O
files	O
if	O
the	O
user	O
desires	O
to	O
start	O
over	O
.	O
</s>
<s>
Many	O
systems	O
come	O
with	O
predefined	O
Make	O
rules	O
and	O
macros	O
to	O
specify	O
common	O
tasks	O
such	O
as	O
compilation	B-Language
based	O
on	O
file	B-Operating_System
suffix	O
.	O
</s>
<s>
That	O
"	O
helloworld.o	O
"	O
depends	O
on	O
"	O
helloworld.c	O
"	O
is	O
now	O
automatically	O
handled	O
by	O
Make	O
.	O
</s>
<s>
One	O
only	O
has	O
to	O
write	O
a	O
rule	O
for	O
the	O
linking	O
step	O
and	O
declare	O
the	O
object	B-Application
files	I-Application
as	O
prerequisites	O
.	O
</s>
<s>
Make	O
will	O
then	O
implicitly	O
determine	O
how	O
to	O
make	O
all	O
the	O
object	B-Application
files	I-Application
and	O
look	O
for	O
changes	O
in	O
all	O
the	O
source	O
files	O
.	O
</s>
<s>
Simple	O
suffix	O
rules	O
work	O
well	O
as	O
long	O
as	O
the	O
source	O
files	O
do	O
not	O
depend	O
on	O
each	O
other	O
and	O
on	O
other	O
files	O
such	O
as	O
header	B-Language
files	I-Language
.	O
</s>
<s>
Another	O
route	O
to	O
simplify	O
the	O
build	O
process	O
is	O
to	O
use	O
so-called	O
pattern	O
matching	O
rules	O
that	O
can	O
be	O
combined	O
with	O
compiler-assisted	O
dependency	O
generation	O
.	O
</s>
<s>
As	O
a	O
final	O
example	O
requiring	O
the	O
gcc	B-Application
compiler	I-Application
and	O
GNU	B-Operating_System
Make	O
,	O
here	O
is	O
a	O
generic	O
makefile	O
that	O
compiles	B-Language
all	O
C	B-Language
files	O
in	O
a	O
folder	O
to	O
the	O
corresponding	O
object	B-Application
files	I-Application
and	O
then	O
links	O
them	O
to	O
the	O
final	O
executable	B-Application
.	O
</s>
<s>
Before	O
compilation	B-Language
takes	O
place	O
,	O
dependencies	O
are	O
gathered	O
in	O
makefile-friendly	O
format	O
into	O
a	O
hidden	O
file	B-Operating_System
"	O
.depend	O
"	O
that	O
is	O
then	O
included	O
to	O
the	O
makefile	O
.	O
</s>
