Documento Gnu Make

Páginas: 160 (39949 palabras) Publicado: 26 de septiembre de 2012
GNU Make

GNU Make
A Program for Directing Recompilation GNU make Version 3.82 July 2010

Richard M. Stallman, Roland McGrath, Paul D. Smith

This file documents the GNU make utility, which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them. This is Edition 0.71, last updated 19 July 2010, of The GNU Make Manual, forGNU make version 3.82. Copyright c 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;with no Invariant Sections, with the Front-Cover Texts being “A GNU Manual,” and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled “GNU Free Documentation License.” (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and modify this GNU manual. Buying copies from the FSF supports it in developing GNU and promoting software freedom.”Published by the Free Software Foundation 51 Franklin St. – Fifth Floor Boston, MA 02110-1301 USA ISBN 1-882114-83-3

Cover art by Etienne Suvasa.

i

Short Contents
1 Overview of make . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 An Introduction to Makefiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3 Writing Makefiles . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 11 4 Writing Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5 Writing Recipes in Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 6 How to Use Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 7 Conditional Parts of Makefiles . . . . . . . . . . . . . . . . . .. . . . . . . . 73 8 Functions for Transforming Text . . . . . . . . . . . . . . . . . . . . . . . . 79 9 How to Run make . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 10 Using Implicit Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 11 Using make to Update Archive Files . . . . . . . . . . . . . . . . . . . . 121 12 Features of GNU make .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 13 Incompatibilities and Missing Features . . . . . . . . . . . . . . . . . . 129 14 Makefile Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 A Quick Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 B Errors Generated by Make . . . . . . . . . . . . . . . . . . . . .. . . . . . . 153 C Complex Makefile Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Index of Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Index of Functions, Variables, & Directives . . . . . . . . . . . . . . . . . . 179

iii

Table of Contents
1 Overview of make . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1
1.1 How to Read This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Problems and Bugs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2

An Introduction to Makefiles . . . . . . . . . . . . . . . . . . 3
2.1 2.2 2.3 2.4 2.5 2.6 2.7 What a Rule Looks Like . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . A Simple Makefile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How make Processes a Makefile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variables Make Makefiles Simpler. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Letting make Deduce the Recipes . . . . . . . . . . . . . . . . . . . ....
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Gnu Que Es
  • Make-make
  • maka
  • Maker
  • Maka
  • Maka
  • Maka
  • maka

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS