PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements." 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See `http://www.gnu.org/copyleft/'. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. ADDENDUM: How to use this License for your documents ==================================================== To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (C) YEAR YOUR NAME. 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, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.  File: cpp.info, Node: Index of Directives, Next: Option Index, Prev: GNU Free Documentation License, Up: Top Index of Directives ******************* [index] * Menu: * #assert: Assertions. (line 41) * #define: Object-like Macros. (line 11) * #elif: Elif. (line 6) * #else: Else. (line 6) * #endif: Ifdef. (line 6) * #error: Diagnostics. (line 6) * #ident: Other Directives. (line 6) * #if: Conditional Syntax. (line 6) * #ifdef: Ifdef. (line 6) * #ifndef: Ifdef. (line 40) * #import: Obsolete once-only headers. (line 10) * #include: Include Syntax. (line 6) * #include_next: Wrapper Headers. (line 6) * #line: Line Control. (line 20) * #pragma GCC dependency: Pragmas. (line 53) * #pragma GCC poison: Pragmas. (line 65) * #pragma GCC system_header <1>: Pragmas. (line 92) * #pragma GCC system_header: System Headers. (line 31) * #sccs: Other Directives. (line 6) * #unassert: Assertions. (line 52) * #undef: Undefining and Redefining Macros. (line 6) * #warning: Diagnostics. (line 27)  File: cpp.info, Node: Option Index, Next: Concept Index, Prev: Index of Directives, Up: Top Option Index ************ CPP's command line options and environment variables are indexed here without any initial `-' or `--'. [index] * Menu: * A: Invocation. (line 525) * ansi: Invocation. (line 311) * C: Invocation. (line 577) * C_INCLUDE_PATH: Environment Variables. (line 16) * CPATH: Environment Variables. (line 15) * CPLUS_INCLUDE_PATH: Environment Variables. (line 17) * D: Invocation. (line 39) * dD: Invocation. (line 557) * DEPENDENCIES_OUTPUT: Environment Variables. (line 44) * dI: Invocation. (line 566) * dM: Invocation. (line 541) * dN: Invocation. (line 563) * fdirectives-only: Invocation. (line 433) * fdollars-in-identifiers: Invocation. (line 455) * fexec-charset: Invocation. (line 482) * fextended-identifiers: Invocation. (line 458) * finput-charset: Invocation. (line 495) * fno-show-column: Invocation. (line 520) * fno-working-directory: Invocation. (line 505) * fpreprocessed: Invocation. (line 463) * ftabstop: Invocation. (line 476) * fwide-exec-charset: Invocation. (line 487) * fworking-directory: Invocation. (line 505) * H: Invocation. (line 622) * help: Invocation. (line 614) * I: Invocation. (line 71) * I-: Invocation. (line 348) * idirafter: Invocation. (line 390) * imacros: Invocation. (line 381) * imultilib: Invocation. (line 413) * include: Invocation. (line 370) * iprefix: Invocation. (line 397) * iquote: Invocation. (line 425) * isysroot: Invocation. (line 409) * isystem: Invocation. (line 417) * iwithprefix: Invocation. (line 403) * iwithprefixbefore: Invocation. (line 403) * M: Invocation. (line 183) * MD: Invocation. (line 272) * MF: Invocation. (line 218) * MG: Invocation. (line 227) * MM: Invocation. (line 208) * MMD: Invocation. (line 288) * MP: Invocation. (line 237) * MQ: Invocation. (line 263) * MT: Invocation. (line 249) * nostdinc: Invocation. (line 360) * nostdinc++: Invocation. (line 365) * o: Invocation. (line 82) * OBJC_INCLUDE_PATH: Environment Variables. (line 18) * P: Invocation. (line 570) * pedantic: Invocation. (line 173) * pedantic-errors: Invocation. (line 178) * remap: Invocation. (line 609) * std=: Invocation. (line 311) * SUNPRO_DEPENDENCIES: Environment Variables. (line 60) * target-help: Invocation. (line 614) * traditional-cpp: Invocation. (line 602) * trigraphs: Invocation. (line 606) * U: Invocation. (line 62) * undef: Invocation. (line 66) * v: Invocation. (line 618) * version: Invocation. (line 631) * w: Invocation. (line 169) * Wall: Invocation. (line 88) * Wcomment: Invocation. (line 96) * Wcomments: Invocation. (line 96) * Wendif-labels: Invocation. (line 146) * Werror: Invocation. (line 159) * Wimport: Invocation. (line 119) * Wsystem-headers: Invocation. (line 163) * Wtraditional: Invocation. (line 113) * Wtrigraphs: Invocation. (line 101) * Wundef: Invocation. (line 122) * Wunused-macros: Invocation. (line 127) * x: Invocation. (line 295)  File: cpp.info, Node: Concept Index, Prev: Option Index, Up: Top Concept Index ************* [index] * Menu: * # operator: Stringification. (line 6) * ## operator: Concatenation. (line 6) * _Pragma: Pragmas. (line 25) * alternative tokens: Tokenization. (line 106) * arguments: Macro Arguments. (line 6) * arguments in macro definitions: Macro Arguments. (line 6) * assertions: Assertions. (line 6) * assertions, canceling: Assertions. (line 52) * backslash-newline: Initial processing. (line 61) * block comments: Initial processing. (line 77) * C++ named operators: C++ Named Operators. (line 6) * character constants: Tokenization. (line 85) * character set, execution: Invocation. (line 482) * character set, input: Invocation. (line 495) * character set, wide execution: Invocation. (line 487) * command line: Invocation. (line 6) * commenting out code: Deleted Code. (line 6) * comments: Initial processing. (line 77) * common predefined macros: Common Predefined Macros. (line 6) * computed includes: Computed Includes. (line 6) * concatenation: Concatenation. (line 6) * conditional group: Ifdef. (line 14) * conditionals: Conditionals. (line 6) * continued lines: Initial processing. (line 61) * controlling macro: Once-Only Headers. (line 35) * defined: Defined. (line 6) * dependencies for make as output: Environment Variables. (line 45) * dependencies, make: Invocation. (line 183) * diagnostic: Diagnostics. (line 6) * differences from previous versions: Differences from previous versions. (line 6) * digraphs: Tokenization. (line 106) * directive line: The preprocessing language. (line 6) * directive name: The preprocessing language. (line 6) * directives: The preprocessing language. (line 6) * empty macro arguments: Macro Arguments. (line 66) * environment variables: Environment Variables. (line 6) * expansion of arguments: Argument Prescan. (line 6) * FDL, GNU Free Documentation License: GNU Free Documentation License. (line 6) * function-like macros: Function-like Macros. (line 6) * grouping options: Invocation. (line 34) * guard macro: Once-Only Headers. (line 35) * header file: Header Files. (line 6) * header file names: Tokenization. (line 85) * identifiers: Tokenization. (line 34) * implementation limits: Implementation limits. (line 6) * implementation-defined behavior: Implementation-defined behavior. (line 6) * including just once: Once-Only Headers. (line 6) * invocation: Invocation. (line 6) * iso646.h: C++ Named Operators. (line 6) * line comments: Initial processing. (line 77) * line control: Line Control. (line 6) * line endings: Initial processing. (line 14) * linemarkers: Preprocessor Output. (line 28) * macro argument expansion: Argument Prescan. (line 6) * macro arguments and directives: Directives Within Macro Arguments. (line 6) * macros in include: Computed Includes. (line 6) * macros with arguments: Macro Arguments. (line 6) * macros with variable arguments: Variadic Macros. (line 6) * make: Invocation. (line 183) * manifest constants: Object-like Macros. (line 6) * named operators: C++ Named Operators. (line 6) * newlines in macro arguments: Newlines in Arguments. (line 6) * null directive: Other Directives. (line 15) * numbers: Tokenization. (line 61) * object-like macro: Object-like Macros. (line 6) * options: Invocation. (line 38) * options, grouping: Invocation. (line 34) * other tokens: Tokenization. (line 120) * output format: Preprocessor Output. (line 12) * overriding a header file: Wrapper Headers. (line 6) * parentheses in macro bodies: Operator Precedence Problems. (line 6) * pitfalls of macros: Macro Pitfalls. (line 6) * predefined macros: Predefined Macros. (line 6) * predefined macros, system-specific: System-specific Predefined Macros. (line 6) * predicates: Assertions. (line 19) * preprocessing directives: The preprocessing language. (line 6) * preprocessing numbers: Tokenization. (line 61) * preprocessing tokens: Tokenization. (line 6) * prescan of macro arguments: Argument Prescan. (line 6) * problems with macros: Macro Pitfalls. (line 6) * punctuators: Tokenization. (line 106) * redefining macros: Undefining and Redefining Macros. (line 6) * repeated inclusion: Once-Only Headers. (line 6) * reporting errors: Diagnostics. (line 6) * reporting warnings: Diagnostics. (line 6) * reserved namespace: System-specific Predefined Macros. (line 6) * self-reference: Self-Referential Macros. (line 6) * semicolons (after macro calls): Swallowing the Semicolon. (line 6) * side effects (in macro arguments): Duplication of Side Effects. (line 6) * standard predefined macros.: Standard Predefined Macros. (line 6) * string constants: Tokenization. (line 85) * string literals: Tokenization. (line 85) * stringification: Stringification. (line 6) * symbolic constants: Object-like Macros. (line 6) * system header files <1>: System Headers. (line 6) * system header files: Header Files. (line 13) * system-specific predefined macros: System-specific Predefined Macros. (line 6) * testing predicates: Assertions. (line 30) * token concatenation: Concatenation. (line 6) * token pasting: Concatenation. (line 6) * tokens: Tokenization. (line 6) * trigraphs: Initial processing. (line 32) * undefining macros: Undefining and Redefining Macros. (line 6) * unsafe macros: Duplication of Side Effects. (line 6) * variable number of arguments: Variadic Macros. (line 6) * variadic macros: Variadic Macros. (line 6) * wrapper #ifndef: Once-Only Headers. (line 6) * wrapper headers: Wrapper Headers. (line 6)  Tag Table: Node: Top1138 Node: Overview3834 Node: Character sets6655 Ref: Character sets-Footnote-18838 Node: Initial processing9019 Ref: trigraphs10578 Node: Tokenization14780 Ref: Tokenization-Footnote-121916 Node: The preprocessing language22027 Node: Header Files24905 Node: Include Syntax26785 Node: Include Operation28422 Node: Search Path30270 Node: Once-Only Headers33460 Node: Computed Includes35105 Node: Wrapper Headers38249 Node: System Headers40675 Node: Macros42725 Node: Object-like Macros43866 Node: Function-like Macros47456 Node: Macro Arguments49072 Node: Stringification53217 Node: Concatenation56423 Node: Variadic Macros59531 Node: Predefined Macros64318 Node: Standard Predefined Macros64906 Node: Common Predefined Macros70842 Node: System-specific Predefined Macros83529 Node: C++ Named Operators85550 Node: Undefining and Redefining Macros86514 Node: Directives Within Macro Arguments88618 Node: Macro Pitfalls90166 Node: Misnesting90699 Node: Operator Precedence Problems91811 Node: Swallowing the Semicolon93677 Node: Duplication of Side Effects95700 Node: Self-Referential Macros97883 Node: Argument Prescan100292 Node: Newlines in Arguments104046 Node: Conditionals104997 Node: Conditional Uses106827 Node: Conditional Syntax108185 Node: Ifdef108505 Node: If111666 Node: Defined113970 Node: Else115253 Node: Elif115823 Node: Deleted Code117112 Node: Diagnostics118359 Node: Line Control119976 Node: Pragmas123780 Node: Other Directives128050 Node: Preprocessor Output129100 Node: Traditional Mode132301 Node: Traditional lexical analysis133359 Node: Traditional macros135862 Node: Traditional miscellany139664 Node: Traditional warnings140661 Node: Implementation Details142858 Node: Implementation-defined behavior143479 Ref: Identifier characters144212 Node: Implementation limits147297 Node: Obsolete Features149971 Node: Assertions150426 Node: Obsolete once-only headers152967 Node: Differences from previous versions154702 Node: Invocation158910 Ref: Wtrigraphs163362 Ref: dashMF168193 Ref: fdollars-in-identifiers177576 Node: Environment Variables185409 Node: GNU Free Documentation License188375 Node: Index of Directives210808 Node: Option Index212737 Node: Concept Index218921  End Tag Table This is make.info, produced by makeinfo version 4.8 from make.texi. 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.70, last updated 1 April 2006, of `The GNU Make Manual', for GNU `make' version 3.81. Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006 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 freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development." INFO-DIR-SECTION GNU Packages START-INFO-DIR-ENTRY * Make: (make). Remake files automatically. END-INFO-DIR-ENTRY  File: make.info, Node: Pattern Rules, Next: Last Resort, Prev: Chained Rules, Up: Implicit Rules 10.5 Defining and Redefining Pattern Rules ========================================== You define an implicit rule by writing a "pattern rule". A pattern rule looks like an ordinary rule, except that its target contains the character `%' (exactly one of them). The target is considered a pattern for matching file names; the `%' can match any nonempty substring, while other characters match only themselves. The prerequisites likewise use `%' to show how their names relate to the target name. Thus, a pattern rule `%.o : %.c' says how to make any file `STEM.o' from another file `STEM.c'. Note that expansion using `%' in pattern rules occurs *after* any variable or function expansions, which take place when the makefile is read. *Note How to Use Variables: Using Variables, and *Note Functions for Transforming Text: Functions. * Menu: * Pattern Intro:: An introduction to pattern rules. * Pattern Examples:: Examples of pattern rules. * Automatic Variables:: How to use automatic variables in the commands of implicit rules. * Pattern Match:: How patterns match. * Match-Anything Rules:: Precautions you should take prior to defining rules that can match any target file whatever. * Canceling Rules:: How to override or cancel built-in rules.  File: make.info, Node: Pattern Intro, Next: Pattern Examples, Prev: Pattern Rules, Up: Pattern Rules 10.5.1 Introduction to Pattern Rules ------------------------------------ A pattern rule contains the character `%' (exactly one of them) in the target; otherwise, it looks exactly like an ordinary rule. The target is a pattern for matching file names; the `%' matches any nonempty substring, while other characters match only themselves. For example, `%.c' as a pattern matches any file name that ends in `.c'. `s.%.c' as a pattern matches any file name that starts with `s.', ends in `.c' and is at least five characters long. (There must be at least one character to match the `%'.) The substring that the `%' matches is called the "stem". `%' in a prerequisite of a pattern rule stands for the same stem that was matched by the `%' in the target. In order for the pattern rule to apply, its target pattern must match the file name under consideration and all of its prerequisites (after pattern substitution) must name files that exist or can be made. These files become prerequisites of the target. Thus, a rule of the form %.o : %.c ; COMMAND... specifies how to make a file `N.o', with another file `N.c' as its prerequisite, provided that `N.c' exists or can be made. There may also be prerequisites that do not use `%'; such a prerequisite attaches to every file made by this pattern rule. These unvarying prerequisites are useful occasionally. A pattern rule need not have any prerequisites that contain `%', or in fact any prerequisites at all. Such a rule is effectively a general wildcard. It provides a way to make any file that matches the target pattern. *Note Last Resort::. Pattern rules may have more than one target. Unlike normal rules, this does not act as many different rules with the same prerequisites and commands. If a pattern rule has multiple targets, `make' knows that the rule's commands are responsible for making all of the targets. The commands are executed only once to make all the targets. When searching for a pattern rule to match a target, the target patterns of a rule other than the one that matches the target in need of a rule are incidental: `make' worries only about giving commands and prerequisites to the file presently in question. However, when this file's commands are run, the other targets are marked as having been updated themselves. The order in which pattern rules appear in the makefile is important since this is the order in which they are considered. Of equally applicable rules, only the first one found is used. The rules you write take precedence over those that are built in. Note however, that a rule whose prerequisites actually exist or are mentioned always takes priority over a rule with prerequisites that must be made by chaining other implicit rules.  File: make.info, Node: Pattern Examples, Next: Automatic Variables, Prev: Pattern Intro, Up: Pattern Rules 10.5.2 Pattern Rule Examples ---------------------------- Here are some examples of pattern rules actually predefined in `make'. First, the rule that compiles `.c' files into `.o' files: %.o : %.c $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ defines a rule that can make any file `X.o' from `X.c'. The command uses the automatic variables `$@' and `$<' to substitute the names of the target file and the source file in each case where the rule applies (*note Automatic Variables::). Here is a second built-in rule: % :: RCS/%,v $(CO) $(COFLAGS) $< defines a rule that can make any file `X' whatsoever from a corresponding file `X,v' in the subdirectory `RCS'. Since the target is `%', this rule will apply to any file whatever, provided the appropriate prerequisite file exists. The double colon makes the rule "terminal", which means that its prerequisite may not be an intermediate file (*note Match-Anything Pattern Rules: Match-Anything Rules.). This pattern rule has two targets: %.tab.c %.tab.h: %.y bison -d $< This tells `make' that the command `bison -d X.y' will make both `X.tab.c' and `X.tab.h'. If the file `foo' depends on the files `parse.tab.o' and `scan.o' and the file `scan.o' depends on the file `parse.tab.h', when `parse.y' is changed, the command `bison -d parse.y' will be executed only once, and the prerequisites of both `parse.tab.o' and `scan.o' will be satisfied. (Presumably the file `parse.tab.o' will be recompiled from `parse.tab.c' and the file `scan.o' from `scan.c', while `foo' is linked from `parse.tab.o', `scan.o', and its other prerequisites, and it will execute happily ever after.)  File: make.info, Node: Automatic Variables, Next: Pattern Match, Prev: Pattern Examples, Up: Pattern Rules 10.5.3 Automatic Variables -------------------------- Suppose you are writing a pattern rule to compile a `.c' file into a `.o' file: how do you write the `cc' command so that it operates on the right source file name? You cannot write the name in the command, because the name is different each time the implicit rule is applied. What you do is use a special feature of `make', the "automatic variables". These variables have values computed afresh for each rule that is executed, based on the target and prerequisites of the rule. In this example, you would use `$@' for the object file name and `$<' for the source file name. It's very important that you recognize the limited scope in which automatic variable values are available: they only have values within the command script. In particular, you cannot use them anywhere within the target list of a rule; they have no value there and will expand to the empty string. Also, they cannot be accessed directly within the prerequisite list of a rule. A common mistake is attempting to use `$@' within the prerequisites list; this will not work. However, there is a special feature of GNU `make', secondary expansion (*note Secondary Expansion::), which will allow automatic variable values to be used in prerequisite lists. Here is a table of automatic variables: `$@' The file name of the target of the rule. If the target is an archive member, then `$@' is the name of the archive file. In a pattern rule that has multiple targets (*note Introduction to Pattern Rules: Pattern Intro.), `$@' is the name of whichever target caused the rule's commands to be run. `$%' The target member name, when the target is an archive member. *Note Archives::. For example, if the target is `foo.a(bar.o)' then `$%' is `bar.o' and `$@' is `foo.a'. `$%' is empty when the target is not an archive member. `$<' The name of the first prerequisite. If the target got its commands from an implicit rule, this will be the first prerequisite added by the implicit rule (*note Implicit Rules::). `$?' The names of all the prerequisites that are newer than the target, with spaces between them. For prerequisites which are archive members, only the member named is used (*note Archives::). `$^' The names of all the prerequisites, with spaces between them. For prerequisites which are archive members, only the member named is used (*note Archives::). A target has only one prerequisite on each other file it depends on, no matter how many times each file is listed as a prerequisite. So if you list a prerequisite more than once for a target, the value of `$^' contains just one copy of the name. This list does *not* contain any of the order-only prerequisites; for those see the `$|' variable, below. `$+' This is like `$^', but prerequisites listed more than once are duplicated in the order they were listed in the makefile. This is primarily useful for use in linking commands where it is meaningful to repeat library file names in a particular order. `$|' The names of all the order-only prerequisites, with spaces between them. `$*' The stem with which an implicit rule matches (*note How Patterns Match: Pattern Match.). If the target is `dir/a.foo.b' and the target pattern is `a.%.b' then the stem is `dir/foo'. The stem is useful for constructing names of related files. In a static pattern rule, the stem is part of the file name that matched the `%' in the target pattern. In an explicit rule, there is no stem; so `$*' cannot be determined in that way. Instead, if the target name ends with a recognized suffix (*note Old-Fashioned Suffix Rules: Suffix Rules.), `$*' is set to the target name minus the suffix. For example, if the target name is `foo.c', then `$*' is set to `foo', since `.c' is a suffix. GNU `make' does this bizarre thing only for compatibility with other implementations of `make'. You should generally avoid using `$*' except in implicit rules or static pattern rules. If the target name in an explicit rule does not end with a recognized suffix, `$*' is set to the empty string for that rule. `$?' is useful even in explicit rules when you wish to operate on only the prerequisites that have changed. For example, suppose that an archive named `lib' is supposed to contain copies of several object files. This rule copies just the changed object files into the archive: lib: fo23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~¬ìĬŬƬǬȬɬʬˬ̬ͬάϬЬѬҬӬԬլ֬׬ج٬ڬ۬ܬݬެ߬o.o bar.o lose.o win.o ar r lib $? Of the variables listed above, four have values that are single file names, and three have values that are lists of file names. These seven have variants that get just the file's directory name or just the file name within the directory. The variant variables' names are formed by appending `D' or `F', respectively. These variants are semi-obsolete in GNU `make' since the functions `dir' and `notdir' can be used to get a similar effect (*note Functions for File Names: File Name Functions.). Note, however, that the `D' variants all omit the trailing slash which always appears in the output of the `dir' function. Here is a table of the variants: `$(@D)' The directory part of the file name of the target, with the trailing slash removed. If the value of `$@' is `dir/foo.o' then `$(@D)' is `dir'. This value is `.' if `$@' does not contain a slash. `$(@F)' The file-within-directory part of the file name of the target. If the value of `$@' is `dir/foo.o' then `$(@F)' is `foo.o'. `$(@F)' is equivalent to `$(notdir $@)'. `$(*D)' `$(*F)' The directory part and the file-within-directory part of the stem; `dir' and `foo' in this example. `$(%D)' `$(%F)' The directory part and the file-within-directory part of the target archive member name. This makes sense only for archive member targets of the form `ARCHIVE(MEMBER)' and is useful only when MEMBER may contain a directory name. (*Note Archive Members as Targets: Archive Members.) `$(