Newer
Older
cours-unix-shell / UnixShell_cours2018 / make.fre.html
<html>
  <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <link REL="STYLESHEET" TYPE="text/css" TITLE="Style DILIB" HREF="../../dilib.css">
    <title>Make</title>
    <link rel="copyright" href="http://www.inist.fr/"><link rel="author" href="http://dilib.inist.fr/membres.html"><link rel="chapter" href="caracteristiques.fre.html" title="UNIX"><link rel="chapter" href="X.fre.html" title="X Window"><link rel="chapter" href="redirPipes.fre.html" title="Rappels"><link rel="chapter" href="newCommandsUser.fre.html" title="Commandes UNIX"><link rel="chapter" href="shellVars.fre.html" title="Shell"><link rel="chapter" href="sed.fre.html" title="Sed"><link rel="chapter" href="make.fre.html" title="Make"><link rel="index" href="http://dilib.inist.fr/dilib/v04Main/IndexSite/Server/FR.resource.index.html"><link rel="top" title="Accueil de DILIB" href="http://dilib.inist.fr/dilib/v04Main/"><link rel="alternate" title="English version" href="make.eng.html"><link rel="up" href="index.fre.html" title="Tutorial UNIX / Shell">
    <link rel="section" href="make.fre.html" title="Make"><link rel="section" href="tpMake.fre.html" title="Travaux Pratiques">
    <link rel="first" href="caracteristiques.fre.html" title="Caract&eacute;ristiques d'UNIX">
    <link rel="previous" href="tpSed.fre.html" title="Travaux Pratiques">
    <link rel="next" href="tpMake.fre.html" title="Travaux Pratiques">
    <link rel="last" href="tpMake.fre.html" title="Travaux Pratiques">
  </head>

  <body>
    <h1>Make</h1>

    <div id="navcontainer">
      <ul id="navlist">
	<li><a href="caracteristiques.fre.html">UNIX</a>
	</li>
	<li><a href="redirPipes.fre.html">Bases</a>
	</li>
	<li><a href="newCommandsUser.fre.html">Commandes</a>
	</li>
	<li><a href="shellVars.fre.html">Shell</a>
	</li>
	<li><a href="sed.fre.html">Sed</a>
	</li>
	<li><a>Make</a>
	  <ul id="subnavlist">
	    <li><a href="make.fre.html" id="subcurrent">Principes</a></li>
	    <li><a href="tpMake.fre.html">TP</a></li>
	  </ul>
	</li>
      </ul>
    </div>
    
    <div class="content">
    <p>
      make &lt; GNU make (INIST -&gt; GNU make)
    </p>

    <ul>
      <li>Gagner du temps par rapport aux shells</li>
    </ul>
    
    <img title="Un shell fait tous les traitements qui y sont indiqu&eacute;s" src="Shell.gif" alt="Un shell fait tous les traitements qui y sont indiqu&eacute;s">
    <br>
    <img title="Un make ne fait que les traitements qui sont n&eacute;cessaires" src="Make.gif" alt="Un make ne fait que les traitements qui sont n&eacute;cessaires">
    
    <hr>
    <h2>Syntaxe</h2>
    <p>
      Le fichier <code>makefile</code> contient les r&egrave;gles de
      d&eacute;pendance.
    </p>
    <p>
      Une r&egrave;gle est de la forme&nbsp;:
    </p>
    <pre>cible: [fichier de d&eacute;part] ...
	commande</pre>
    <p>
      Attention&nbsp;: la commande doit &ecirc;tre
      pr&eacute;c&eacute;d&eacute;e d'une tabulation!
    </p>
    <p>
      Pour cr&eacute;er le fichier cible&nbsp;: <code>make cible</code>
    </p>
    <p>
      Exemple de fichier <code>makefile</code>&nbsp;:
    </p>
    <pre># Commentaire
compte.txt: aCompter.txt
	wc -l &lt; aCompter.txt &gt; compte.txt</pre>
    <p>
      La deuxi&egrave;me fois qu'on lance la cible
      <code>compte.txt</code>, la commande <code>wc</code> n'est pas
      ex&eacute;cut&eacute;e, sauf si le fichier
      <code>aCompter.txt</code> a une date de modification plus
      r&eacute;cente que celle de <code>compte.txt</code>.
    </p>
    <p class="remarque">
      Une r&egrave;gle qui ne d&eacute;pend d'aucun fichier de
      d&eacute;part peut exister. De plus, elle ne peut donner lieu
      &agrave; la cr&eacute;ation d'un fichier. Une telle r&egrave;gle
      sera toujours ex&eacute;cut&eacute;e (&agrave; condition que son
      nom ne soit pas celui d'un fichier).
    </p>
    <hr>
    <h2>R&eacute;f&eacute;rences</h2>
    <ul>
      <li><a href="http://www.eng.hawaii.edu/Tutor/Make/FrenchMake/make.htm" hreflang="fr">http://www.eng.hawaii.edu/Tutor/Make/FrenchMake/make.htm</a> Tutorial make (en fran&ccedil;ais)</li>
      <li><a href="http://www.oreillynet.com/pub/a/linux/2002/01/31/make_intro.html" hreflang="en">http://www.oreillynet.com/pub/a/linux/2002/01/31/make_intro.html</a> Introduction to Make</li>
      <li><a href="http://www.gnu.org/manual/make/" hreflang="en">http://www.gnu.org/manual/make/</a> Make Manual</li>
      <li><a href="http://make.paulandlesley.org/" hreflang="en">http://make.paulandlesley.org/</a> GNU Make</li>
    </ul>
    </div>

    <hr>
    <address><a href="mailto:philippe.houdry@inist.fr">Philippe.Houdry@inist.fr</a></address>
  </body>
</html>