<s>
makedepend	B-Device
is	O
a	O
Unix	B-Application
tool	O
used	O
to	O
generate	O
dependencies	B-Application
of	O
C	B-Language
source	O
files	O
.	O
</s>
<s>
A	O
Microsoft	B-Application
Windows	I-Application
version	O
was	O
made	O
available	O
in	O
2002	O
and	O
last	O
updated	O
in	O
2007	O
on	O
UnxUtils	B-Application
.	O
</s>
<s>
makedepend	B-Device
was	O
developed	O
as	O
part	O
of	O
MIT	O
's	O
Project	B-Operating_System
Athena	I-Operating_System
.	O
</s>
<s>
It	O
was	O
used	O
extensively	O
in	O
building	O
X11	B-Operating_System
and	O
ancillary	O
packages	O
,	O
but	O
has	O
since	O
become	O
superseded	O
by	O
the	O
dependency	B-Application
generation	O
facilities	O
of	O
various	O
compilers	B-Language
,	O
and	O
is	O
now	O
used	O
primarily	O
as	O
a	O
worst-case	O
fallback	O
,	O
e.g.	O
</s>
<s>
by	O
depcomp	O
and	O
GNU	B-Application
Automake	I-Application
.	O
</s>
<s>
makedepend	B-Device
is	O
invoked	O
with	O
a	O
list	O
of	O
sourcefiles	O
:	O
</s>
<s>
makedepend	B-Device
 [ options ] 	O
foo.c	O
bar.c	O
...	O
</s>
<s>
However	O
,	O
it	O
is	O
more	O
often	O
invoked	O
as	O
a	O
target	O
from	O
a	O
makefile	B-Application
,	O
typically	O
under	O
the	O
depend	O
target	O
,	O
such	O
that	O
make	B-Application
depend	O
will	O
invoke	O
makedepend	B-Device
on	O
all	O
source	O
files	O
in	O
the	O
project	O
.	O
</s>
<s>
When	O
building	O
C	B-Language
language	I-Language
projects	O
,	O
it	O
is	O
imperative	O
for	O
incremental	O
compilation	B-Language
(	O
and	O
useful	O
for	O
clean	O
compilation	B-Language
)	O
to	O
be	O
able	O
to	O
track	O
dependencies	B-Application
between	O
compilation	B-Language
units	I-Language
.	O
</s>
<s>
C	B-Language
expresses	O
interfaces	O
between	O
compilation	B-Language
units	I-Language
via	O
header	B-Language
files	I-Language
;	O
as	O
such	O
,	O
it	O
is	O
often	O
necessary	O
to	O
rebuild	O
a	O
compilation	B-Language
unit	I-Language
when	O
a	O
header	O
it	O
includes	O
is	O
changed	O
.	O
</s>
<s>
make	B-Application
needs	O
to	O
be	O
informed	O
of	O
these	O
dependencies	B-Application
.	O
</s>
<s>
makedepend	B-Device
solves	O
this	O
problem	O
by	O
parsing	O
the	O
code	O
of	O
C	B-Language
source	O
files	O
to	O
generate	O
a	O
list	O
of	O
dependencies	B-Application
(	O
those	O
header	B-Language
files	I-Language
included	O
directly	O
and	O
indirectly	O
)	O
.	O
</s>
<s>
It	O
is	O
able	O
to	O
understand	O
conditional	B-Application
compilation	I-Application
constructs	O
so	O
as	O
to	O
not	O
generate	O
excessive	O
dependencies	B-Application
.	O
</s>
<s>
It	O
then	O
appends	O
rules	O
expressing	O
the	O
dependencies	B-Application
to	O
the	O
Makefile	B-Application
.	O
</s>
<s>
Much	O
modern	O
source	O
code	O
uses	O
"	O
conditional	B-Application
compilation	I-Application
"	O
to	O
control	O
which	O
part	O
of	O
the	O
source	O
code	O
to	O
be	O
used	O
based	O
on	O
C	B-Language
pre-processor	O
symbols	O
defined	O
by	O
the	O
compiler	B-Language
.	O
</s>
<s>
These	O
symbols	O
may	O
state	O
the	O
compiler	B-Language
name	O
or	O
family	O
,	O
version	O
number	O
,	O
operating	O
system	O
,	O
and	O
word	O
size	O
.	O
</s>
<s>
However	O
,	O
makedepend	B-Device
is	O
n't	O
itself	O
a	O
compiler	B-Language
and	O
defines	O
no	O
such	O
symbols	O
,	O
so	O
the	O
output	O
may	O
be	O
incorrect	O
.	O
</s>
<s>
Further	O
,	O
some	O
code	O
will	O
purposefully	O
produce	O
an	O
explicit	O
error	O
if	O
it	O
cannot	O
recognize	O
any	O
supported	O
compiler	B-Language
,	O
and	O
thus	O
will	O
not	O
be	O
usable	O
by	O
makedepend	B-Device
at	O
all	O
.	O
</s>
<s>
Most	O
modern	O
compilers	B-Language
provide	O
a	O
flag	O
(	O
often	O
-M	O
)	O
that	O
uses	O
the	O
compiler	B-Language
's	O
own	O
source	O
parser	O
to	O
generate	O
a	O
list	O
of	O
dependencies	B-Application
.	O
</s>
<s>
This	O
may	O
be	O
preferred	O
to	O
makedepend	B-Device
because	O
it	O
reduces	O
the	O
likelihood	O
of	O
the	O
dependencies	B-Application
generated	O
being	O
at	O
odds	O
with	O
the	O
compiler	B-Language
's	O
own	O
behavior	O
.	O
</s>
<s>
Since	O
compilers	B-Language
accept	O
different	O
flags	O
for	O
dependency	B-Application
generation	O
,	O
and	O
may	O
behave	O
differently	O
in	O
outputting	O
dependency	B-Application
information	O
,	O
it	O
is	O
desirable	O
to	O
use	O
a	O
wrapper	O
script	O
that	O
can	O
invoke	O
the	O
compiler	B-Language
appropriately	O
(	O
and	O
fall	O
back	O
to	O
makedepend	B-Device
if	O
necessary	O
)	O
.	O
</s>
<s>
One	O
popular	O
such	O
wrapper	O
script	O
is	O
depcomp	O
,	O
which	O
is	O
distributed	O
with	O
and	O
used	O
by	O
GNU	B-Application
Automake	I-Application
.	O
</s>
<s>
Solaris	O
make	B-Application
includes	O
support	O
for	O
dependency	B-Application
tracking	O
that	O
is	O
activated	O
by	O
specifying	O
the	O
"	O
special-function	O
target	O
"	O
.KEEP_STATE	O
.	O
</s>
