<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://robots.hlt.inesc-id.pt/w/pt/index.php?action=history&amp;feed=atom&amp;title=Tools_and_Development_Environment_%28make%29</id>
	<title>Tools and Development Environment (make) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://robots.hlt.inesc-id.pt/w/pt/index.php?action=history&amp;feed=atom&amp;title=Tools_and_Development_Environment_%28make%29"/>
	<link rel="alternate" type="text/html" href="https://robots.hlt.inesc-id.pt/w/pt/index.php?title=Tools_and_Development_Environment_(make)&amp;action=history"/>
	<updated>2026-05-23T19:15:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://robots.hlt.inesc-id.pt/w/pt/index.php?title=Tools_and_Development_Environment_(make)&amp;diff=15609&amp;oldid=prev</id>
		<title>Root at 10:45, 20 April 2023</title>
		<link rel="alternate" type="text/html" href="https://robots.hlt.inesc-id.pt/w/pt/index.php?title=Tools_and_Development_Environment_(make)&amp;diff=15609&amp;oldid=prev"/>
		<updated>2023-04-20T10:45:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:45, 20 April 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{TOCright}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{TOCright}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following examples describe how to use the [http://www.gnu.org/software/make/ make] &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;and [http://www.nongnu.org/cvs/ cvs] tools&lt;/del&gt;. This very short guide is not intended as a replacement for the corresponding &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;manuals&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following examples describe how to use the [http://www.gnu.org/software/make/ make] &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tool&lt;/ins&gt;. This very short guide is not intended as a replacement for the corresponding &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;manual&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Make ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Make ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Root</name></author>
	</entry>
	<entry>
		<id>https://robots.hlt.inesc-id.pt/w/pt/index.php?title=Tools_and_Development_Environment_(make)&amp;diff=15608&amp;oldid=prev</id>
		<title>Root: /* Examples */</title>
		<link rel="alternate" type="text/html" href="https://robots.hlt.inesc-id.pt/w/pt/index.php?title=Tools_and_Development_Environment_(make)&amp;diff=15608&amp;oldid=prev"/>
		<updated>2023-04-20T10:44:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Examples&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:44, 20 April 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l96&quot;&gt;Line 96:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 96:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Examples ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Examples ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* See the makefiles in the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Makefile examples: CDK3|CDK3]]&lt;/del&gt;, RTS, and &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Makefile examples: Compact|Compact]] distributions&lt;/del&gt;: those makefiles perform various tasks and use many of the described features.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* See the makefiles in the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;CDK&lt;/ins&gt;, RTS, and &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;example compilers&lt;/ins&gt;: those makefiles perform various tasks and use many of the described features.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* See also the toy examples below.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* See also the toy examples below.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:Compiladores]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:Compiladores]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:Ensino]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:Ensino]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Root</name></author>
	</entry>
	<entry>
		<id>https://robots.hlt.inesc-id.pt/w/pt/index.php?title=Tools_and_Development_Environment_(make)&amp;diff=15607&amp;oldid=prev</id>
		<title>Root: Created page with &quot;{{TOCright}} The following examples describe how to use the [http://www.gnu.org/software/make/ make] and [http://www.nongnu.org/cvs/ cvs] tools. This very short guide is not i...&quot;</title>
		<link rel="alternate" type="text/html" href="https://robots.hlt.inesc-id.pt/w/pt/index.php?title=Tools_and_Development_Environment_(make)&amp;diff=15607&amp;oldid=prev"/>
		<updated>2023-04-20T10:44:02Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{TOCright}} The following examples describe how to use the [http://www.gnu.org/software/make/ make] and [http://www.nongnu.org/cvs/ cvs] tools. This very short guide is not i...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{TOCright}}&lt;br /&gt;
The following examples describe how to use the [http://www.gnu.org/software/make/ make] and [http://www.nongnu.org/cvs/ cvs] tools. This very short guide is not intended as a replacement for the corresponding manuals.&lt;br /&gt;
&lt;br /&gt;
== Make ==&lt;br /&gt;
&lt;br /&gt;
Make is a utility for building and maintaining programs. In a more general definition, it can be described as a dependency management tool (in the sense that is controls how targets are updated when dependencies change).&lt;br /&gt;
&lt;br /&gt;
Make is especially useful for managing large programs, in which multiple, often not obvious, dependencies occur.&lt;br /&gt;
&lt;br /&gt;
In general, make reads its rules from a &amp;quot;makefile&amp;quot;, but it may be built with implicit rules for frequently used tasks. A makefile is a sequence of definitions (of variables, rules, and directives). The first explicit rule is the default (i.e., the one whose target is to be built if no target is specified).&lt;br /&gt;
&lt;br /&gt;
Below, the most usual features are covered (other features, such as conditionals and cycles are not, since they are not of special interest in most cases).&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
&lt;br /&gt;
Make variables may be initialized with literals or with the result of commands. The following definitions have the same result (assuming that the directory contains source files named &amp;lt;tt&amp;gt;file1.src&amp;lt;/tt&amp;gt; through &amp;lt;tt&amp;gt;fileN.src&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  SRCFILES = file1.src file2.src ... fileN.src   &amp;lt;----- literal initialization&lt;br /&gt;
  SRCFILES = $(wildcard *.src)                   &amp;lt;----- wildcard initialization&lt;br /&gt;
  SRCFILES = $(shell ls *.src)                   &amp;lt;----- use output of shell command&lt;br /&gt;
&lt;br /&gt;
Access to a variable is done by using the &amp;lt;tt&amp;gt;$&amp;lt;/tt&amp;gt; sign followed by a single character (if the variable name has more than one character, then it must appear in parenthesis). In addition to user-defined variables, make also defines automatic (pseudo-)variables (the list is not exhaustive).&lt;br /&gt;
&lt;br /&gt;
  $(SRCFILES)    &amp;lt;----- access to variable SRCFILES&lt;br /&gt;
  $&amp;lt;             &amp;lt;----- first dependency (pseudo-variable)&lt;br /&gt;
  $^             &amp;lt;----- all dependencies (pseudo-variable)&lt;br /&gt;
  $*             &amp;lt;----- pattern match (pseudo-variable)&lt;br /&gt;
  $@             &amp;lt;----- current target name (pseudo-variable)&lt;br /&gt;
&lt;br /&gt;
Some variables are pre-defined by most make distributions. These are normal variables and may be redefined by the user. The following list shows some of the most common (the list is not exhaustive).&lt;br /&gt;
&lt;br /&gt;
* CXX, CXXFLAGS - the C++ compiler and corresponding compilation flags&lt;br /&gt;
* CC, CFLAGS  - the C compiler and corresponding compilation flags&lt;br /&gt;
&lt;br /&gt;
A variable may be defined based on another: for instance, considering the above &amp;lt;tt&amp;gt;SRCFILES&amp;lt;/tt&amp;gt; variable, we could define a new list by editing the previous one, replacing the &amp;lt;tt&amp;gt;.src&amp;lt;/tt&amp;gt; with another (in our example, with &amp;lt;tt&amp;gt;.der&amp;lt;/tt&amp;gt;, for &amp;quot;derived&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
  DERFILES = $(SRCFILES:%.src=%.der)&lt;br /&gt;
&lt;br /&gt;
=== Rules ===&lt;br /&gt;
&lt;br /&gt;
The general syntax of a rule is as follows (&amp;lt;tt&amp;gt;target&amp;lt;/tt&amp;gt; is supposed to be &amp;quot;built&amp;quot; by the commands 1 though N):&lt;br /&gt;
&lt;br /&gt;
  target: dependency1 dependency2 ... dependencyK&lt;br /&gt;
          command1&lt;br /&gt;
          command2&lt;br /&gt;
          ...&lt;br /&gt;
          commandN&lt;br /&gt;
&lt;br /&gt;
There are two types of rules: implicit, which make uses for derived building targets from derived (calculated) dependencies; and explicit, in which both targets and dependencies are specified.&lt;br /&gt;
&lt;br /&gt;
The following is an example of an implicit rule for obtaining a compiled (.o) file from a C++ (.cpp) source, by simple compilation. Variable &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; is used to specify compilation flags and &amp;lt;tt&amp;gt;CXX&amp;lt;/tt&amp;gt; is the compiler&amp;#039;s name (&amp;lt;tt&amp;gt;g++&amp;lt;/tt&amp;gt; by default).&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS=-ggdb -O3&lt;br /&gt;
 &lt;br /&gt;
  %.o: %.cpp&lt;br /&gt;
          $(CXX) $(CXXFLAGS) -c $*.c -o $*.o&lt;br /&gt;
&lt;br /&gt;
In this rule, &amp;lt;tt&amp;gt;%&amp;lt;/tt&amp;gt; represents a pattern (the same pattern appears in the commands section represented by the &amp;lt;tt&amp;gt;$*&amp;lt;/tt&amp;gt; pseudo-variable).&lt;br /&gt;
&lt;br /&gt;
The same rule could be written thus (here &amp;lt;tt&amp;gt;$&amp;amp;lt;&amp;lt;/tt&amp;gt; represents the first dependency, and &amp;lt;tt&amp;gt;$@&amp;lt;/tt&amp;gt; the target to be built by the rule):&lt;br /&gt;
&lt;br /&gt;
  %.o: %.cpp&lt;br /&gt;
          $(CXX) $(CXXFLAGS) -c $&amp;lt; -o $@&lt;br /&gt;
 &lt;br /&gt;
  a.o: a.cpp x.h  y.h&lt;br /&gt;
  b.o: b.cpp x.h&lt;br /&gt;
          $(CXX) -DSPECIAL $(CXXFLAGS) -c $&amp;lt; -o $@&lt;br /&gt;
&lt;br /&gt;
Additional dependencies cannot be specified in the above rule, but, since make accumulates the dependencies for a given target, additional dependencies may be specified by compatible rules. These additional rules do not need a section with commands (the commands in the implicit rule will be used). Nevertheless, if there are commands in both an implicit and an explicit rule, the explicit&amp;#039;s are used. In the first example, &amp;lt;tt&amp;gt;a.cpp&amp;lt;/tt&amp;gt; would depend on &amp;lt;tt&amp;gt;x.h&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y.h&amp;lt;/tt&amp;gt;, while &amp;lt;tt&amp;gt;b.cpp&amp;lt;/tt&amp;gt; would depend on just &amp;lt;tt&amp;gt;x.h&amp;lt;/tt&amp;gt; and use a special compilation command.&lt;br /&gt;
&lt;br /&gt;
Comparable explicit rules would be:&lt;br /&gt;
&lt;br /&gt;
  a.o: a.cpp x.h y.h&lt;br /&gt;
          $(CXX) $(CXXFLAGS) -c $&amp;lt; -o $@&lt;br /&gt;
 &lt;br /&gt;
  b.o: b.cpp x.h&lt;br /&gt;
          $(CXX) -DSPECIAL $(CXXFLAGS) -c $&amp;lt; -o $@&lt;br /&gt;
&lt;br /&gt;
Note that in the case of implicit rules (the most frequent), file dependencies can be computed automatically, for instance with GCC. The following examples assume that all files are in the current directory. If they are not, then the second set of examples could be used (&amp;lt;tt&amp;gt;CXXFILES&amp;lt;/tt&amp;gt; is a variable containing the list of C++ source files:&lt;br /&gt;
&lt;br /&gt;
  g++ -M  *.cpp              &amp;lt;--- computes all dependencies (system and local)&lt;br /&gt;
  g++ -MM *.cpp              &amp;lt;--- computes all dependencies (only local dependencies)&lt;br /&gt;
&lt;br /&gt;
  g++ -M  $(CXXFILES)        &amp;lt;--- computes all dependencies (system and local)&lt;br /&gt;
  g++ -MM $(CXXFILES)        &amp;lt;--- computes all dependencies (only local dependencies)&lt;br /&gt;
&lt;br /&gt;
Of course, it is possible to build a rule for updating the dependencies and many projects do it:&lt;br /&gt;
&lt;br /&gt;
  depend:&lt;br /&gt;
          $(CXX) -MM $(CXXFLAGS) $(CXXFILES) &amp;gt; .makedeps&lt;br /&gt;
 &lt;br /&gt;
  -include .makedeps&lt;br /&gt;
&lt;br /&gt;
The minus (-) sign before the &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; instruction indicates that processing should not stop if &amp;lt;tt&amp;gt;.makedeps&amp;lt;/tt&amp;gt; does not exist (normally, and if nothing is told otherwise, make stops when an error occurs).&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
* See the makefiles in the [[Makefile examples: CDK3|CDK3]], RTS, and [[Makefile examples: Compact|Compact]] distributions: those makefiles perform various tasks and use many of the described features.&lt;br /&gt;
* See also the toy examples below.&lt;br /&gt;
&lt;br /&gt;
[[category:Compiladores]]&lt;br /&gt;
[[category:Ensino]]&lt;/div&gt;</summary>
		<author><name>Root</name></author>
	</entry>
</feed>