<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Make on Cheat Sheet</title><link>/tags/make/</link><description>Recent content in Make on Cheat Sheet</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 15 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="/tags/make/index.xml" rel="self" type="application/rss+xml"/><item><title>make</title><link>/linux/cli/make/</link><pubDate>Mon, 15 Jun 2026 00:00:00 +0000</pubDate><guid>/linux/cli/make/</guid><description>&lt;h1 id="make"&gt;&lt;code&gt;make&lt;/code&gt;&lt;a class="anchor" href="#make"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;h2 id="makefile-syntax"&gt;Makefile Syntax&lt;a class="anchor" href="#makefile-syntax"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A &lt;code&gt;Makefile&lt;/code&gt; consists of a set of rules. A rule has the following format:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-makefile" data-lang="makefile"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6639ba"&gt;&amp;lt;target&amp;gt;&lt;/span&gt;&lt;span style="color:#0550ae"&gt;:&lt;/span&gt; &amp;lt;prerequisites&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	&amp;lt;recipe&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Target&lt;/strong&gt;: Usually the name of a file generated by a program (eg. executables or objects). It can also be the name of an action to carry out (eg. &lt;code&gt;clean&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;: Files used as input to create the target. Multiple prerequisites are separated by spaces. A target is rebuilt if any of its prerequisites change.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Recipe&lt;/strong&gt;: Actions that &lt;code&gt;make&lt;/code&gt; carries out. &lt;strong&gt;Important:&lt;/strong&gt; Every recipe line must begin with a tab character.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="multiple-prerequisites-example"&gt;Multiple Prerequisites Example&lt;a class="anchor" href="#multiple-prerequisites-example"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-makefile" data-lang="makefile"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6639ba"&gt;main&lt;/span&gt;&lt;span style="color:#0550ae"&gt;:&lt;/span&gt; main.o utils.o
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	gcc -o main main.o utils.o
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="special-targets-and-variables"&gt;Special Targets and Variables&lt;a class="anchor" href="#special-targets-and-variables"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="phony"&gt;&lt;code&gt;.PHONY&lt;/code&gt;&lt;a class="anchor" href="#phony"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Defines targets that do not represent actual files. This prevents &lt;code&gt;make&lt;/code&gt; from failing to run a command if a file with the same name exists in the directory.&lt;/p&gt;</description></item></channel></rss>