Changeset 503 for trunk/src/gmake/doc
- Timestamp:
- Sep 15, 2006, 7:09:38 AM (19 years ago)
- Location:
- trunk/src/gmake/doc
- Files:
-
- 1 deleted
- 8 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/doc/Makefile.am
r53 r503 1 1 # -*-Makefile-*-, or close enough 2 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software 3 # Foundation, Inc. 4 # This file is part of GNU Make. 5 # 6 # GNU Make is free software; you can redistribute it and/or modify it under the 7 # terms of the GNU General Public License as published by the Free Software 8 # Foundation; either version 2, or (at your option) any later version. 9 # 10 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 # A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 # 14 # You should have received a copy of the GNU General Public License along with 15 # GNU Make; see the file COPYING. If not, write to the Free Software 16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2 17 3 18 TEXI2HTML = texi2html -
trunk/src/gmake/doc/Makefile.in
r200 r503 1 # Makefile.in generated by automake 1. 8.3from Makefile.am.1 # Makefile.in generated by automake 1.9.6 from Makefile.am. 2 2 # @configure_input@ 3 3 4 4 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 # 2003, 2004 Free Software Foundation, Inc.5 # 2003, 2004, 2005 Free Software Foundation, Inc. 6 6 # This Makefile.in is free software; the Free Software Foundation 7 7 # gives unlimited permission to copy and/or distribute it, … … 16 16 17 17 # -*-Makefile-*-, or close enough 18 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software 19 # Foundation, Inc. 20 # This file is part of GNU Make. 21 # 22 # GNU Make is free software; you can redistribute it and/or modify it under the 23 # terms of the GNU General Public License as published by the Free Software 24 # Foundation; either version 2, or (at your option) any later version. 25 # 26 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 27 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 28 # A PARTICULAR PURPOSE. See the GNU General Public License for more details. 29 # 30 # You should have received a copy of the GNU General Public License along with 31 # GNU Make; see the file COPYING. If not, write to the Free Software 32 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 33 srcdir = @srcdir@ 19 34 top_srcdir = @top_srcdir@ … … 36 51 PRE_UNINSTALL = : 37 52 POST_UNINSTALL = : 53 build_triplet = @build@ 38 54 host_triplet = @host@ 39 55 subdir = doc 40 56 DIST_COMMON = $(make_TEXINFOS) $(srcdir)/Makefile.am \ 41 $(srcdir)/Makefile.in 57 $(srcdir)/Makefile.in $(srcdir)/stamp-vti \ 58 $(srcdir)/version.texi 42 59 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 43 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ 44 $(top_srcdir)/configure.in 60 am__aclocal_m4_deps = $(top_srcdir)/config/dospaths.m4 \ 61 $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \ 62 $(top_srcdir)/config/lib-ld.m4 \ 63 $(top_srcdir)/config/lib-link.m4 \ 64 $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \ 65 $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \ 66 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in 45 67 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 46 68 $(ACLOCAL_M4) … … 134 156 USE_NLS = @USE_NLS@ 135 157 VERSION = @VERSION@ 158 WINDOWSENV_FALSE = @WINDOWSENV_FALSE@ 159 WINDOWSENV_TRUE = @WINDOWSENV_TRUE@ 136 160 XGETTEXT = @XGETTEXT@ 137 161 ac_ct_CC = @ac_ct_CC@ … … 143 167 am__leading_dot = @am__leading_dot@ 144 168 am__quote = @am__quote@ 169 am__tar = @am__tar@ 170 am__untar = @am__untar@ 145 171 bindir = @bindir@ 146 172 build = @build@ … … 211 237 212 238 .texi.info: 213 restore=: && \ 214 backupdir="$(am__leading_dot)am$$$$" && \ 239 restore=: && backupdir="$(am__leading_dot)am$$$$" && \ 215 240 am__cwd=`pwd` && cd $(srcdir) && \ 216 241 rm -rf $$backupdir && mkdir $$backupdir && \ 217 for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ 218 if test -f $$f; then \ 219 mv $$f $$backupdir; \ 220 restore=mv; \ 221 fi; \ 222 done; \ 242 if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ 243 for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ 244 if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ 245 done; \ 246 else :; fi && \ 223 247 cd "$$am__cwd"; \ 224 248 if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ … … 232 256 $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ 233 257 fi; \ 234 rm -rf $$backupdir; \ 235 exit $$rc 258 rm -rf $$backupdir; exit $$rc 236 259 237 260 .texi.dvi: … … 246 269 247 270 .texi.html: 248 $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ 249 -o $@ $< 250 if test ! -d $@ && test -d $(@:.html=); then \ 251 mv $(@:.html=) $@; else :; fi 252 $(srcdir)/make.info: make.texi $(make_TEXINFOS) 253 make.dvi: make.texi $(make_TEXINFOS) 254 make.pdf: make.texi $(make_TEXINFOS) 255 make.html: make.texi $(make_TEXINFOS) 271 rm -rf $(@:.html=.htp) 272 if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ 273 -o $(@:.html=.htp) $<; \ 274 then \ 275 rm -rf $@; \ 276 if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ 277 mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ 278 else \ 279 if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ 280 rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ 281 exit 1; \ 282 fi 283 $(srcdir)/make.info: make.texi $(srcdir)/version.texi $(make_TEXINFOS) 284 make.dvi: make.texi $(srcdir)/version.texi $(make_TEXINFOS) 285 make.pdf: make.texi $(srcdir)/version.texi $(make_TEXINFOS) 286 make.html: make.texi $(srcdir)/version.texi $(make_TEXINFOS) 287 $(srcdir)/version.texi: $(srcdir)/stamp-vti 288 $(srcdir)/stamp-vti: make.texi $(top_srcdir)/configure 289 @(dir=.; test -f ./make.texi || dir=$(srcdir); \ 290 set `$(SHELL) $(top_srcdir)/config/mdate-sh $$dir/make.texi`; \ 291 echo "@set UPDATED $$1 $$2 $$3"; \ 292 echo "@set UPDATED-MONTH $$2 $$3"; \ 293 echo "@set EDITION $(VERSION)"; \ 294 echo "@set VERSION $(VERSION)") > vti.tmp 295 @cmp -s vti.tmp $(srcdir)/version.texi \ 296 || (echo "Updating $(srcdir)/version.texi"; \ 297 cp vti.tmp $(srcdir)/version.texi) 298 -@rm -f vti.tmp 299 @cp $(srcdir)/version.texi $@ 300 301 mostlyclean-vti: 302 -rm -f vti.tmp 303 304 maintainer-clean-vti: 305 -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi 256 306 .dvi.ps: 307 TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ 257 308 $(DVIPS) -o $@ $< 258 309 259 310 uninstall-info-am: 260 $(PRE_UNINSTALL)311 @$(PRE_UNINSTALL) 261 312 @if (install-info --version && \ 262 313 install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ … … 274 325 relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ 275 326 (if cd "$(DESTDIR)$(infodir)"; then \ 276 echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \327 echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ 277 328 rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ 278 329 else :; fi); \ … … 369 420 370 421 distclean-generic: 371 - rm -f $(CONFIG_CLEAN_FILES)422 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 372 423 373 424 maintainer-clean-generic: … … 435 486 -rm -f Makefile 436 487 maintainer-clean-am: distclean-am maintainer-clean-aminfo \ 437 maintainer-clean-generic 488 maintainer-clean-generic maintainer-clean-vti 438 489 439 490 mostlyclean: mostlyclean-am 440 491 441 mostlyclean-am: mostlyclean-aminfo mostlyclean-generic 492 mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti 442 493 443 494 pdf: pdf-am … … 457 508 install-man install-strip installcheck installcheck-am \ 458 509 installdirs maintainer-clean maintainer-clean-aminfo \ 459 maintainer-clean-generic m ostlyclean mostlyclean-aminfo\460 mostlyclean- generic pdf pdf-am ps ps-am uninstall uninstall-am\461 uninstall-info-am510 maintainer-clean-generic maintainer-clean-vti mostlyclean \ 511 mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf \ 512 pdf-am ps ps-am uninstall uninstall-am uninstall-info-am 462 513 463 514 -
trunk/src/gmake/doc/fdl.texi
r151 r503 4 4 5 5 @cindex FDL, GNU Free Documentation License 6 @center Version 1. 1, March 20006 @center Version 1.2, November 2002 7 7 8 8 @display 9 Copyright @copyright{} 2000 Free Software Foundation, Inc.10 5 9 Temple Place, Suite 330, Boston, MA 02111-1307, USA9 Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. 10 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 11 11 12 12 Everyone is permitted to copy and distribute verbatim copies … … 19 19 20 20 The purpose of this License is to make a manual, textbook, or other 21 written document @dfn{free} in the sense of freedom: to assure everyone 22 the effective freedom to copy and redistribute it, with or without 23 modifying it, either commercially or noncommercially. Secondarily, 24 this License preserves for the author and publisher a way to get 25 credit for their work, while not being considered responsible for 26 modifications made by others.21 functional and useful document @dfn{free} in the sense of freedom: to 22 assure everyone the effective freedom to copy and redistribute it, 23 with or without modifying it, either commercially or noncommercially. 24 Secondarily, this License preserves for the author and publisher a way 25 to get credit for their work, while not being considered responsible 26 for modifications made by others. 27 27 28 28 This License is a kind of ``copyleft'', which means that derivative … … 42 42 APPLICABILITY AND DEFINITIONS 43 43 44 This License applies to any manual or other work that contains a 45 notice placed by the copyright holder saying it can be distributed 46 under the terms of this License. The ``Document'', below, refers to any 47 such manual or work. Any member of the public is a licensee, and is 48 addressed as ``you''. 44 This License applies to any manual or other work, in any medium, that 45 contains a notice placed by the copyright holder saying it can be 46 distributed under the terms of this License. Such a notice grants a 47 world-wide, royalty-free license, unlimited in duration, to use that 48 work under the conditions stated herein. The ``Document'', below, 49 refers to any such manual or work. Any member of the public is a 50 licensee, and is addressed as ``you''. You accept the license if you 51 copy, modify or distribute the work in a way requiring permission 52 under copyright law. 49 53 50 54 A ``Modified Version'' of the Document means any work containing the … … 52 56 modifications and/or translated into another language. 53 57 54 A ``Secondary Section'' is a named appendix or a front-matter section of55 the Document that deals exclusively with the relationship of the56 publishers or authors of the Document to the Document's overall subject57 (or to related matters) and contains nothing that could fall directly 58 within that overall subject. (For example, if the Document is in part a 59 textbook of mathematics, a Secondary Section may not explain any 60 mathematics.) The relationship could be a matter of historical58 A ``Secondary Section'' is a named appendix or a front-matter section 59 of the Document that deals exclusively with the relationship of the 60 publishers or authors of the Document to the Document's overall 61 subject (or to related matters) and contains nothing that could fall 62 directly within that overall subject. (Thus, if the Document is in 63 part a textbook of mathematics, a Secondary Section may not explain 64 any mathematics.) The relationship could be a matter of historical 61 65 connection with the subject or with related matters, or of legal, 62 66 commercial, philosophical, ethical or political position regarding … … 65 69 The ``Invariant Sections'' are certain Secondary Sections whose titles 66 70 are designated, as being those of Invariant Sections, in the notice 67 that says that the Document is released under this License. 71 that says that the Document is released under this License. If a 72 section does not fit the above definition of Secondary then it is not 73 allowed to be designated as Invariant. The Document may contain zero 74 Invariant Sections. If the Document does not identify any Invariant 75 Sections then there are none. 68 76 69 77 The ``Cover Texts'' are certain short passages of text that are listed, 70 78 as Front-Cover Texts or Back-Cover Texts, in the notice that says that 71 the Document is released under this License. 79 the Document is released under this License. A Front-Cover Text may 80 be at most 5 words, and a Back-Cover Text may be at most 25 words. 72 81 73 82 A ``Transparent'' copy of the Document means a machine-readable copy, 74 83 represented in a format whose specification is available to the 75 general public, whose contents can be viewed and edited directly and84 general public, that is suitable for revising the document 76 85 straightforwardly with generic text editors or (for images composed of 77 86 pixels) generic paint programs or (for drawings) some widely available … … 79 88 for automatic translation to a variety of formats suitable for input 80 89 to text formatters. A copy made in an otherwise Transparent file 81 format whose markup has been designed to thwart or discourage 82 subsequent modification by readers is not Transparent. A copy that is 83 not ``Transparent'' is called ``Opaque''. 90 format whose markup, or absence of markup, has been arranged to thwart 91 or discourage subsequent modification by readers is not Transparent. 92 An image format is not Transparent if used for any substantial amount 93 of text. A copy that is not ``Transparent'' is called ``Opaque''. 84 94 85 95 Examples of suitable formats for Transparent copies include plain 86 @sc{ascii} without markup, Texinfo input format, La@TeX{} input format, 87 @acronym{SGML} or @acronym{XML} using a publicly available 88 @acronym{DTD}, and standard-conforming simple @acronym{HTML} designed 89 for human modification. Opaque formats include PostScript, 90 @acronym{PDF}, proprietary formats that can be read and edited only by 91 proprietary word processors, @acronym{SGML} or @acronym{XML} for which 92 the @acronym{DTD} and/or processing tools are not generally available, 93 and the machine-generated @acronym{HTML} produced by some word 94 processors for output purposes only. 96 @sc{ascii} without markup, Texinfo input format, La@TeX{} input 97 format, @acronym{SGML} or @acronym{XML} using a publicly available 98 @acronym{DTD}, and standard-conforming simple @acronym{HTML}, 99 PostScript or @acronym{PDF} designed for human modification. Examples 100 of transparent image formats include @acronym{PNG}, @acronym{XCF} and 101 @acronym{JPG}. Opaque formats include proprietary formats that can be 102 read and edited only by proprietary word processors, @acronym{SGML} or 103 @acronym{XML} for which the @acronym{DTD} and/or processing tools are 104 not generally available, and the machine-generated @acronym{HTML}, 105 PostScript or @acronym{PDF} produced by some word processors for 106 output purposes only. 95 107 96 108 The ``Title Page'' means, for a printed book, the title page itself, … … 100 112 the text near the most prominent appearance of the work's title, 101 113 preceding the beginning of the body of the text. 114 115 A section ``Entitled XYZ'' means a named subunit of the Document whose 116 title either is precisely XYZ or contains XYZ in parentheses following 117 text that translates XYZ in another language. (Here XYZ stands for a 118 specific section name mentioned below, such as ``Acknowledgements'', 119 ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' 120 of such a section when you modify the Document means that it remains a 121 section ``Entitled XYZ'' according to this definition. 122 123 The Document may include Warranty Disclaimers next to the notice which 124 states that this License applies to the Document. These Warranty 125 Disclaimers are considered to be included by reference in this 126 License, but only as regards disclaiming warranties: any other 127 implication that these Warranty Disclaimers may have is void and has 128 no effect on the meaning of this License. 102 129 103 130 @item … … 120 147 COPYING IN QUANTITY 121 148 122 If you publish printed copies of the Document numbering more than 100, 123 and the Document's license notice requires Cover Texts, you must enclose 124 the copies in covers that carry, clearly and legibly, all these Cover 149 If you publish printed copies (or copies in media that commonly have 150 printed covers) of the Document, numbering more than 100, and the 151 Document's license notice requires Cover Texts, you must enclose the 152 copies in covers that carry, clearly and legibly, all these Cover 125 153 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on 126 154 the back cover. Both covers must also clearly and legibly identify … … 140 168 more than 100, you must either include a machine-readable Transparent 141 169 copy along with each Opaque copy, or state in or with each Opaque copy 142 a publicly-accessible computer-network location containing a complete 143 Transparent copy of the Document, free of added material, which the 144 general network-using public has access to download anonymously at no 145 charge using public-standard network protocols. If you use the latter 146 option, you must take reasonably prudent steps, when you begin 147 distribution of Opaque copies in quantity, to ensure that this 148 Transparent copy will remain thus accessible at the stated location 149 until at least one year after the last time you distribute an Opaque 150 copy (directly or through your agents or retailers) of that edition to 151 the public. 170 a computer-network location from which the general network-using 171 public has access to download using public-standard network protocols 172 a complete Transparent copy of the Document, free of added material. 173 If you use the latter option, you must take reasonably prudent steps, 174 when you begin distribution of Opaque copies in quantity, to ensure 175 that this Transparent copy will remain thus accessible at the stated 176 location until at least one year after the last time you distribute an 177 Opaque copy (directly or through your agents or retailers) of that 178 edition to the public. 152 179 153 180 It is requested, but not required, that you contact the authors of the … … 177 204 responsible for authorship of the modifications in the Modified 178 205 Version, together with at least five of the principal authors of the 179 Document (all of its principal authors, if it has less than five). 206 Document (all of its principal authors, if it has fewer than five), 207 unless they release you from this requirement. 180 208 181 209 @item … … 203 231 204 232 @item 205 Preserve the section entitled ``History'', and its title, and add to206 it an item stating at least the title, year, new authors, and233 Preserve the section Entitled ``History'', Preserve its Title, and add 234 to it an item stating at least the title, year, new authors, and 207 235 publisher of the Modified Version as given on the Title Page. If 208 there is no section entitled ``History'' in the Document, create one236 there is no section Entitled ``History'' in the Document, create one 209 237 stating the title, year, authors, and publisher of the Document as 210 238 given on its Title Page, then add an item describing the Modified … … 221 249 222 250 @item 223 In any section entitled ``Acknowledgments'' or ``Dedications'', 224 preserve the section's title, and preserve in the section all the225 substance and tone of each of the contributor acknowledg ments226 and/ordedications given therein.251 For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve 252 the Title of the section, and preserve in the section all the 253 substance and tone of each of the contributor acknowledgements and/or 254 dedications given therein. 227 255 228 256 @item … … 232 260 233 261 @item 234 Delete any section entitled ``Endorsements''. Such a section262 Delete any section Entitled ``Endorsements''. Such a section 235 263 may not be included in the Modified Version. 236 264 237 265 @item 238 Do not retitle any existing section as ``Endorsements'' 239 or to conflict in title with any Invariant Section. 266 Do not retitle any existing section to be Entitled ``Endorsements'' or 267 to conflict in title with any Invariant Section. 268 269 @item 270 Preserve any Warranty Disclaimers. 240 271 @end enumerate 241 272 … … 247 278 These titles must be distinct from any other section titles. 248 279 249 You may add a section entitled ``Endorsements'', provided it contains280 You may add a section Entitled ``Endorsements'', provided it contains 250 281 nothing but endorsements of your Modified Version by various 251 282 parties---for example, statements of peer review or that the text has … … 275 306 Invariant Sections of all of the original documents, unmodified, and 276 307 list them all as Invariant Sections of your combined work in its 277 license notice .308 license notice, and that you preserve all their Warranty Disclaimers. 278 309 279 310 The combined work need only contain one copy of this License, and … … 286 317 Invariant Sections in the license notice of the combined work. 287 318 288 In the combination, you must combine any sections entitled ``History''289 in the various original documents, forming one section entitled290 ``History''; likewise combine any sections entitled ``Acknowledgments'',291 and any sections entitled ``Dedications''. You must delete all sections292 entitled ``Endorsements.''319 In the combination, you must combine any sections Entitled ``History'' 320 in the various original documents, forming one section Entitled 321 ``History''; likewise combine any sections Entitled ``Acknowledgements'', 322 and any sections Entitled ``Dedications''. You must delete all 323 sections Entitled ``Endorsements.'' 293 324 294 325 @item … … 311 342 A compilation of the Document or its derivatives with other separate 312 343 and independent documents or works, in or on a volume of a storage or 313 distribution medium, does not as a whole count as a Modified Version314 of the Document, provided no compilation copyright is claimed for the 315 compilation. Such a compilation is called an ``aggregate'', and this 316 License does not apply to the other self-contained works thus compiled 317 with the Document, on account of their being thus compiled, if they 318 are not themselvesderivative works of the Document.344 distribution medium, is called an ``aggregate'' if the copyright 345 resulting from the compilation is not used to limit the legal rights 346 of the compilation's users beyond what the individual works permit. 347 When the Document is included in an aggregate, this License does not 348 apply to the other works in the aggregate which are not themselves 349 derivative works of the Document. 319 350 320 351 If the Cover Text requirement of section 3 is applicable to these 321 copies of the Document, then if the Document is less than one quarter 322 of the entire aggregate, the Document's Cover Texts may be placed on 323 covers that surround only the Document within the aggregate. 324 Otherwise they must appear on covers around the whole aggregate. 352 copies of the Document, then if the Document is less than one half of 353 the entire aggregate, the Document's Cover Texts may be placed on 354 covers that bracket the Document within the aggregate, or the 355 electronic equivalent of covers if the Document is in electronic form. 356 Otherwise they must appear on printed covers that bracket the whole 357 aggregate. 325 358 326 359 @item … … 333 366 translations of some or all Invariant Sections in addition to the 334 367 original versions of these Invariant Sections. You may include a 335 translation of this License provided that you also include the 336 original English version of this License. In case of a disagreement 337 between the translation and the original English version of this 338 License, the original English version will prevail. 368 translation of this License, and all the license notices in the 369 Document, and any Warranty Disclaimers, provided that you also include 370 the original English version of this License and the original versions 371 of those notices and disclaimers. In case of a disagreement between 372 the translation and the original version of this License or a notice 373 or disclaimer, the original version will prevail. 374 375 If a section in the Document is Entitled ``Acknowledgements'', 376 ``Dedications'', or ``History'', the requirement (section 4) to Preserve 377 its Title (section 1) will typically require changing the actual 378 title. 339 379 340 380 @item … … 379 419 Copyright (C) @var{year} @var{your name}. 380 420 Permission is granted to copy, distribute and/or modify this document 381 under the terms of the GNU Free Documentation License, Version 1. 1421 under the terms of the GNU Free Documentation License, Version 1.2 382 422 or any later version published by the Free Software Foundation; 383 with the Invariant Sections being @var{list their titles}, with the 384 Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}. 385 A copy of the license is included in the section entitled ``GNU 423 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 424 Texts. A copy of the license is included in the section entitled ``GNU 386 425 Free Documentation License''. 387 426 @end group 388 427 @end smallexample 389 428 390 If you have no Invariant Sections, write ``with no Invariant Sections'' 391 instead of saying which ones are invariant. If you have no 392 Front-Cover Texts, write ``no Front-Cover Texts'' instead of 393 ``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts. 429 If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, 430 replace the ``with...Texts.'' line with this: 431 432 @smallexample 433 @group 434 with the Invariant Sections being @var{list their titles}, with 435 the Front-Cover Texts being @var{list}, and with the Back-Cover Texts 436 being @var{list}. 437 @end group 438 @end smallexample 439 440 If you have Invariant Sections without Cover Texts, or some other 441 combination of the three, merge those two alternatives to suit the 442 situation. 394 443 395 444 If your document contains nontrivial examples of program code, we -
trunk/src/gmake/doc/make-stds.texi
r151 r503 9 9 @cindex standards for makefiles 10 10 11 @c Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001 Free12 @c Software Foundation, Inc.11 @c Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 12 @c 2004, 2005 Free Software Foundation, Inc. 13 13 14 14 @c Permission is granted to copy, distribute and/or modify this document … … 294 294 Installation directories should always be named by variables, so it is 295 295 easy to install in a nonstandard place. The standard names for these 296 variables are described below. They are based on a standard filesystem 297 layout; variants of it are used in SVR4, 4.4BSD, GNU/Linux, Ultrix v4, 298 and other modern operating systems. 296 variables and the values they should have in GNU packages are 297 described below. They are based on a standard filesystem layout; 298 variants of it are used in GNU/Linux and other modern operating 299 systems. 300 301 Installers are expected to override these values when calling 302 @command{make} (e.g., @kbd{make prefix=/usr install} or 303 @command{configure} (e.g., @kbd{configure --prefix=/usr}). GNU 304 packages should not try to guess which value should be appropriate for 305 these variables on the system they are being installed onto: use the 306 default settings specified here so that all GNU packages behave 307 identically, allowing the installer to achieve any desired layout. 299 308 300 309 These two variables set the root for the installation. All the other … … 356 365 @file{/usr/local/libexec}, but write it as @file{$(exec_prefix)/libexec}. 357 366 (If you are using Autoconf, write it as @samp{@@libexecdir@@}.) 367 368 The definition of @samp{libexecdir} is the same for all packages, so 369 you should install your data in a subdirectory thereof. Most packages 370 install their data under @file{$(libexecdir)/@var{package-name}/}, 371 possibly within additional subdirectories thereof, such as 372 @file{$(libexecdir)/@var{package-name}/@var{machine}/@var{version}}. 358 373 @end table 359 374 … … 378 393 architecture-independent, and it is generally not hard. 379 394 380 Therefore, here are the variables Makefiles should use to specify 381 directories:395 Here are the variables Makefiles should use to specify directories 396 to put these various kinds of files in: 382 397 383 398 @table @samp 399 @item datarootdir 400 The root of the directory tree for read-only architecture-independent 401 data files. This should normally be @file{/usr/local/share}, but 402 write it as @file{$(prefix)/share}. (If you are using Autoconf, write 403 it as @samp{@@datarootdir@@}.) @samp{datadir}'s default value is 404 based on this variable; so are @samp{infodir}, @samp{mandir}, and 405 others. 406 384 407 @item datadir 385 The directory for installing read-only architecture independent data 386 files. This should normally be @file{/usr/local/share}, but write it as 387 @file{$(prefix)/share}. 388 (If you are using Autoconf, write it as @samp{@@datadir@@}.) 389 As a special exception, see @file{$(infodir)} 390 and @file{$(includedir)} below. 408 The directory for installing idiosyncratic read-only 409 architecture-independent data files for this program. This is usually 410 the same place as @samp{datarootdir}, but we use the two separate 411 variables so that you can move these program-specific files without 412 altering the location for Info files, man pages, etc. 413 414 This should normally be @file{/usr/local/share}, but write it as 415 @file{$(datarootdir)}. (If you are using Autoconf, write it as 416 @samp{@@datadir@@}.) 417 418 The definition of @samp{datadir} is the same for all packages, so you 419 should install your data in a subdirectory thereof. Most packages 420 install their data under @file{$(datadir)/@var{package-name}/}. 391 421 392 422 @item sysconfdir … … 420 450 @file{$(prefix)/var}. 421 451 (If you are using Autoconf, write it as @samp{@@localstatedir@@}.) 422 423 @item libdir 424 The directory for object files and libraries of object code. Do not 425 install executables here, they probably ought to go in @file{$(libexecdir)} 426 instead. The value of @code{libdir} should normally be 427 @file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}. 428 (If you are using Autoconf, write it as @samp{@@libdir@@}.) 429 430 @item infodir 431 The directory for installing the Info files for this package. By 432 default, it should be @file{/usr/local/info}, but it should be written 433 as @file{$(prefix)/info}. 434 (If you are using Autoconf, write it as @samp{@@infodir@@}.) 435 436 @item lispdir 437 The directory for installing any Emacs Lisp files in this package. By 438 default, it should be @file{/usr/local/share/emacs/site-lisp}, but it 439 should be written as @file{$(prefix)/share/emacs/site-lisp}. 440 441 If you are using Autoconf, write the default as @samp{@@lispdir@@}. 442 In order to make @samp{@@lispdir@@} work, you need the following lines 443 in your @file{configure.in} file: 444 445 @example 446 lispdir='$@{datadir@}/emacs/site-lisp' 447 AC_SUBST(lispdir) 448 @end example 449 452 @end table 453 454 These variables specify the directory for installing certain specific 455 types of files, if your program has them. Every GNU package should 456 have Info files, so every program needs @samp{infodir}, but not all 457 need @samp{libdir} or @samp{lispdir}. 458 459 @table @samp 450 460 @item includedir 451 461 @c rewritten to avoid overfull hbox --roland … … 482 492 To tell whether @file{foo.h} came from the Foo package, put a magic 483 493 string in the file---part of a comment---and @code{grep} for that string. 494 495 @item docdir 496 The directory for installing documentation files (other than Info) for 497 this package. By default, it should be 498 @file{/usr/local/share/doc/@var{yourpkg}}, but it should be written as 499 @file{$(datarootdir)/doc/@var{yourpkg}}. (If you are using Autoconf, 500 write it as @samp{@@docdir@@}.) The @var{yourpkg} subdirectory, which 501 may include a version number, prevents collisions among files with 502 common names, such as @file{README}. 503 504 @item infodir 505 The directory for installing the Info files for this package. By 506 default, it should be @file{/usr/local/share/info}, but it should be 507 written as @file{$(datarootdir)/info}. (If you are using Autoconf, 508 write it as @samp{@@infodir@@}.) @code{infodir} is separate from 509 @code{docdir} for compatibility with existing practice. 510 511 @item htmldir 512 @itemx dvidir 513 @itemx pdfdir 514 @itemx psdir 515 Directories for installing documentation files in the particular 516 format. (It is not required to support documentation in all these 517 formats.) They should all be set to @code{$(docdir)} by default. (If 518 you are using Autoconf, write them as @samp{@@htmldir@@}, 519 @samp{@@dvidir@@}, etc.) Packages which supply several translations 520 of their documentation should install them in 521 @samp{$(htmldir)/}@var{ll}, @samp{$(pdfdir)/}@var{ll}, etc. where 522 @var{ll} is a locale abbreviation such as @samp{en} or @samp{pt_BR}. 523 524 @item libdir 525 The directory for object files and libraries of object code. Do not 526 install executables here, they probably ought to go in @file{$(libexecdir)} 527 instead. The value of @code{libdir} should normally be 528 @file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}. 529 (If you are using Autoconf, write it as @samp{@@libdir@@}.) 530 531 @item lispdir 532 The directory for installing any Emacs Lisp files in this package. By 533 default, it should be @file{/usr/local/share/emacs/site-lisp}, but it 534 should be written as @file{$(datarootdir)/emacs/site-lisp}. 535 536 If you are using Autoconf, write the default as @samp{@@lispdir@@}. 537 In order to make @samp{@@lispdir@@} work, you need the following lines 538 in your @file{configure.in} file: 539 540 @example 541 lispdir='$@{datarootdir@}/emacs/site-lisp' 542 AC_SUBST(lispdir) 543 @end example 544 545 @item localedir 546 The directory for installing locale-specific message catalogs for this 547 package. By default, it should be @file{/usr/local/share/locale}, but 548 it should be written as @file{$(datarootdir)/locale}. (If you are 549 using Autoconf, write it as @samp{@@localedir@@}.) This directory 550 usually has a subdirectory per locale. 484 551 @end table 485 552 … … 489 556 @item mandir 490 557 The top-level directory for installing the man pages (if any) for this 491 package. It will normally be @file{/usr/local/ man}, but you should492 write it as @file{$(prefix)/man}. 493 (If you are usingAutoconf, write it as @samp{@@mandir@@}.)558 package. It will normally be @file{/usr/local/share/man}, but you 559 should write it as @file{$(datarootdir)/man}. (If you are using 560 Autoconf, write it as @samp{@@mandir@@}.) 494 561 495 562 @item man1dir … … 536 603 # NOTE: This directory must exist when you start the install. 537 604 prefix = /usr/local 605 datarootdir = $(prefix)/share 606 datadir = $(datarootdir) 538 607 exec_prefix = $(prefix) 539 608 # Where to put the executable for the command `gcc'. … … 542 611 libexecdir = $(exec_prefix)/libexec 543 612 # Where to put the Info files. 544 infodir = $( prefix)/info613 infodir = $(datarootdir)/info 545 614 @end smallexample 546 615 … … 631 700 Categories}. 632 701 702 @item install-html 703 @itemx install-dvi 704 @itemx install-pdf 705 @itemx install-ps 706 These targets install documentation in formats other than Info; 707 they're intended to be called explicitly by the person installing the 708 package, if that format is desired. GNU prefers Info files, so these 709 must be installed by the @code{install} target. 710 711 When you have many documentation files to install, we recommend that 712 you avoid collisions and clutter by arranging for these targets to 713 install in subdirectories of the appropriate installation directory, 714 such as @code{htmldir}. As one example, if your package has multiple 715 manuals, and you wish to install HTML documentation with many files 716 (such as the ``split'' mode output by @code{makeinfo --html}), you'll 717 certainly want to use subdirectories, or two nodes with the same name 718 in different manuals will overwrite each other. 719 633 720 @item uninstall 634 721 Delete all the installed files---the copies that the @samp{install} 635 target creates.722 and @samp{install-*} targets create. 636 723 637 724 This rule should not modify the directories where compilation is done, … … 669 756 @item clean 670 757 671 Delete all files from the current directory that are normally created by 672 building the program. Don't delete the files that record the 673 configuration. Also preserve files that could be made by building, but 674 normally aren't because the distribution comes with them. 758 Delete all files in the current directory that are normally created by 759 building the program. Also delete files in other directories if they 760 are created by this makefile. However, don't delete the files that 761 record the configuration. Also preserve files that could be made by 762 building, but normally aren't because the distribution comes with 763 them. There is no need to delete parent directories that were created 764 with @samp{mkdir -p}, since they could have existed anyway. 675 765 676 766 Delete @file{.dvi} files here if they are not part of the distribution. 677 767 678 768 @item distclean 679 Delete all files from the current directory that are created by 680 configuring or building the program. If you have unpacked the source 681 and built the program without creating any other files, @samp{make 682 distclean} should leave only the files that were in the distribution. 769 Delete all files in the current directory (or created by this 770 makefile) that are created by configuring or building the program. If 771 you have unpacked the source and built the program without creating 772 any other files, @samp{make distclean} should leave only the files 773 that were in the distribution. However, there is no need to delete 774 parent directories that were created with @samp{mkdir -p}, since they 775 could have existed anyway. 683 776 684 777 @item mostlyclean … … 689 782 690 783 @item maintainer-clean 691 Delete almost everything from the current directory that can be692 reconstructed with this Makefile. This typically includes everything 693 deleted by @code{distclean}, plus more: C source files produced by 694 Bison, tags tables, Info files, andso on.784 Delete almost everything that can be reconstructed with this Makefile. 785 This typically includes everything deleted by @code{distclean}, plus 786 more: C source files produced by Bison, tags tables, Info files, and 787 so on. 695 788 696 789 The reason we say ``almost everything'' is that running the command 697 @samp{make maintainer-clean} should not delete @file{configure} even if 698 @file{configure} can be remade using a rule in the Makefile. More generally, 699 @samp{make maintainer-clean} should not delete anything that needs to 700 exist in order to run @file{configure} and then begin to build the 701 program. This is the only exception; @code{maintainer-clean} should 702 delete everything else that can be rebuilt. 790 @samp{make maintainer-clean} should not delete @file{configure} even 791 if @file{configure} can be remade using a rule in the Makefile. More 792 generally, @samp{make maintainer-clean} should not delete anything 793 that needs to exist in order to run @file{configure} and then begin to 794 build the program. Also, there is no need to delete parent 795 directories that were created with @samp{mkdir -p}, since they could 796 have existed anyway. These are the only exceptions; 797 @code{maintainer-clean} should delete everything else that can be 798 rebuilt. 703 799 704 800 The @samp{maintainer-clean} target is intended to be used by a maintainer of … … 744 840 745 841 @item dvi 746 Generate DVI files for all Texinfo documentation. 747 For example: 842 @itemx html 843 @itemx pdf 844 @itemx ps 845 Generate documentation files in the given format, if possible. 846 Here's an example rule for generating DVI files from Texinfo: 748 847 749 848 @smallexample … … 760 859 of formatting. @TeX{} is not distributed with Texinfo.} Alternatively, 761 860 write just the dependencies, and allow GNU @code{make} to provide the command. 861 862 Here's another example, this one for generating HTML from Texinfo: 863 864 @smallexample 865 html: foo.html 866 867 foo.html: foo.texi chap1.texi chap2.texi 868 $(TEXI2HTML) $(srcdir)/foo.texi 869 @end smallexample 870 871 @noindent 872 Again, you would define the variable @code{TEXI2HTML} in the Makefile; 873 for example, it might run @code{makeinfo --no-split --html} 874 (@command{makeinfo} is part of the Texinfo distribution). 762 875 763 876 @item dist … … 933 1046 Programs to build binary packages work by extracting the 934 1047 pre-installation and post-installation commands. Here is one way of 935 extracting the pre-installation commands: 936 937 @smallexample 938 make -n install -o all \ 1048 extracting the pre-installation commands (the @option{-s} option to 1049 @command{make} is needed to silence messages about entering 1050 subdirectories): 1051 1052 @smallexample 1053 make -s -n install -o all \ 939 1054 PRE_INSTALL=pre-install \ 940 1055 POST_INSTALL=post-install \ … … 947 1062 948 1063 @smallexample 949 $0 ~ /^ \t[ \t]*(normal_install|post_install)[ \t]*$/ @{on = 0@}1064 $0 ~ /^(normal-install|post-install)[ \t]*$/ @{on = 0@} 950 1065 on @{print $0@} 951 $0 ~ /^\t[ \t]*pre_install[ \t]*$/ @{on = 1@} 952 @end smallexample 953 954 The resulting file of pre-installation commands is executed as a shell 955 script as part of installing the binary package. 1066 $0 ~ /^pre-install[ \t]*$/ @{on = 1@} 1067 @end smallexample -
trunk/src/gmake/doc/make.info
r200 r503 1 This is ../../doc/make.info, produced by makeinfo version 4.6 from 2 ../../doc/make.texi. 1 This is make.info, produced by makeinfo version 4.8 from make.texi. 2 3 This file documents the GNU `make' utility, which determines 4 automatically which pieces of a large program need to be recompiled, 5 and issues the commands to recompile them. 6 7 This is Edition 0.70, last updated 1 April 2006, of `The GNU Make 8 Manual', for GNU `make' version 3.81. 9 10 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 11 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software 12 Foundation, Inc. 13 14 Permission is granted to copy, distribute and/or modify this 15 document under the terms of the GNU Free Documentation License, 16 Version 1.2 or any later version published by the Free Software 17 Foundation; with no Invariant Sections, with the Front-Cover Texts 18 being "A GNU Manual," and with the Back-Cover Texts as in (a) 19 below. A copy of the license is included in the section entitled 20 "GNU Free Documentation License." 21 22 (a) The FSF's Back-Cover Text is: "You have freedom to copy and 23 modify this GNU Manual, like GNU software. Copies published by 24 the Free Software Foundation raise funds for GNU development." 3 25 4 26 INFO-DIR-SECTION GNU Packages … … 7 29 END-INFO-DIR-ENTRY 8 30 9 This file documents the GNU Make utility, which determines10 automatically which pieces of a large program need to be recompiled,11 and issues the commands to recompile them.12 13 This is Edition 0.61, last updated 02 May 2003, of `The GNU Make14 Manual', for `make', Version 3.81.15 16 Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,17 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.18 19 Permission is granted to copy, distribute and/or modify this document20 under the terms of the GNU Free Documentation License, Version 1.1 or21 any later version published by the Free Software Foundation; with no22 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover23 Texts. A copy of the license is included in the section entitled "GNU24 Free Documentation License".25 26 31 27 32 Indirect: 28 make.info-1: 1 01729 make.info-2: 30 052033 make.info-1: 1297 34 make.info-2: 301265 30 35 31 36 Tag Table: 32 37 (Indirect) 33 Node: Top1017 34 Node: Overview13551 35 Node: Preparing14555 36 Node: Reading15527 37 Node: Bugs16446 38 Node: Introduction18268 39 Node: Rule Introduction19852 40 Node: Simple Makefile21588 41 Node: How Make Works25209 42 Node: Variables Simplify27697 43 Node: make Deduces29900 44 Node: Combine By Prerequisite31647 45 Node: Cleanup32678 46 Node: Makefiles34089 47 Node: Makefile Contents34972 48 Node: Makefile Names37919 49 Node: Include39518 50 Ref: Include-Footnote-143069 51 Node: MAKEFILES Variable43203 52 Node: MAKEFILE_LIST Variable44705 53 Node: Special Variables46024 54 Node: Remaking Makefiles46759 55 Node: Overriding Makefiles51001 56 Node: Reading Makefiles53051 57 Node: Rules55578 58 Node: Rule Example58246 59 Node: Rule Syntax59095 60 Node: Prerequisite Types61316 61 Node: Wildcards63084 62 Node: Wildcard Examples64767 63 Node: Wildcard Pitfall66011 64 Node: Wildcard Function67793 65 Node: Directory Search69570 66 Node: General Search70704 67 Node: Selective Search72407 68 Node: Search Algorithm75383 69 Node: Commands/Search77890 70 Node: Implicit/Search79225 71 Node: Libraries/Search80157 72 Node: Phony Targets82239 73 Node: Force Targets87215 74 Node: Empty Targets88252 75 Node: Special Targets89539 76 Node: Multiple Targets96235 77 Node: Multiple Rules98095 78 Node: Static Pattern100321 79 Node: Static Usage100963 80 Node: Static versus Implicit104684 81 Node: Double-Colon106414 82 Node: Automatic Prerequisites108061 83 Node: Commands112315 84 Node: Echoing114004 85 Node: Execution115282 86 Ref: Execution-Footnote-1119708 87 Node: Parallel119854 88 Node: Errors123437 89 Node: Interrupts127073 90 Node: Recursion128652 91 Node: MAKE Variable130735 92 Node: Variables/Recursion132986 93 Node: Options/Recursion138131 94 Node: -w Option143284 95 Node: Sequences144267 96 Node: Empty Commands147268 97 Node: Using Variables148434 98 Node: Reference151541 99 Node: Flavors153097 100 Node: Advanced158881 101 Node: Substitution Refs159378 102 Node: Computed Names160924 103 Node: Values165491 104 Node: Setting166396 105 Node: Appending168424 106 Node: Override Directive172339 107 Node: Defining173715 108 Node: Environment176171 109 Node: Target-specific178443 110 Node: Pattern-specific181400 111 Node: Conditionals182792 112 Node: Conditional Example183498 113 Node: Conditional Syntax186082 114 Node: Testing Flags190950 115 Node: Functions192044 116 Node: Syntax of Functions193386 117 Node: Text Functions195577 118 Node: File Name Functions203727 119 Node: Foreach Function208166 120 Node: If Function211366 121 Node: Call Function212634 122 Node: Value Function215516 123 Node: Eval Function216950 124 Node: Origin Function219256 125 Node: Shell Function222465 126 Node: Make Control Functions224046 127 Node: Running225476 128 Node: Makefile Arguments227461 129 Node: Goals228169 130 Node: Instead of Execution232724 131 Node: Avoiding Compilation236002 132 Node: Overriding237969 133 Node: Testing240259 134 Node: Options Summary242136 135 Node: Implicit Rules251567 136 Node: Using Implicit253711 137 Node: Catalogue of Rules257240 138 Node: Implicit Variables266223 139 Node: Chained Rules270449 140 Node: Pattern Rules274448 141 Node: Pattern Intro275974 142 Node: Pattern Examples278822 143 Node: Automatic Variables280617 144 Node: Pattern Match288780 145 Node: Match-Anything Rules290401 146 Node: Canceling Rules294262 147 Node: Last Resort294964 148 Node: Suffix Rules296801 149 Node: Implicit Rule Search300520 150 Node: Archives304029 151 Node: Archive Members304721 152 Node: Archive Update306317 153 Node: Archive Symbols308221 154 Node: Archive Pitfalls309441 155 Node: Archive Suffix Rules310154 156 Node: Features311691 157 Node: Missing320238 158 Node: Makefile Conventions323968 159 Node: Makefile Basics324748 160 Node: Utilities in Makefiles327905 161 Node: Command Variables330033 162 Node: Directory Variables333593 163 Node: Standard Targets344470 164 Ref: Standard Targets-Footnote-1355724 165 Node: Install Command Categories355824 166 Node: Quick Reference360389 167 Node: Error Messages370133 168 Node: Complex Makefile377802 169 Node: GNU Free Documentation License386482 170 Node: Concept Index406374 171 Node: Name Index451280 38 Node: Top1297 39 Node: Overview14702 40 Node: Preparing15712 41 Node: Reading16684 42 Node: Bugs17611 43 Node: Introduction19441 44 Node: Rule Introduction21033 45 Node: Simple Makefile22777 46 Node: How Make Works26406 47 Node: Variables Simplify29061 48 Node: make Deduces31267 49 Node: Combine By Prerequisite33007 50 Node: Cleanup34036 51 Node: Makefiles35455 52 Node: Makefile Contents36421 53 Node: Makefile Names39376 54 Node: Include40987 55 Ref: Include-Footnote-144619 56 Node: MAKEFILES Variable44753 57 Node: MAKEFILE_LIST Variable46263 58 Node: Special Variables47531 59 Node: Remaking Makefiles51038 60 Node: Overriding Makefiles55287 61 Node: Reading Makefiles57340 62 Node: Secondary Expansion60244 63 Node: Rules67678 64 Node: Rule Example70350 65 Node: Rule Syntax71207 66 Node: Prerequisite Types73710 67 Node: Wildcards75486 68 Node: Wildcard Examples77204 69 Node: Wildcard Pitfall78460 70 Node: Wildcard Function80249 71 Node: Directory Search82033 72 Node: General Search83175 73 Node: Selective Search84890 74 Node: Search Algorithm87878 75 Node: Commands/Search90397 76 Node: Implicit/Search91743 77 Node: Libraries/Search92687 78 Node: Phony Targets94779 79 Node: Force Targets99865 80 Node: Empty Targets100910 81 Node: Special Targets102208 82 Node: Multiple Targets109382 83 Node: Multiple Rules111257 84 Node: Static Pattern113493 85 Node: Static Usage114145 86 Node: Static versus Implicit117866 87 Node: Double-Colon119610 88 Node: Automatic Prerequisites121267 89 Node: Commands125545 90 Node: Command Syntax126753 91 Node: Splitting Lines128778 92 Node: Variables in Commands131759 93 Node: Echoing133086 94 Node: Execution134378 95 Ref: Execution-Footnote-1135629 96 Node: Choosing the Shell135775 97 Node: Parallel139744 98 Node: Errors143337 99 Node: Interrupts146983 100 Node: Recursion148570 101 Node: MAKE Variable150664 102 Node: Variables/Recursion152931 103 Node: Options/Recursion158372 104 Node: -w Option163537 105 Node: Sequences164532 106 Node: Empty Commands167544 107 Node: Using Variables168718 108 Node: Reference171831 109 Node: Flavors173390 110 Node: Advanced179128 111 Node: Substitution Refs179633 112 Node: Computed Names181186 113 Node: Values185730 114 Node: Setting186643 115 Node: Appending188679 116 Node: Override Directive192605 117 Node: Defining193989 118 Node: Environment196453 119 Node: Target-specific198702 120 Node: Pattern-specific201669 121 Node: Conditionals203071 122 Node: Conditional Example203781 123 Node: Conditional Syntax206358 124 Node: Testing Flags212083 125 Node: Functions213185 126 Node: Syntax of Functions214605 127 Node: Text Functions216804 128 Node: File Name Functions225375 129 Node: Conditional Functions230597 130 Node: Foreach Function232971 131 Node: Call Function236183 132 Node: Value Function239068 133 Node: Eval Function240505 134 Node: Origin Function242779 135 Node: Flavor Function245997 136 Node: Shell Function247063 137 Node: Make Control Functions248697 138 Node: Running250366 139 Node: Makefile Arguments252355 140 Node: Goals253071 141 Node: Instead of Execution257812 142 Node: Avoiding Compilation261098 143 Node: Overriding263073 144 Node: Testing265371 145 Node: Options Summary267256 146 Node: Implicit Rules277382 147 Node: Using Implicit279530 148 Node: Catalogue of Rules283069 149 Node: Implicit Variables292419 150 Node: Chained Rules297254 151 Node: Pattern Rules301265 152 Node: Pattern Intro302801 153 Node: Pattern Examples305698 154 Node: Automatic Variables307507 155 Node: Pattern Match314878 156 Node: Match-Anything Rules316514 157 Node: Canceling Rules320389 158 Node: Last Resort321105 159 Node: Suffix Rules322952 160 Node: Implicit Rule Search326681 161 Node: Archives330200 162 Node: Archive Members330898 163 Node: Archive Update332511 164 Node: Archive Symbols334425 165 Node: Archive Pitfalls335659 166 Node: Archive Suffix Rules336382 167 Node: Features337929 168 Node: Missing346484 169 Node: Makefile Conventions350222 170 Node: Makefile Basics351008 171 Node: Utilities in Makefiles354175 172 Node: Command Variables356313 173 Node: Directory Variables359883 174 Node: Standard Targets374023 175 Ref: Standard Targets-Footnote-1387142 176 Node: Install Command Categories387242 177 Node: Quick Reference391768 178 Node: Error Messages402464 179 Node: Complex Makefile410154 180 Node: GNU Free Documentation License418872 181 Node: Concept Index441321 182 Node: Name Index506510 172 183 173 184 End Tag Table -
trunk/src/gmake/doc/make.info-1
r200 r503 1 This is ../../doc/make.info, produced by makeinfo version 4.6 from 2 ../../doc/make.texi. 1 This is make.info, produced by makeinfo version 4.8 from make.texi. 2 3 This file documents the GNU `make' utility, which determines 4 automatically which pieces of a large program need to be recompiled, 5 and issues the commands to recompile them. 6 7 This is Edition 0.70, last updated 1 April 2006, of `The GNU Make 8 Manual', for GNU `make' version 3.81. 9 10 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 11 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software 12 Foundation, Inc. 13 14 Permission is granted to copy, distribute and/or modify this 15 document under the terms of the GNU Free Documentation License, 16 Version 1.2 or any later version published by the Free Software 17 Foundation; with no Invariant Sections, with the Front-Cover Texts 18 being "A GNU Manual," and with the Back-Cover Texts as in (a) 19 below. A copy of the license is included in the section entitled 20 "GNU Free Documentation License." 21 22 (a) The FSF's Back-Cover Text is: "You have freedom to copy and 23 modify this GNU Manual, like GNU software. Copies published by 24 the Free Software Foundation raise funds for GNU development." 3 25 4 26 INFO-DIR-SECTION GNU Packages … … 7 29 END-INFO-DIR-ENTRY 8 30 9 This file documents the GNU Make utility, which determines 31 32 File: make.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) 33 34 GNU `make' 35 ********** 36 37 This file documents the GNU `make' utility, which determines 10 38 automatically which pieces of a large program need to be recompiled, 11 39 and issues the commands to recompile them. 12 40 13 This is Edition 0.61, last updated 02 May 2003, of `The GNU Make 14 Manual', for `make', Version 3.81. 15 16 Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 17 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. 18 19 Permission is granted to copy, distribute and/or modify this document 20 under the terms of the GNU Free Documentation License, Version 1.1 or 21 any later version published by the Free Software Foundation; with no 22 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover 23 Texts. A copy of the license is included in the section entitled "GNU 24 Free Documentation License". 25 26 27 File: make.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) 28 29 Make 30 **** 31 32 The GNU `make' utility automatically determines which pieces of a large 33 program need to be recompiled, and issues the commands to recompile 34 them. 35 36 This edition of the `GNU Make Manual', last updated 02 May 2003, 37 documents GNU `make' Version 3.81. 38 39 This manual describes `make' and contains the following chapters: 41 This is Edition 0.70, last updated 1 April 2006, of `The GNU Make 42 Manual', for GNU `make' version 3.81. 43 44 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 45 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software 46 Foundation, Inc. 47 48 Permission is granted to copy, distribute and/or modify this 49 document under the terms of the GNU Free Documentation License, 50 Version 1.2 or any later version published by the Free Software 51 Foundation; with no Invariant Sections, with the Front-Cover Texts 52 being "A GNU Manual," and with the Back-Cover Texts as in (a) 53 below. A copy of the license is included in the section entitled 54 "GNU Free Documentation License." 55 56 (a) The FSF's Back-Cover Text is: "You have freedom to copy and 57 modify this GNU Manual, like GNU software. Copies published by 58 the Free Software Foundation raise funds for GNU development." 40 59 41 60 * Menu: … … 97 116 with another makefile. 98 117 * Reading Makefiles:: How makefiles are parsed. 118 * Secondary Expansion:: How and when secondary expansion is performed. 99 119 100 120 Writing Rules … … 107 127 * Phony Targets:: Using a target that is not a real file's name. 108 128 * Force Targets:: You can use a target without commands 109 or prerequisites to mark other 110 targetsas phony.129 or prerequisites to mark other targets 130 as phony. 111 131 * Empty Targets:: When only the date matters and the 112 132 files are empty. … … 148 168 Writing the Commands in Rules 149 169 170 * Command Syntax:: Command syntax features and pitfalls. 150 171 * Echoing:: How to control when commands are echoed. 151 172 * Execution:: How commands are executed. … … 156 177 * Sequences:: Defining canned sequences of commands. 157 178 * Empty Commands:: Defining useful, do-nothing commands. 179 180 Command Syntax 181 182 * Splitting Lines:: Breaking long command lines for readability. 183 * Variables in Commands:: Using `make' variables in commands. 184 185 Command Execution 186 187 * Choosing the Shell:: How `make' chooses the shell used 188 to run commands. 158 189 159 190 Recursive Use of `make' … … 201 232 * Text Functions:: General-purpose text manipulation functions. 202 233 * File Name Functions:: Functions for manipulating file names. 234 * Conditional Functions:: Functions that implement conditions. 203 235 * Foreach Function:: Repeat some text with controlled variation. 204 * If Function:: Conditionally expand a value.205 236 * Call Function:: Expand a user-defined function. 206 237 * Value Function:: Return the un-expanded value of a variable. 207 238 * Eval Function:: Evaluate the arguments as makefile syntax. 208 239 * Origin Function:: Find where a variable got its value. 240 * Flavor Function:: Find out the flavor of a variable. 209 241 * Shell Function:: Substitute the output of a shell command. 210 242 * Make Control Functions:: Functions that control how make runs. … … 234 266 * Chained Rules:: How to use a chain of implicit rules. 235 267 * Pattern Rules:: How to define new implicit rules. 236 * Last Resort:: How to defin ing commands for rules237 whichcannot find any.268 * Last Resort:: How to define commands for rules which 269 cannot find any. 238 270 * Suffix Rules:: The old-fashioned style of implicit rule. 239 271 * Implicit Rule Search:: The precise algorithm for applying … … 264 296 * Archive Symbols:: How to update archive symbol directories. 265 297 266 Makefile Conventions267 268 * Makefile Basics:: General Conventions for Makefiles269 * Utilities in Makefiles:: Utilities in Makefiles270 * Command Variables:: Variables for Specifying Commands271 * Directory Variables:: Variables for Installation Directories272 * Standard Targets:: Standard Targets for Users273 * Install Command Categories:: Three categories of commands in the `install'274 275 Copying This Manual276 277 298 278 299 File: make.info, Node: Overview, Next: Introduction, Prev: Top, Up: Top 279 300 280 Overview of `make'281 ****************** 301 1 Overview of `make' 302 ******************** 282 303 283 304 The `make' utility automatically determines which pieces of a large … … 288 309 289 310 GNU `make' conforms to section 6.2 of `IEEE Standard 1003.2-1992' 290 (POSIX.2). 311 (POSIX.2). 291 312 292 313 Our examples show C programs, since they are most common, but you … … 330 351 File: make.info, Node: Reading, Next: Bugs, Prev: Preparing, Up: Overview 331 352 332 How to Read This Manual333 ======================= 353 1.1 How to Read This Manual 354 =========================== 334 355 335 356 If you are new to `make', or are looking for a general introduction, … … 351 372 File: make.info, Node: Bugs, Prev: Reading, Up: Overview 352 373 353 Problems and Bugs354 ================= 374 1.2 Problems and Bugs 375 ===================== 355 376 356 377 If you have problems with GNU `make' or think you've found a bug, … … 394 415 File: make.info, Node: Introduction, Next: Makefiles, Prev: Overview, Up: Top 395 416 396 An Introduction to Makefiles397 **************************** 417 2 An Introduction to Makefiles 418 ****************************** 398 419 399 420 You need a file called a "makefile" to tell `make' what to do. Most 400 often, the makefile tells `make' how to compile and link a program. 421 often, the makefile tells `make' how to compile and link a program. 401 422 402 423 In this chapter, we will discuss a simple makefile that describes … … 413 434 Finally, if any source file has been recompiled, all the object files, 414 435 whether newly made or saved from previous compilations, must be linked 415 together to produce the new executable editor. 436 together to produce the new executable editor. 416 437 417 438 * Menu: … … 428 449 File: make.info, Node: Rule Introduction, Next: Simple Makefile, Prev: Introduction, Up: Introduction 429 450 430 What a Rule Looks Like431 ====================== 451 2.1 What a Rule Looks Like 452 ========================== 432 453 433 454 A simple makefile consists of "rules" with the following shape: … … 471 492 File: make.info, Node: Simple Makefile, Next: How Make Works, Prev: Rule Introduction, Up: Introduction 472 493 473 A Simple Makefile474 ================= 494 2.2 A Simple Makefile 495 ===================== 475 496 476 497 Here is a straightforward makefile that describes the way an executable … … 486 507 cc -o edit main.o kbd.o command.o display.o \ 487 508 insert.o search.o files.o utils.o 488 509 489 510 main.o : main.c defs.h 490 511 cc -c main.c … … 508 529 509 530 We split each long line into two lines using backslash-newline; this is 510 like using one long line, but is easier to read. 531 like using one long line, but is easier to read. 511 532 512 533 To use this makefile to create the executable file called `edit', … … 536 557 prerequisites. These shell commands say how to update the target file. 537 558 A tab character must come at the beginning of every command line to 538 distinguish command slines from other lines in the makefile. (Bear in559 distinguish command lines from other lines in the makefile. (Bear in 539 560 mind that `make' does not know anything about how the commands work. 540 561 It is up to you to supply commands that will update the target file 541 562 properly. All `make' does is execute the commands in the rule you have 542 specified when the target file needs to be updated.) 563 specified when the target file needs to be updated.) 543 564 544 565 The target `clean' is not a file, but merely the name of an action. … … 551 572 called "phony targets". *Note Phony Targets::, for information about 552 573 this kind of target. *Note Errors in Commands: Errors, to see how to 553 cause `make' to ignore errors from `rm' or any other command. 574 cause `make' to ignore errors from `rm' or any other command. 554 575 555 576 556 577 File: make.info, Node: How Make Works, Next: Variables Simplify, Prev: Simple Makefile, Up: Introduction 557 578 558 How `make' Processes a Makefile559 =============================== 579 2.3 How `make' Processes a Makefile 580 =================================== 560 581 561 582 By default, `make' starts with the first target (not targets whose 562 583 names start with `.'). This is called the "default goal". ("Goals" 563 are the targets that `make' strives ultimately to update. *Note 564 Arguments to Specify the Goals: Goals.) 584 are the targets that `make' strives ultimately to update. You can 585 override this behavior using the command line (*note Arguments to 586 Specify the Goals: Goals.) or with the `.DEFAULT_GOAL' special variable 587 (*note Other Special Variables: Special Variables.). 565 588 566 589 In the simple example of the previous section, the default goal is to … … 597 620 not exist, or if any of the object files are newer than it. If an 598 621 object file was just recompiled, it is now newer than `edit', so `edit' 599 is relinked. 622 is relinked. 600 623 601 624 Thus, if we change the file `insert.c' and run `make', `make' will … … 608 631 File: make.info, Node: Variables Simplify, Next: make Deduces, Prev: How Make Works, Up: Introduction 609 632 610 Variables Make Makefiles Simpler611 ================================ 633 2.4 Variables Make Makefiles Simpler 634 ==================================== 612 635 613 636 In our example, we had to list all the object files twice in the rule … … 642 665 objects = main.o kbd.o command.o display.o \ 643 666 insert.o search.o files.o utils.o 644 667 645 668 edit : $(objects) 646 669 cc -o edit $(objects) … … 667 690 File: make.info, Node: make Deduces, Next: Combine By Prerequisite, Prev: Variables Simplify, Up: Introduction 668 691 669 Letting `make' Deduce the Commands670 ================================== 692 2.5 Letting `make' Deduce the Commands 693 ====================================== 671 694 672 695 It is not necessary to spell out the commands for compiling the … … 687 710 objects = main.o kbd.o command.o display.o \ 688 711 insert.o search.o files.o utils.o 689 712 690 713 edit : $(objects) 691 714 cc -o edit $(objects) 692 715 693 716 main.o : defs.h 694 717 kbd.o : defs.h command.h … … 699 722 files.o : defs.h buffer.h command.h 700 723 utils.o : defs.h 701 724 702 725 .PHONY : clean 703 726 clean : … … 714 737 File: make.info, Node: Combine By Prerequisite, Next: Cleanup, Prev: make Deduces, Up: Introduction 715 738 716 Another Style of Makefile717 ========================= 739 2.6 Another Style of Makefile 740 ============================= 718 741 719 742 When the objects of a makefile are created only by implicit rules, an … … 724 747 objects = main.o kbd.o command.o display.o \ 725 748 insert.o search.o files.o utils.o 726 749 727 750 edit : $(objects) 728 751 cc -o edit $(objects) 729 752 730 753 $(objects) : defs.h 731 754 kbd.o command.o files.o : command.h … … 743 766 File: make.info, Node: Cleanup, Prev: Combine By Prerequisite, Up: Introduction 744 767 745 Rules for Cleaning the Directory746 ================================ 768 2.7 Rules for Cleaning the Directory 769 ==================================== 747 770 748 771 Compiling a program is not the only thing you might want to write rules … … 782 805 File: make.info, Node: Makefiles, Next: Rules, Prev: Introduction, Up: Top 783 806 784 Writing Makefiles785 ***************** 807 3 Writing Makefiles 808 ******************* 786 809 787 810 The information that tells `make' how to recompile a system comes from … … 800 823 with another makefile. 801 824 * Reading Makefiles:: How makefiles are parsed. 825 * Secondary Expansion:: How and when secondary expansion is performed. 802 826 803 827 804 828 File: make.info, Node: Makefile Contents, Next: Makefile Names, Prev: Makefiles, Up: Makefiles 805 829 806 What Makefiles Contain807 ====================== 830 3.1 What Makefiles Contain 831 ========================== 808 832 809 833 Makefiles contain five kinds of things: "explicit rules", "implicit … … 865 889 File: make.info, Node: Makefile Names, Next: Include, Prev: Makefile Contents, Up: Makefiles 866 890 867 What Name to Give Your Makefile868 =============================== 891 3.2 What Name to Give Your Makefile 892 =================================== 869 893 870 894 By default, when `make' looks for the makefile, it tries the following 871 names, in order: `GNUmakefile', `makefile' and `Makefile'. 895 names, in order: `GNUmakefile', `makefile' and `Makefile'. 872 896 873 897 Normally you should call your makefile either `makefile' or … … 892 916 concatenated in the order specified. The default makefile names 893 917 `GNUmakefile', `makefile' and `Makefile' are not checked automatically 894 if you specify `-f' or `--file'. 918 if you specify `-f' or `--file'. 895 919 896 920 897 921 File: make.info, Node: Include, Next: MAKEFILES Variable, Prev: Makefile Names, Up: Makefiles 898 922 899 Including Other Makefiles900 ========================= 923 3.3 Including Other Makefiles 924 ============================= 901 925 902 926 The `include' directive tells `make' to suspend reading the current … … 906 930 include FILENAMES... 907 931 908 FILENAMES can contain shell file name patterns. 932 FILENAMES can contain shell file name patterns. If FILENAMES is empty, 933 nothing is included and no error is printed. 909 934 910 935 Extra spaces are allowed and ignored at the beginning of the line, … … 943 968 than that of somehow appending the prerequisites to the end of the main 944 969 makefile as has been traditionally done with other versions of `make'. 945 *Note Automatic Prerequisites::. 970 *Note Automatic Prerequisites::. 946 971 947 972 If the specified name does not start with a slash, and the file is … … 981 1006 File: make.info, Node: MAKEFILES Variable, Next: MAKEFILE_LIST Variable, Prev: Include, Up: Makefiles 982 1007 983 The Variable `MAKEFILES'984 ======================== 1008 3.4 The Variable `MAKEFILES' 1009 ============================ 985 1010 986 1011 If the environment variable `MAKEFILES' is defined, `make' considers … … 1010 1035 File: make.info, Node: MAKEFILE_LIST Variable, Next: Special Variables, Prev: MAKEFILES Variable, Up: Makefiles 1011 1036 1012 The Variable `MAKEFILE_LIST'1013 ============================ 1037 3.5 The Variable `MAKEFILE_LIST' 1038 ================================ 1014 1039 1015 1040 As `make' reads various makefiles, including any obtained from the … … 1026 1051 If a makefile named `Makefile' has this content: 1027 1052 1028 name1 := $( word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))1029 1053 name1 := $(lastword $(MAKEFILE_LIST)) 1054 1030 1055 include inc.mk 1031 1032 name2 := $( word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))1033 1056 1057 name2 := $(lastword $(MAKEFILE_LIST)) 1058 1034 1059 all: 1035 1060 @echo name1 = $(name1) … … 1049 1074 File: make.info, Node: Special Variables, Next: Remaking Makefiles, Prev: MAKEFILE_LIST Variable, Up: Makefiles 1050 1075 1051 Other Special Variables 1052 ======================= 1053 1054 GNU `make' also supports a special variable. Note that any value you 1055 assign to this variable will be ignored; it will always return its 1056 special value. 1057 1058 The first special variable is `.VARIABLES'. When expanded, the 1059 value consists of a list of the _names_ of all global variables defined 1060 in all makefiles read up until that point. This includes variables 1061 which have empty values, as well as built-in variables (*note Variables 1062 Used by Implicit Rules: Implicit Variables.), but does not include any 1063 variables which are only defined in a target-specific context. 1076 3.6 Other Special Variables 1077 =========================== 1078 1079 GNU `make' also supports other special variables. Unless otherwise 1080 documented here, these values lose their special properties if they are 1081 set by a makefile or on the command line. 1082 1083 `.DEFAULT_GOAL' 1084 Sets the default goal to be used if no targets were specified on 1085 the command line (*note Arguments to Specify the Goals: Goals.). 1086 The `.DEFAULT_GOAL' variable allows you to discover the current 1087 default goal, restart the default goal selection algorithm by 1088 clearing its value, or to explicitly set the default goal. The 1089 following example illustrates these cases: 1090 1091 # Query the default goal. 1092 ifeq ($(.DEFAULT_GOAL),) 1093 $(warning no default goal is set) 1094 endif 1095 1096 .PHONY: foo 1097 foo: ; @echo $@ 1098 1099 $(warning default goal is $(.DEFAULT_GOAL)) 1100 1101 # Reset the default goal. 1102 .DEFAULT_GOAL := 1103 1104 .PHONY: bar 1105 bar: ; @echo $@ 1106 1107 $(warning default goal is $(.DEFAULT_GOAL)) 1108 1109 # Set our own. 1110 .DEFAULT_GOAL := foo 1111 1112 This makefile prints: 1113 1114 no default goal is set 1115 default goal is foo 1116 default goal is bar 1117 foo 1118 1119 Note that assigning more than one target name to `.DEFAULT_GOAL' is 1120 illegal and will result in an error. 1121 1122 `MAKE_RESTARTS' 1123 This variable is set only if this instance of `make' has restarted 1124 (*note How Makefiles Are Remade: Remaking Makefiles.): it will 1125 contain the number of times this instance has restarted. Note 1126 this is not the same as recursion (counted by the `MAKELEVEL' 1127 variable). You should not set, modify, or export this variable. 1128 1129 `.VARIABLES' 1130 Expands to a list of the _names_ of all global variables defined 1131 so far. This includes variables which have empty values, as well 1132 as built-in variables (*note Variables Used by Implicit Rules: 1133 Implicit Variables.), but does not include any variables which are 1134 only defined in a target-specific context. Note that any value 1135 you assign to this variable will be ignored; it will always return 1136 its special value. 1137 1138 `.FEATURES' 1139 Expands to a list of special features supported by this version of 1140 `make'. Possible values include: 1141 1142 `archives' 1143 Supports `ar' (archive) files using special filename syntax. 1144 *Note Using `make' to Update Archive Files: Archives. 1145 1146 `check-symlink' 1147 Supports the `-L' (`--check-symlink-times') flag. *Note 1148 Summary of Options: Options Summary. 1149 1150 `else-if' 1151 Supports "else if" non-nested conditionals. *Note Syntax of 1152 Conditionals: Conditional Syntax. 1153 1154 `jobserver' 1155 Supports "job server" enhanced parallel builds. *Note 1156 Parallel Execution: Parallel. 1157 1158 `second-expansion' 1159 Supports secondary expansion of prerequisite lists. 1160 1161 `order-only' 1162 Supports order-only prerequisites. *Note Types of 1163 Prerequisites: Prerequisite Types. 1164 1165 `target-specific' 1166 Supports target-specific and pattern-specific variable 1167 assignments. *Note Target-specific Variable Values: 1168 Target-specific. 1169 1170 1171 `.INCLUDE_DIRS' 1172 Expands to a list of directories that `make' searches for included 1173 makefiles (*note Including Other Makefiles: Include.). 1174 1064 1175 1065 1176 1066 1177 File: make.info, Node: Remaking Makefiles, Next: Overriding Makefiles, Prev: Special Variables, Up: Makefiles 1067 1178 1068 How Makefiles Are Remade1069 ======================== 1179 3.7 How Makefiles Are Remade 1180 ============================ 1070 1181 1071 1182 Sometimes makefiles can be remade from other files, such as RCS or SCCS … … 1104 1215 If you do not specify any makefiles to be read with `-f' or `--file' 1105 1216 options, `make' will try the default makefile names; *note What Name to 1106 Give Your Makefile: Makefile Names. .Unlike makefiles explicitly1217 Give Your Makefile: Makefile Names. Unlike makefiles explicitly 1107 1218 requested with `-f' or `--file' options, `make' is not certain that 1108 1219 these makefiles should exist. However, if a default makefile does not … … 1144 1255 File: make.info, Node: Overriding Makefiles, Next: Reading Makefiles, Prev: Remaking Makefiles, Up: Makefiles 1145 1256 1146 Overriding Part of Another Makefile1147 =================================== 1257 3.8 Overriding Part of Another Makefile 1258 ======================================= 1148 1259 1149 1260 Sometimes it is useful to have a makefile that is mostly just like … … 1165 1276 foo: 1166 1277 frobnicate > foo 1167 1278 1168 1279 %: force 1169 1280 @$(MAKE) -f Makefile $@ … … 1187 1298 1188 1299 1189 File: make.info, Node: Reading Makefiles, Prev: Overriding Makefiles, Up: Makefiles1190 1191 How `make' Reads a Makefile1192 =========================== 1300 File: make.info, Node: Reading Makefiles, Next: Secondary Expansion, Prev: Overriding Makefiles, Up: Makefiles 1301 1302 3.9 How `make' Reads a Makefile 1303 =============================== 1193 1304 1194 1305 GNU `make' does its work in two distinct phases. During the first … … 1225 1336 IMMEDIATE := IMMEDIATE 1226 1337 IMMEDIATE += DEFERRED or IMMEDIATE 1227 1338 1228 1339 define IMMEDIATE 1229 1340 DEFERRED … … 1239 1350 All instances of conditional syntax are parsed immediately, in their 1240 1351 entirety; this includes the `ifdef', `ifeq', `ifndef', and `ifneq' 1241 forms. 1352 forms. Of course this means that automatic variables cannot be used in 1353 conditional statements, as automatic variables are not set until the 1354 command script for that rule is invoked. If you need to use automatic 1355 variables in a conditional you _must_ use shell conditional syntax, in 1356 your command script proper, for these tests, not `make' conditionals. 1242 1357 1243 1358 Rule Definition … … 1255 1370 1256 1371 1372 File: make.info, Node: Secondary Expansion, Prev: Reading Makefiles, Up: Makefiles 1373 1374 3.10 Secondary Expansion 1375 ======================== 1376 1377 In the previous section we learned that GNU `make' works in two 1378 distinct phases: a read-in phase and a target-update phase (*note How 1379 `make' Reads a Makefile: Reading Makefiles.). GNU make also has the 1380 ability to enable a _second expansion_ of the prerequisites (only) for 1381 some or all targets defined in the makefile. In order for this second 1382 expansion to occur, the special target `.SECONDEXPANSION' must be 1383 defined before the first prerequisite list that makes use of this 1384 feature. 1385 1386 If that special target is defined then in between the two phases 1387 mentioned above, right at the end of the read-in phase, all the 1388 prerequisites of the targets defined after the special target are 1389 expanded a _second time_. In most circumstances this secondary 1390 expansion will have no effect, since all variable and function 1391 references will have been expanded during the initial parsing of the 1392 makefiles. In order to take advantage of the secondary expansion phase 1393 of the parser, then, it's necessary to _escape_ the variable or 1394 function reference in the makefile. In this case the first expansion 1395 merely un-escapes the reference but doesn't expand it, and expansion is 1396 left to the secondary expansion phase. For example, consider this 1397 makefile: 1398 1399 .SECONDEXPANSION: 1400 ONEVAR = onefile 1401 TWOVAR = twofile 1402 myfile: $(ONEVAR) $$(TWOVAR) 1403 1404 After the first expansion phase the prerequisites list of the 1405 `myfile' target will be `onefile' and `$(TWOVAR)'; the first 1406 (unescaped) variable reference to ONEVAR is expanded, while the second 1407 (escaped) variable reference is simply unescaped, without being 1408 recognized as a variable reference. Now during the secondary expansion 1409 the first word is expanded again but since it contains no variable or 1410 function references it remains the static value `onefile', while the 1411 second word is now a normal reference to the variable TWOVAR, which is 1412 expanded to the value `twofile'. The final result is that there are 1413 two prerequisites, `onefile' and `twofile'. 1414 1415 Obviously, this is not a very interesting case since the same result 1416 could more easily have been achieved simply by having both variables 1417 appear, unescaped, in the prerequisites list. One difference becomes 1418 apparent if the variables are reset; consider this example: 1419 1420 .SECONDEXPANSION: 1421 AVAR = top 1422 onefile: $(AVAR) 1423 twofile: $$(AVAR) 1424 AVAR = bottom 1425 1426 Here the prerequisite of `onefile' will be expanded immediately, and 1427 resolve to the value `top', while the prerequisite of `twofile' will 1428 not be full expanded until the secondary expansion and yield a value of 1429 `bottom'. 1430 1431 This is marginally more exciting, but the true power of this feature 1432 only becomes apparent when you discover that secondary expansions 1433 always take place within the scope of the automatic variables for that 1434 target. This means that you can use variables such as `$@', `$*', etc. 1435 during the second expansion and they will have their expected values, 1436 just as in the command script. All you have to do is defer the 1437 expansion by escaping the `$'. Also, secondary expansion occurs for 1438 both explicit and implicit (pattern) rules. Knowing this, the possible 1439 uses for this feature increase dramatically. For example: 1440 1441 .SECONDEXPANSION: 1442 main_OBJS := main.o try.o test.o 1443 lib_OBJS := lib.o api.o 1444 1445 main lib: $$($$@_OBJS) 1446 1447 Here, after the initial expansion the prerequisites of both the 1448 `main' and `lib' targets will be `$($@_OBJS)'. During the secondary 1449 expansion, the `$@' variable is set to the name of the target and so 1450 the expansion for the `main' target will yield `$(main_OBJS)', or 1451 `main.o try.o test.o', while the secondary expansion for the `lib' 1452 target will yield `$(lib_OBJS)', or `lib.o api.o'. 1453 1454 You can also mix functions here, as long as they are properly 1455 escaped: 1456 1457 main_SRCS := main.c try.c test.c 1458 lib_SRCS := lib.c api.c 1459 1460 .SECONDEXPANSION: 1461 main lib: $$(patsubst %.c,%.o,$$($$@_SRCS)) 1462 1463 This version allows users to specify source files rather than object 1464 files, but gives the same resulting prerequisites list as the previous 1465 example. 1466 1467 Evaluation of automatic variables during the secondary expansion 1468 phase, especially of the target name variable `$$@', behaves similarly 1469 to evaluation within command scripts. However, there are some subtle 1470 differences and "corner cases" which come into play for the different 1471 types of rule definitions that `make' understands. The subtleties of 1472 using the different automatic variables are described below. 1473 1474 Secondary Expansion of Explicit Rules 1475 ------------------------------------- 1476 1477 During the secondary expansion of explicit rules, `$$@' and `$$%' 1478 evaluate, respectively, to the file name of the target and, when the 1479 target is an archive member, the target member name. The `$$<' 1480 variable evaluates to the first prerequisite in the first rule for this 1481 target. `$$^' and `$$+' evaluate to the list of all prerequisites of 1482 rules _that have already appeared_ for the same target (`$$+' with 1483 repetitions and `$$^' without). The following example will help 1484 illustrate these behaviors: 1485 1486 .SECONDEXPANSION: 1487 1488 foo: foo.1 bar.1 $$< $$^ $$+ # line #1 1489 1490 foo: foo.2 bar.2 $$< $$^ $$+ # line #2 1491 1492 foo: foo.3 bar.3 $$< $$^ $$+ # line #3 1493 1494 In the first prerequisite list, all three variables (`$$<', `$$^', 1495 and `$$+') expand to the empty string. In the second, they will have 1496 values `foo.1', `foo.1 bar.1', and `foo.1 bar.1' respectively. In the 1497 third they will have values `foo.1', `foo.1 bar.1 foo.2 bar.2', and 1498 `foo.1 bar.1 foo.2 bar.2' respectively. 1499 1500 Rules undergo secondary expansion in makefile order, except that the 1501 rule with the command script is always evaluated last. 1502 1503 The variables `$$?' and `$$*' are not available and expand to the 1504 empty string. 1505 1506 Secondary Expansion of Static Pattern Rules 1507 ------------------------------------------- 1508 1509 Rules for secondary expansion of static pattern rules are identical to 1510 those for explicit rules, above, with one exception: for static pattern 1511 rules the `$$*' variable is set to the pattern stem. As with explicit 1512 rules, `$$?' is not available and expands to the empty string. 1513 1514 Secondary Expansion of Implicit Rules 1515 ------------------------------------- 1516 1517 As `make' searches for an implicit rule, it substitutes the stem and 1518 then performs secondary expansion for every rule with a matching target 1519 pattern. The value of the automatic variables is derived in the same 1520 fashion as for static pattern rules. As an example: 1521 1522 .SECONDEXPANSION: 1523 1524 foo: bar 1525 1526 foo foz: fo%: bo% 1527 1528 %oo: $$< $$^ $$+ $$* 1529 1530 When the implicit rule is tried for target `foo', `$$<' expands to 1531 `bar', `$$^' expands to `bar boo', `$$+' also expands to `bar boo', and 1532 `$$*' expands to `f'. 1533 1534 Note that the directory prefix (D), as described in *Note Implicit 1535 Rule Search Algorithm: Implicit Rule Search, is appended (after 1536 expansion) to all the patterns in the prerequisites list. As an 1537 example: 1538 1539 .SECONDEXPANSION: 1540 1541 /tmp/foo.o: 1542 1543 %.o: $$(addsuffix /%.c,foo bar) foo.h 1544 1545 The prerequisite list after the secondary expansion and directory 1546 prefix reconstruction will be `/tmp/foo/foo.c /tmp/var/bar/foo.c 1547 foo.h'. If you are not interested in this reconstruction, you can use 1548 `$$*' instead of `%' in the prerequisites list. 1549 1550 1257 1551 File: make.info, Node: Rules, Next: Commands, Prev: Makefiles, Up: Top 1258 1552 1259 Writing Rules1260 ************* 1553 4 Writing Rules 1554 *************** 1261 1555 1262 1556 A "rule" appears in the makefile and says when and how to remake … … 1289 1583 * Phony Targets:: Using a target that is not a real file's name. 1290 1584 * Force Targets:: You can use a target without commands 1291 or prerequisites to mark other 1292 targetsas phony.1585 or prerequisites to mark other targets 1586 as phony. 1293 1587 * Empty Targets:: When only the date matters and the 1294 1588 files are empty. … … 1307 1601 File: make.info, Node: Rule Example, Next: Rule Syntax, Prev: Rules, Up: Rules 1308 1602 1309 Rule Example1310 ============ 1603 4.1 Rule Example 1604 ================ 1311 1605 1312 1606 Here is an example of a rule: … … 1333 1627 File: make.info, Node: Rule Syntax, Next: Prerequisite Types, Prev: Rule Example, Up: Rules 1334 1628 1335 Rule Syntax1336 =========== 1629 4.2 Rule Syntax 1630 =============== 1337 1631 1338 1632 In general, a rule looks like this: … … 1359 1653 appear on the line after the prerequisites, with a tab character, or may 1360 1654 appear on the same line, with a semicolon. Either way, the effect is 1361 the same. *Note Writing the Commands in Rules: Commands. 1362 1363 Because dollar signs are used to start variable references, if you 1364 really want a dollar sign in a rule you must write two of them, `$$' 1365 (*note How to Use Variables: Using Variables.). You may split a long 1366 line by inserting a backslash followed by a newline, but this is not 1367 required, as `make' places no limit on the length of a line in a 1368 makefile. 1655 the same. There are other differences in the syntax of command lines. 1656 *Note Writing the Commands in Rules: Commands. 1657 1658 Because dollar signs are used to start `make' variable references, 1659 if you really want a dollar sign in a target or prerequisite you must 1660 write two of them, `$$' (*note How to Use Variables: Using Variables.). 1661 If you have enabled secondary expansion (*note Secondary Expansion::) 1662 and you want a literal dollar sign in the prerequisites lise, you must 1663 actually write _four_ dollar signs (`$$$$'). 1664 1665 You may split a long line by inserting a backslash followed by a 1666 newline, but this is not required, as `make' places no limit on the 1667 length of a line in a makefile. 1369 1668 1370 1669 A rule tells `make' two things: when the targets are out of date, … … 1388 1687 File: make.info, Node: Prerequisite Types, Next: Wildcards, Prev: Rule Syntax, Up: Rules 1389 1688 1390 Types of Prerequisites1391 ====================== 1689 4.3 Types of Prerequisites 1690 ========================== 1392 1691 1393 1692 There are actually two different types of prerequisites understood by … … 1424 1723 File: make.info, Node: Wildcards, Next: Directory Search, Prev: Prerequisite Types, Up: Rules 1425 1724 1426 Using Wildcard Characters in File Names1427 ======================================= 1725 4.4 Using Wildcard Characters in File Names 1726 =========================================== 1428 1727 1429 1728 A single file name can specify many files using "wildcard characters". … … 1441 1740 simulated by setting the environment variable HOME. 1442 1741 1443 Wildcard expansion happens automatically in targets, in1444 prerequisites, and in commands (where the shell does the expansion). 1445 In other contexts, wildcard expansion happens only if you request it 1446 explicitly with the `wildcard' function.1742 Wildcard expansion is performed by `make' automatically in targets 1743 and in prerequisites. In commands the shell is responsible for 1744 wildcard expansion. In other contexts, wildcard expansion happens only 1745 if you request it explicitly with the `wildcard' function. 1447 1746 1448 1747 The special significance of a wildcard character can be turned off by … … 1460 1759 File: make.info, Node: Wildcard Examples, Next: Wildcard Pitfall, Prev: Wildcards, Up: Wildcards 1461 1760 1462 Wildcard Examples1463 ----------------- 1761 4.4.1 Wildcard Examples 1762 ----------------------- 1464 1763 1465 1764 Wildcards can be used in the commands of a rule, where they are expanded … … 1500 1799 File: make.info, Node: Wildcard Pitfall, Next: Wildcard Function, Prev: Wildcard Examples, Up: Wildcards 1501 1800 1502 Pitfalls of Using Wildcards1503 --------------------------- 1801 4.4.2 Pitfalls of Using Wildcards 1802 --------------------------------- 1504 1803 1505 1804 Now here is an example of a naive way of using wildcard expansion, that … … 1509 1808 1510 1809 objects = *.o 1511 1810 1512 1811 foo : $(objects) 1513 1812 cc -o foo $(CFLAGS) $(objects) … … 1543 1842 File: make.info, Node: Wildcard Function, Prev: Wildcard Pitfall, Up: Wildcards 1544 1843 1545 The Function `wildcard'1546 ----------------------- 1844 4.4.3 The Function `wildcard' 1845 ----------------------------- 1547 1846 1548 1847 Wildcard expansion happens automatically in rules. But wildcard … … 1579 1878 1580 1879 objects := $(patsubst %.c,%.o,$(wildcard *.c)) 1581 1880 1582 1881 foo : $(objects) 1583 1882 cc -o foo $(objects) … … 1591 1890 File: make.info, Node: Directory Search, Next: Phony Targets, Prev: Wildcards, Up: Rules 1592 1891 1593 Searching Directories for Prerequisites1594 ======================================= 1892 4.5 Searching Directories for Prerequisites 1893 =========================================== 1595 1894 1596 1895 For large systems, it is often desirable to put sources in a separate … … 1615 1914 File: make.info, Node: General Search, Next: Selective Search, Prev: Directory Search, Up: Directory Search 1616 1915 1617 `VPATH': Search Path for All Prerequisites1618 ------------------------------------------ 1916 4.5.1 `VPATH': Search Path for All Prerequisites 1917 ------------------------------------------------ 1619 1918 1620 1919 The value of the `make' variable `VPATH' specifies a list of … … 1659 1958 File: make.info, Node: Selective Search, Next: Search Algorithm, Prev: General Search, Up: Directory Search 1660 1959 1661 The `vpath' Directive1662 --------------------- 1960 4.5.2 The `vpath' Directive 1961 --------------------------- 1663 1962 1664 1963 Similar to the `VPATH' variable, but more selective, is the `vpath' … … 1738 2037 File: make.info, Node: Search Algorithm, Next: Commands/Search, Prev: Selective Search, Up: Directory Search 1739 2038 1740 How Directory Searches are Performed1741 ------------------------------------ 2039 4.5.3 How Directory Searches are Performed 2040 ------------------------------------------ 1742 2041 1743 2042 When a prerequisite is found through directory search, regardless of … … 1796 2095 File: make.info, Node: Commands/Search, Next: Implicit/Search, Prev: Search Algorithm, Up: Directory Search 1797 2096 1798 Writing Shell Commands with Directory Search1799 -------------------------------------------- 2097 4.5.4 Writing Shell Commands with Directory Search 2098 -------------------------------------------------- 1800 2099 1801 2100 When a prerequisite is found in another directory through directory … … 1817 2116 compilation by implicit rules; we use it here for consistency so it will 1818 2117 affect all C compilations uniformly; *note Variables Used by Implicit 1819 Rules: Implicit Variables. .)2118 Rules: Implicit Variables.) 1820 2119 1821 2120 Often the prerequisites include header files as well, which you do … … 1830 2129 File: make.info, Node: Implicit/Search, Next: Libraries/Search, Prev: Commands/Search, Up: Directory Search 1831 2130 1832 Directory Search and Implicit Rules1833 ----------------------------------- 2131 4.5.5 Directory Search and Implicit Rules 2132 ----------------------------------------- 1834 2133 1835 2134 The search through the directories specified in `VPATH' or with `vpath' … … 1851 2150 File: make.info, Node: Libraries/Search, Prev: Implicit/Search, Up: Directory Search 1852 2151 1853 Directory Search for Link Libraries1854 ----------------------------------- 2152 4.5.6 Directory Search for Link Libraries 2153 ----------------------------------------- 1855 2154 1856 2155 Directory search applies in a special way to libraries used with the … … 1890 2189 word in the list will be used. 1891 2190 1892 The default value for `.LIBPATTERNS' is "`lib%.so lib%.a'", which2191 The default value for `.LIBPATTERNS' is `lib%.so lib%.a', which 1893 2192 provides the default behavior described above. 1894 2193 … … 1899 2198 File: make.info, Node: Phony Targets, Next: Force Targets, Prev: Directory Search, Up: Rules 1900 2199 1901 Phony Targets1902 ============= 2200 4.6 Phony Targets 2201 ================= 1903 2202 1904 2203 A phony target is one that is not really the name of a file. It is … … 1916 2215 Because the `rm' command does not create a file named `clean', probably 1917 2216 no such file will ever exist. Therefore, the `rm' command will be 1918 executed every time you say `make clean'. 2217 executed every time you say `make clean'. 1919 2218 1920 2219 The phony target will cease to work if anything ever does create a … … 1946 2245 Another example of the usefulness of phony targets is in conjunction 1947 2246 with recursive invocations of `make' (for more information, see *Note 1948 Recursive Use of `make': Recursion ). In this case the makefile will2247 Recursive Use of `make': Recursion.). In this case the makefile will 1949 2248 often contain a variable which lists a number of subdirectories to be 1950 2249 built. One way to handle this is with one rule whose command is a … … 1952 2251 1953 2252 SUBDIRS = foo bar baz 1954 2253 1955 2254 subdirs: 1956 2255 for dir in $(SUBDIRS); do \ … … 1964 2263 it will do so even if `make' is invoked with the `-k' option, which is 1965 2264 unfortunate. Second, and perhaps more importantly, you cannot take 1966 advantage of the parallel build capabilities of make using this method,1967 since there is only one rule.2265 advantage of `make''s ability to build targets in parallel (*note 2266 Parallel Execution: Parallel.), since there is only one rule. 1968 2267 1969 2268 By declaring the subdirectories as phony targets (you must do this as … … 1972 2271 1973 2272 SUBDIRS = foo bar baz 1974 2273 1975 2274 .PHONY: subdirs $(SUBDIRS) 1976 2275 1977 2276 subdirs: $(SUBDIRS) 1978 2277 1979 2278 $(SUBDIRS): 1980 2279 $(MAKE) -C $@ 1981 2280 1982 2281 foo: baz 1983 2282 … … 2003 2302 all : prog1 prog2 prog3 2004 2303 .PHONY : all 2005 2304 2006 2305 prog1 : prog1.o utils.o 2007 2306 cc -o prog1 prog1.o utils.o 2008 2307 2009 2308 prog2 : prog2.o 2010 2309 cc -o prog2 prog2.o 2011 2310 2012 2311 prog3 : prog3.o sort.o utils.o 2013 2312 cc -o prog3 prog3.o sort.o utils.o 2014 2313 2015 2314 Now you can say just `make' to remake all three programs, or specify as 2016 arguments the ones to remake (as in `make prog1 prog3'). 2315 arguments the ones to remake (as in `make prog1 prog3'). Phoniness is 2316 not inherited: the prerequisites of a phony target are not themselves 2317 phony, unless explicitly declared to be so. 2017 2318 2018 2319 When one phony target is a prerequisite of another, it serves as a … … 2021 2322 2022 2323 .PHONY: cleanall cleanobj cleandiff 2023 2324 2024 2325 cleanall : cleanobj cleandiff 2025 2326 rm program 2026 2327 2027 2328 cleanobj : 2028 2329 rm *.o 2029 2330 2030 2331 cleandiff : 2031 2332 rm *.diff … … 2034 2335 File: make.info, Node: Force Targets, Next: Empty Targets, Prev: Phony Targets, Up: Rules 2035 2336 2036 Rules without Commands or Prerequisites2037 ======================================= 2337 4.7 Rules without Commands or Prerequisites 2338 =========================================== 2038 2339 2039 2340 If a rule has no prerequisites or commands, and the target of the rule … … 2063 2364 File: make.info, Node: Empty Targets, Next: Special Targets, Prev: Force Targets, Up: Rules 2064 2365 2065 Empty Target Files to Record Events2066 =================================== 2366 4.8 Empty Target Files to Record Events 2367 ======================================= 2067 2368 2068 2369 The "empty target" is a variant of the phony target; it is used to hold … … 2085 2386 lpr -p $? 2086 2387 touch print 2087 2388 2088 2389 With this rule, `make print' will execute the `lpr' command if either 2089 2390 source file has changed since the last `make print'. The automatic … … 2094 2395 File: make.info, Node: Special Targets, Next: Multiple Targets, Prev: Empty Targets, Up: Rules 2095 2396 2096 Special Built-in Target Names2097 ============================= 2397 4.9 Special Built-in Target Names 2398 ================================= 2098 2399 2099 2400 Certain names have special meanings if they appear as targets. … … 2148 2449 intermediate). 2149 2450 2451 `.SECONDEXPANSION' 2452 If `.SECONDEXPANSION' is mentioned as a target anywhere in the 2453 makefile, then all prerequisite lists defined _after_ it appears 2454 will be expanded a second time after all makefiles have been read 2455 in. *Note Secondary Expansion: Secondary Expansion. 2456 2457 The prerequisites of the special target `.SUFFIXES' are the list 2458 of suffixes to be used in checking for suffix rules. *Note 2459 Old-Fashioned Suffix Rules: Suffix Rules. 2460 2150 2461 `.DELETE_ON_ERROR' 2151 2462 If `.DELETE_ON_ERROR' is mentioned as a target anywhere in the … … 2234 2545 File: make.info, Node: Multiple Targets, Next: Multiple Rules, Prev: Special Targets, Up: Rules 2235 2546 2236 Multiple Targets in a Rule2237 ========================== 2547 4.10 Multiple Targets in a Rule 2548 =============================== 2238 2549 2239 2550 A rule with multiple targets is equivalent to writing many rules, each … … 2259 2570 bigoutput littleoutput : text.g 2260 2571 generate text.g -$(subst output,,$@) > $@ 2261 2572 2262 2573 is equivalent to 2263 2574 … … 2281 2592 File: make.info, Node: Multiple Rules, Next: Static Pattern, Prev: Multiple Targets, Up: Rules 2282 2593 2283 Multiple Rules for One Target2284 ============================= 2594 4.11 Multiple Rules for One Target 2595 ================================== 2285 2596 2286 2597 One file can be the target of several rules. All the prerequisites … … 2332 2643 File: make.info, Node: Static Pattern, Next: Double-Colon, Prev: Multiple Rules, Up: Rules 2333 2644 2334 Static Pattern Rules2335 ==================== 2645 4.12 Static Pattern Rules 2646 ========================= 2336 2647 2337 2648 "Static pattern rules" are rules which specify multiple targets and … … 2349 2660 File: make.info, Node: Static Usage, Next: Static versus Implicit, Prev: Static Pattern, Up: Static Pattern 2350 2661 2351 Syntax of Static Pattern Rules2352 ------------------------------ 2662 4.12.1 Syntax of Static Pattern Rules 2663 ------------------------------------- 2353 2664 2354 2665 Here is the syntax of a static pattern rule: … … 2398 2709 2399 2710 objects = foo.o bar.o 2400 2711 2401 2712 all: $(objects) 2402 2713 2403 2714 $(objects): %.o: %.c 2404 2715 $(CC) -c $(CFLAGS) $< -o $@ … … 2415 2726 2416 2727 files = foo.elc bar.o lose.o 2417 2728 2418 2729 $(filter %.o,$(files)): %.o: %.c 2419 2730 $(CC) -c $(CFLAGS) $< -o $@ … … 2427 2738 from `foo.el'. 2428 2739 2429 Another example shows how to use `$*' in static pattern rules: 2740 Another example shows how to use `$*' in static pattern rules: 2430 2741 2431 2742 bigoutput littleoutput : %output : text.g … … 2438 2749 File: make.info, Node: Static versus Implicit, Prev: Static Usage, Up: Static Pattern 2439 2750 2440 Static Pattern Rules versus Implicit Rules2441 ------------------------------------------ 2751 4.12.2 Static Pattern Rules versus Implicit Rules 2752 ------------------------------------------------- 2442 2753 2443 2754 A static pattern rule has much in common with an implicit rule defined … … 2475 2786 File: make.info, Node: Double-Colon, Next: Automatic Prerequisites, Prev: Static Pattern, Up: Rules 2476 2787 2477 Double-Colon Rules2478 ================== 2788 4.13 Double-Colon Rules 2789 ======================= 2479 2790 2480 2791 "Double-colon" rules are rules written with `::' instead of `:' after … … 2512 2823 File: make.info, Node: Automatic Prerequisites, Prev: Double-Colon, Up: Rules 2513 2824 2514 Generating Prerequisites Automatically2515 ====================================== 2825 4.14 Generating Prerequisites Automatically 2826 =========================================== 2516 2827 2517 2828 In the makefile for a program, many of the rules you need to write often … … 2525 2836 would have to write dozens of such rules in your makefile. And, you 2526 2837 must always be very careful to update the makefile every time you add 2527 or remove an `#include'. 2838 or remove an `#include'. 2528 2839 2529 2840 To avoid this hassle, most modern C compilers can write these rules … … 2544 2855 makefile, so it can never be considered an intermediate file by implicit 2545 2856 rule search. This means that `make' won't ever remove the file after 2546 using it; *note Chains of Implicit Rules: Chained Rules. .2857 using it; *note Chains of Implicit Rules: Chained Rules. 2547 2858 2548 2859 With old `make' programs, it was traditional practice to use this … … 2568 2879 2569 2880 %.d: %.c 2570 2881 @set -e; rm -f $@; \ 2571 2882 $(CC) -M $(CPPFLAGS) $< > $@.$$$$; \ 2572 2883 sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ … … 2575 2886 *Note Pattern Rules::, for information on defining pattern rules. The 2576 2887 `-e' flag to the shell causes it to exit immediately if the `$(CC)' 2577 command (or any other command) fails (exits with a nonzero status). 2888 command (or any other command) fails (exits with a nonzero status). 2578 2889 2579 2890 With the GNU C compiler, you may wish to use the `-MM' flag instead … … 2600 2911 2601 2912 sources = foo.c bar.c 2602 2913 2603 2914 include $(sources:.c=.d) 2604 2915 … … 2611 2922 2612 2923 Note that the `.d' files contain target definitions; you should be 2613 sure to place the `include' directive _after_ the first, default target2924 sure to place the `include' directive _after_ the first, default goal 2614 2925 in your makefiles or run the risk of having a random object file become 2615 the default target. *Note How Make Works::.2926 the default goal. *Note How Make Works::. 2616 2927 2617 2928 2618 2929 File: make.info, Node: Commands, Next: Using Variables, Prev: Rules, Up: Top 2619 2930 2620 Writing the Commands in Rules 2621 ***************************** 2622 2623 The commands of a rule consist of shell command lines to be executed one 2624 by one. Each command line must start with a tab, except that the first 2625 command line may be attached to the target-and-prerequisites line with a 2626 semicolon in between. Blank lines and lines of just comments may appear 2627 among the command lines; they are ignored. (But beware, an apparently 2628 "blank" line that begins with a tab is _not_ blank! It is an empty 2629 command; *note Empty Commands::.) 2931 5 Writing the Commands in Rules 2932 ******************************* 2933 2934 The commands of a rule consist of one or more shell command lines to be 2935 executed, one at a time, in the order they appear. Typically, the 2936 result of executing these commands is that the target of the rule is 2937 brought up to date. 2630 2938 2631 2939 Users use many different shell programs, but commands in makefiles … … 2633 2941 otherwise. *Note Command Execution: Execution. 2634 2942 2635 The shell that is in use determines whether comments can be written2636 on command lines, and what syntax they use. When the shell is2637 `/bin/sh', a `#' starts a comment that extends to the end of the line.2638 The `#' does not have to be at the beginning of a line. Text on a line2639 before a `#' is not part of the comment.2640 2641 2943 * Menu: 2642 2944 2945 * Command Syntax:: Command syntax features and pitfalls. 2643 2946 * Echoing:: How to control when commands are echoed. 2644 2947 * Execution:: How commands are executed. … … 2651 2954 2652 2955 2653 File: make.info, Node: Echoing, Next: Execution, Prev: Commands, Up: Commands 2654 2655 Command Echoing 2656 =============== 2956 File: make.info, Node: Command Syntax, Next: Echoing, Prev: Commands, Up: Commands 2957 2958 5.1 Command Syntax 2959 ================== 2960 2961 Makefiles have the unusual property that there are really two distinct 2962 syntaxes in one file. Most of the makefile uses `make' syntax (*note 2963 Writing Makefiles: Makefiles.). However, commands are meant to be 2964 interpreted by the shell and so they are written using shell syntax. 2965 The `make' program does not try to understand shell syntax: it performs 2966 only a very few specific translations on the content of the command 2967 before handing it to the shell. 2968 2969 Each command line must start with a tab, except that the first 2970 command line may be attached to the target-and-prerequisites line with a 2971 semicolon in between. _Any_ line in the makefile that begins with a 2972 tab and appears in a "rule context" (that is, after a rule has been 2973 started until another rule or variable definition) will be considered a 2974 command line for that rule. Blank lines and lines of just comments may 2975 appear among the command lines; they are ignored. 2976 2977 Some consequences of these rules include: 2978 2979 * A blank line that begins with a tab is not blank: it's an empty 2980 command (*note Empty Commands::). 2981 2982 * A comment in a command line is not a `make' comment; it will be 2983 passed to the shell as-is. Whether the shell treats it as a 2984 comment or not depends on your shell. 2985 2986 * A variable definition in a "rule context" which is indented by a 2987 tab as the first character on the line, will be considered a 2988 command line, not a `make' variable definition, and passed to the 2989 shell. 2990 2991 * A conditional expression (`ifdef', `ifeq', etc. *note Syntax of 2992 Conditionals: Conditional Syntax.) in a "rule context" which is 2993 indented by a tab as the first character on the line, will be 2994 considered a command line and be passed to the shell. 2995 2996 2997 * Menu: 2998 2999 * Splitting Lines:: Breaking long command lines for readability. 3000 * Variables in Commands:: Using `make' variables in commands. 3001 3002 3003 File: make.info, Node: Splitting Lines, Next: Variables in Commands, Prev: Command Syntax, Up: Command Syntax 3004 3005 5.1.1 Splitting Command Lines 3006 ----------------------------- 3007 3008 One of the few ways in which `make' does interpret command lines is 3009 checking for a backslash just before the newline. As in normal 3010 makefile syntax, a single command can be split into multiple lines in 3011 the makefile by placing a backslash before each newline. A sequence of 3012 lines like this is considered a single command, and one instance of the 3013 shell will be invoked to run it. 3014 3015 However, in contrast to how they are treated in other places in a 3016 makefile, backslash-newline pairs are _not_ removed from the command. 3017 Both the backslash and the newline characters are preserved and passed 3018 to the shell. How the backslash-newline is interpreted depends on your 3019 shell. If the first character of the next line after the 3020 backslash-newline is a tab, then that tab (and only that tab) is 3021 removed. Whitespace is never added to the command. 3022 3023 For example, this makefile: 3024 3025 all : 3026 @echo no\ 3027 space 3028 @echo no\ 3029 space 3030 @echo one \ 3031 space 3032 @echo one\ 3033 space 3034 3035 consists of four separate shell commands where the output is: 3036 3037 nospace 3038 nospace 3039 one space 3040 one space 3041 3042 As a more complex example, this makefile: 3043 3044 all : ; @echo 'hello \ 3045 world' ; echo "hello \ 3046 world" 3047 3048 will run one shell with a command script of: 3049 3050 echo 'hello \ 3051 world' ; echo "hello \ 3052 world" 3053 3054 which, according to shell quoting rules, will yield the following 3055 output: 3056 3057 hello \ 3058 world 3059 hello world 3060 3061 Notice how the backslash/newline pair was removed inside the string 3062 quoted with double quotes (`"..."'), but not from the string quoted 3063 with single quotes (`'...''). This is the way the default shell 3064 (`/bin/sh') handles backslash/newline pairs. If you specify a 3065 different shell in your makefiles it may treat them differently. 3066 3067 Sometimes you want to split a long line inside of single quotes, but 3068 you don't want the backslash-newline to appear in the quoted content. 3069 This is often the case when passing scripts to languages such as Perl, 3070 where extraneous backslashes inside the script can change its meaning 3071 or even be a syntax error. One simple way of handling this is to place 3072 the quoted string, or even the entire command, into a `make' variable 3073 then use the variable in the command. In this situation the newline 3074 quoting rules for makefiles will be used, and the backslash-newline 3075 will be removed. If we rewrite our example above using this method: 3076 3077 HELLO = 'hello \ 3078 world' 3079 3080 all : ; @echo $(HELLO) 3081 3082 we will get output like this: 3083 3084 hello world 3085 3086 If you like, you can also use target-specific variables (*note 3087 Target-specific Variable Values: Target-specific.) to obtain a tighter 3088 correspondence between the variable and the command that uses it. 3089 3090 3091 File: make.info, Node: Variables in Commands, Prev: Splitting Lines, Up: Command Syntax 3092 3093 5.1.2 Using Variables in Commands 3094 --------------------------------- 3095 3096 The other way in which `make' processes commands is by expanding any 3097 variable references in them (*note Basics of Variable References: 3098 Reference.). This occurs after make has finished reading all the 3099 makefiles and the target is determined to be out of date; so, the 3100 commands for targets which are not rebuilt are never expanded. 3101 3102 Variable and function references in commands have identical syntax 3103 and semantics to references elsewhere in the makefile. They also have 3104 the same quoting rules: if you want a dollar sign to appear in your 3105 command, you must double it (`$$'). For shells like the default shell, 3106 that use dollar signs to introduce variables, it's important to keep 3107 clear in your mind whether the variable you want to reference is a 3108 `make' variable (use a single dollar sign) or a shell variable (use two 3109 dollar signs). For example: 3110 3111 LIST = one two three 3112 all: 3113 for i in $(LIST); do \ 3114 echo $$i; \ 3115 done 3116 3117 results in the following command being passed to the shell: 3118 3119 for i in one two three; do \ 3120 echo $i; \ 3121 done 3122 3123 which generates the expected result: 3124 3125 one 3126 two 3127 three 3128 3129 3130 File: make.info, Node: Echoing, Next: Execution, Prev: Command Syntax, Up: Commands 3131 3132 5.2 Command Echoing 3133 =================== 2657 3134 2658 3135 Normally `make' prints each command line before it is executed. We … … 2683 3160 File: make.info, Node: Execution, Next: Parallel, Prev: Echoing, Up: Commands 2684 3161 2685 Command Execution2686 ================= 3162 5.3 Command Execution 3163 ===================== 2687 3164 2688 3165 When it is time to execute commands to update a target, they are 2689 executed by making a new subshell for each line. (In practice, `make' 2690 may take shortcuts that do not affect the results.) 2691 2692 *Please note:* this implies that shell commands such as `cd' that 2693 set variables local to each process will not affect the following 2694 command lines. (1) If you want to use `cd' to affect the next command, 2695 put the two on a single line with a semicolon between them. Then 2696 `make' will consider them a single command and pass them, together, to 2697 a shell which will execute them in sequence. For example: 3166 executed by invoking a new subshell for each command line. (In 3167 practice, `make' may take shortcuts that do not affect the results.) 3168 3169 *Please note:* this implies that setting shell variables and 3170 invoking shell commands such as `cd' that set a context local to each 3171 process will not affect the following command lines.(1) If you want to 3172 use `cd' to affect the next statement, put both statements in a single 3173 command line. Then `make' will invoke one shell to run the entire 3174 line, and the shell will execute the statements in sequence. For 3175 example: 2698 3176 2699 3177 foo : bar/lose 2700 cd bar; gobble lose > ../foo 2701 2702 If you would like to split a single shell command into multiple 2703 lines of text, you must use a backslash at the end of all but the last 2704 subline. Such a sequence of lines is combined into a single line, by 2705 deleting the backslash-newline sequences, before passing it to the 2706 shell. Thus, the following is equivalent to the preceding example: 2707 2708 foo : bar/lose 2709 cd bar; \ 2710 gobble lose > ../foo 2711 2712 The program used as the shell is taken from the variable `SHELL'. 2713 By default, the program `/bin/sh' is used. 3178 cd $(@D) && gobble $(@F) > ../$@ 3179 3180 Here we use the shell AND operator (`&&') so that if the `cd' command 3181 fails, the script will fail without trying to invoke the `gobble' 3182 command in the wrong directory, which could cause problems (in this 3183 case it would certainly cause `../foo' to be truncated, at least). 3184 3185 * Menu: 3186 3187 * Choosing the Shell:: How `make' chooses the shell used 3188 to run commands. 3189 3190 ---------- Footnotes ---------- 3191 3192 (1) On MS-DOS, the value of current working directory is *global*, so 3193 changing it _will_ affect the following command lines on those systems. 3194 3195 3196 File: make.info, Node: Choosing the Shell, Prev: Execution, Up: Execution 3197 3198 5.3.1 Choosing the Shell 3199 ------------------------ 3200 3201 The program used as the shell is taken from the variable `SHELL'. If 3202 this variable is not set in your makefile, the program `/bin/sh' is 3203 used as the shell. 3204 3205 Unlike most variables, the variable `SHELL' is never set from the 3206 environment. This is because the `SHELL' environment variable is used 3207 to specify your personal choice of shell program for interactive use. 3208 It would be very bad for personal choices like this to affect the 3209 functioning of makefiles. *Note Variables from the Environment: 3210 Environment. 3211 3212 Furthermore, when you do set `SHELL' in your makefile that value is 3213 _not_ exported in the environment to commands that `make' invokes. 3214 Instead, the value inherited from the user's environment, if any, is 3215 exported. You can override this behavior by explicitly exporting 3216 `SHELL' (*note Communicating Variables to a Sub-`make': 3217 Variables/Recursion.), forcing it to be passed in the environment to 3218 commands. 3219 3220 However, on MS-DOS and MS-Windows the value of `SHELL' in the 3221 environment *is* used, since on those systems most users do not set 3222 this variable, and therefore it is most likely set specifically to be 3223 used by `make'. On MS-DOS, if the setting of `SHELL' is not suitable 3224 for `make', you can set the variable `MAKESHELL' to the shell that 3225 `make' should use; if set it will be used as the shell instead of the 3226 value of `SHELL'. 3227 3228 Choosing a Shell in DOS and Windows 3229 ................................... 3230 3231 Choosing a shell in MS-DOS and MS-Windows is much more complex than on 3232 other systems. 2714 3233 2715 3234 On MS-DOS, if `SHELL' is not set, the value of the variable … … 2757 3276 2758 3277 The effect of the above DOS-specific processing is that a Makefile 2759 that says `SHELL = /bin/sh' (as many Unix makefiles do), will work on 2760 MS-DOS unaltered if you have e.g. `sh.exe' installed in some directory 2761 along your `PATH'. 2762 2763 Unlike most variables, the variable `SHELL' is never set from the 2764 environment. This is because the `SHELL' environment variable is used 2765 to specify your personal choice of shell program for interactive use. 2766 It would be very bad for personal choices like this to affect the 2767 functioning of makefiles. *Note Variables from the Environment: 2768 Environment. However, on MS-DOS and MS-Windows the value of `SHELL' in 2769 the environment *is* used, since on those systems most users do not set 2770 this variable, and therefore it is most likely set specifically to be 2771 used by `make'. On MS-DOS, if the setting of `SHELL' is not suitable 2772 for `make', you can set the variable `MAKESHELL' to the shell that 2773 `make' should use; this will override the value of `SHELL'. 2774 2775 ---------- Footnotes ---------- 2776 2777 (1) On MS-DOS, the value of current working directory is *global*, 2778 so changing it _will_ affect the following command lines on those 2779 systems. 3278 that contains `SHELL = /bin/sh' (as many Unix makefiles do), will work 3279 on MS-DOS unaltered if you have e.g. `sh.exe' installed in some 3280 directory along your `PATH'. 2780 3281 2781 3282 2782 3283 File: make.info, Node: Parallel, Next: Errors, Prev: Execution, Up: Commands 2783 3284 2784 Parallel Execution2785 ================== 3285 5.4 Parallel Execution 3286 ====================== 2786 3287 2787 3288 GNU `make' knows how to execute several commands at once. Normally, … … 2809 3310 streams of all but one running command. This means that attempting to 2810 3311 read from standard input will usually be a fatal error (a `Broken pipe' 2811 signal) for most child processes if there are several. 3312 signal) for most child processes if there are several. 2812 3313 2813 3314 It is unpredictable which command will have a valid standard input … … 2858 3359 File: make.info, Node: Errors, Next: Interrupts, Prev: Parallel, Up: Commands 2859 3360 2860 Errors in Commands2861 ================== 3361 5.5 Errors in Commands 3362 ====================== 2862 3363 2863 3364 After each shell command returns, `make' looks at its exit status. If … … 2917 3418 program as possible, perhaps to find several independent problems so 2918 3419 that you can correct them all before the next attempt to compile. This 2919 is why Emacs' `compile' command passes the `-k' flag by default. 3420 is why Emacs' `compile' command passes the `-k' flag by default. 2920 3421 2921 3422 Usually when a command fails, if it has changed the target file at … … 2934 3435 File: make.info, Node: Interrupts, Next: Recursion, Prev: Errors, Up: Commands 2935 3436 2936 Interrupting or Killing `make'2937 ============================== 3437 5.6 Interrupting or Killing `make' 3438 ================================== 2938 3439 2939 3440 If `make' gets a fatal signal while a command is executing, it may … … 2965 3466 File: make.info, Node: Recursion, Next: Sequences, Prev: Interrupts, Up: Commands 2966 3467 2967 Recursive Use of `make'2968 ======================= 3468 5.7 Recursive Use of `make' 3469 =========================== 2969 3470 2970 3471 Recursive use of `make' means using `make' as a command in a makefile. … … 2982 3483 subsystem: 2983 3484 $(MAKE) -C subdir 2984 3485 2985 3486 You can write recursive `make' commands just by copying this example, 2986 3487 but there are many things to know about how they work and why, and about … … 3012 3513 File: make.info, Node: MAKE Variable, Next: Variables/Recursion, Prev: Recursion, Up: Recursion 3013 3514 3014 How the `MAKE' Variable Works3015 ----------------------------- 3515 5.7.1 How the `MAKE' Variable Works 3516 ----------------------------------- 3016 3517 3017 3518 Recursive `make' commands should always use the variable `MAKE', not … … 3025 3526 is `cd subdir && /bin/make'. If you use a special version of `make' to 3026 3527 run the top-level makefile, the same special version will be executed 3027 for recursive invocations. 3528 for recursive invocations. 3028 3529 3029 3530 As a special feature, using the variable `MAKE' in the commands of a … … 3043 3544 file named `subsystem' and do nothing else. What you really want it to 3044 3545 do is run `cd subdir && make -t'; but that would require executing the 3045 command, and `-t' says not to execute commands. 3546 command, and `-t' says not to execute commands. 3046 3547 3047 3548 The special feature makes this do what you want: whenever a command … … 3057 3558 File: make.info, Node: Variables/Recursion, Next: Options/Recursion, Prev: MAKE Variable, Up: Recursion 3058 3559 3059 Communicating Variables to a Sub-`make'3060 --------------------------------------- 3560 5.7.2 Communicating Variables to a Sub-`make' 3561 --------------------------------------------- 3061 3562 3062 3563 Variable values of the top-level `make' can be passed to the sub-`make' … … 3077 3578 characters other than letters, numbers, and underscores. 3078 3579 3079 The special variables `SHELL' and `MAKEFLAGS' are always exported 3080 (unless you unexport them). `MAKEFILES' is exported if you set it to 3081 anything. 3580 The value of the `make' variable `SHELL' is not exported. Instead, 3581 the value of the `SHELL' variable from the invoking environment is 3582 passed to the sub-`make'. You can force `make' to export its value for 3583 `SHELL' by using the `export' directive, described below. *Note 3584 Choosing the Shell::. 3585 3586 The special variable `MAKEFLAGS' is always exported (unless you 3587 unexport it). `MAKEFILES' is exported if you set it to anything. 3082 3588 3083 3589 `make' automatically passes down variable values that were defined … … 3154 3660 `.EXPORT_ALL_VARIABLES' instead of using the `export' directive. This 3155 3661 will be ignored by old `make's, while the `export' directive will cause 3156 a syntax error. 3662 a syntax error. 3157 3663 3158 3664 Likewise, you can use `unexport' by itself to tell `make' _not_ to … … 3187 3693 File: make.info, Node: Options/Recursion, Next: -w Option, Prev: Variables/Recursion, Up: Recursion 3188 3694 3189 Communicating Options to a Sub-`make'3190 ------------------------------------- 3695 5.7.3 Communicating Options to a Sub-`make' 3696 ------------------------------------------- 3191 3697 3192 3698 Flags such as `-s' and `-k' are passed automatically to the sub-`make' … … 3292 3798 File: make.info, Node: -w Option, Prev: Options/Recursion, Up: Recursion 3293 3799 3294 The `--print-directory' Option3295 ------------------------------ 3800 5.7.4 The `--print-directory' Option 3801 ------------------------------------ 3296 3802 3297 3803 If you use several levels of recursive `make' invocations, the `-w' or … … 3318 3824 File: make.info, Node: Sequences, Next: Empty Commands, Prev: Recursion, Up: Commands 3319 3825 3320 Defining Canned Command Sequences3321 ================================= 3826 5.8 Defining Canned Command Sequences 3827 ===================================== 3322 3828 3323 3829 When the same sequence of commands is useful in making various targets, … … 3333 3839 mv y.tab.c $@ 3334 3840 endef 3335 3841 3336 3842 Here `run-yacc' is the name of the variable being defined; `endef' 3337 3843 marks the end of the definition; the lines in between are the commands. … … 3393 3899 File: make.info, Node: Empty Commands, Prev: Sequences, Up: Commands 3394 3900 3395 Using Empty Commands3396 ==================== 3901 5.9 Using Empty Commands 3902 ======================== 3397 3903 3398 3904 It is sometimes useful to define commands which do nothing. This is … … 3422 3928 File: make.info, Node: Using Variables, Next: Conditionals, Prev: Commands, Up: Top 3423 3929 3424 How to Use Variables3425 ******************** 3930 6 How to Use Variables 3931 ********************** 3426 3932 3427 3933 A "variable" is a name defined in a makefile to represent a string of … … 3429 3935 explicit request into targets, prerequisites, commands, and other parts 3430 3936 of the makefile. (In some other versions of `make', variables are 3431 called "macros".) 3937 called "macros".) 3432 3938 3433 3939 Variables and functions in all parts of a makefile are expanded when … … 3484 3990 File: make.info, Node: Reference, Next: Flavors, Prev: Using Variables, Up: Using Variables 3485 3991 3486 Basics of Variable References3487 ============================= 3992 6.1 Basics of Variable References 3993 ================================= 3488 3994 3489 3995 To substitute a variable's value, write a dollar sign followed by the … … 3501 4007 program : $(objects) 3502 4008 cc -o program $(objects) 3503 4009 3504 4010 $(objects) : defs.h 3505 4011 … … 3524 4030 File: make.info, Node: Flavors, Next: Advanced, Prev: Reference, Up: Using Variables 3525 4031 3526 The Two Flavors of Variables3527 ============================ 4032 6.2 The Two Flavors of Variables 4033 ================================ 3528 4034 3529 4035 There are two ways that a variable in GNU `make' can have a value; we … … 3545 4051 bar = $(ugh) 3546 4052 ugh = Huh? 3547 4053 3548 4054 all:;echo $(foo) 3549 4055 … … 3565 4071 3566 4072 because it will cause an infinite loop in the variable expansion. 3567 (Actually `make' detects the infinite loop and reports an error.) 4073 (Actually `make' detects the infinite loop and reports an error.) 3568 4074 3569 4075 Another disadvantage is that any functions (*note Functions for … … 3606 4112 3607 4113 ifeq (0,${MAKELEVEL}) 3608 cur-dir := $(shell pwd)3609 4114 whoami := $(shell whoami) 3610 4115 host-type := $(shell arch) … … 3616 4121 3617 4122 ${subdirs}: 3618 ${MAKE} cur-dir=${cur-dir}/$@-C $@ all4123 ${MAKE} -C $@ all 3619 4124 3620 4125 Simply expanded variables generally make complicated makefile … … 3670 4175 File: make.info, Node: Advanced, Next: Values, Prev: Flavors, Up: Using Variables 3671 4176 3672 Advanced Features for Reference to Variables3673 ============================================ 4177 6.3 Advanced Features for Reference to Variables 4178 ================================================ 3674 4179 3675 4180 This section describes some advanced features you can use to reference … … 3685 4190 File: make.info, Node: Substitution Refs, Next: Computed Names, Prev: Advanced, Up: Advanced 3686 4191 3687 Substitution References3688 ----------------------- 4192 6.3.1 Substitution References 4193 ----------------------------- 3689 4194 3690 4195 A "substitution reference" substitutes the value of a variable with … … 3718 4223 3719 4224 For example: 3720 4225 3721 4226 foo := a.o b.o c.o 3722 4227 bar := $(foo:%.o=%.c) … … 3727 4232 File: make.info, Node: Computed Names, Prev: Substitution Refs, Up: Advanced 3728 4233 3729 Computed Variable Names3730 ----------------------- 4234 6.3.2 Computed Variable Names 4235 ----------------------------- 3731 4236 3732 4237 Computed variable names are a complicated concept needed only for … … 3799 4304 a_dirs := dira dirb 3800 4305 1_dirs := dir1 dir2 3801 4306 3802 4307 a_files := filea fileb 3803 4308 1_files := file1 file2 3804 4309 3805 4310 ifeq "$(use_a)" "yes" 3806 4311 a1 := a … … 3808 4313 a1 := 1 3809 4314 endif 3810 4315 3811 4316 ifeq "$(use_dirs)" "yes" 3812 4317 df := dirs … … 3814 4319 df := files 3815 4320 endif 3816 4321 3817 4322 dirs := $($(a1)_$(df)) 3818 4323 … … 3824 4329 a_objects := a.o b.o c.o 3825 4330 1_objects := 1.o 2.o 3.o 3826 4331 3827 4332 sources := $($(a1)_objects:.o=.c) 3828 4333 … … 3840 4345 func := strip 3841 4346 endif 3842 4347 3843 4348 bar := a d b g q c 3844 4349 3845 4350 foo := $($(func) $(bar)) 3846 4351 … … 3870 4375 File: make.info, Node: Values, Next: Setting, Prev: Advanced, Up: Using Variables 3871 4376 3872 How Variables Get Their Values3873 ============================== 4377 6.4 How Variables Get Their Values 4378 ================================== 3874 4379 3875 4380 Variables can get values in several different ways: … … 3895 4400 File: make.info, Node: Setting, Next: Appending, Prev: Values, Up: Using Variables 3896 4401 3897 Setting Variables3898 ================= 4402 6.5 Setting Variables 4403 ===================== 3899 4404 3900 4405 To set a variable from the makefile, write a line starting with the … … 3948 4453 File: make.info, Node: Appending, Next: Override Directive, Prev: Setting, Up: Using Variables 3949 4454 3950 Appending More Text to Variables3951 ================================ 4455 6.6 Appending More Text to Variables 4456 ==================================== 3952 4457 3953 4458 Often it is useful to add more text to the value of a variable already … … 3984 4489 it a simply-expanded variable, `+=' adds to that simply-expanded 3985 4490 definition, and expands the new text before appending it to the old 3986 value just as `:=' does ( *note Setting Variables: Setting., for a full3987 explanation of `:='). In fact,4491 value just as `:=' does (see *Note Setting Variables: Setting, for a 4492 full explanation of `:='). In fact, 3988 4493 3989 4494 variable := value … … 3991 4496 3992 4497 is exactly equivalent to: 4498 3993 4499 3994 4500 variable := value … … 4023 4529 The first line defines the `CFLAGS' variable with a reference to another 4024 4530 variable, `includes'. (`CFLAGS' is used by the rules for C 4025 compilation; *note Catalogue of Implicit Rules: Catalogue of Rules. .)4531 compilation; *note Catalogue of Implicit Rules: Catalogue of Rules.) 4026 4532 Using `=' for the definition makes `CFLAGS' a recursively-expanded 4027 4533 variable, meaning `$(includes) -O' is _not_ expanded when `make' … … 4045 4551 File: make.info, Node: Override Directive, Next: Defining, Prev: Appending, Up: Using Variables 4046 4552 4047 The `override' Directive4048 ======================== 4553 6.7 The `override' Directive 4554 ============================ 4049 4555 4050 4556 If a variable has been set with a command argument (*note Overriding … … 4089 4595 File: make.info, Node: Defining, Next: Environment, Prev: Override Directive, Up: Using Variables 4090 4596 4091 Defining Variables Verbatim4092 =========================== 4597 6.8 Defining Variables Verbatim 4598 =============================== 4093 4599 4094 4600 Another way to set the value of a variable is to use the `define' … … 4148 4654 File: make.info, Node: Environment, Next: Target-specific, Prev: Defining, Up: Using Variables 4149 4655 4150 Variables from the Environment4151 ============================== 4656 6.9 Variables from the Environment 4657 ================================== 4152 4658 4153 4659 Variables in `make' can come from the environment in which `make' is 4154 4660 run. Every environment variable that `make' sees when it starts up is 4155 transformed into a `make' variable with the same name and value. But4156 an explicit assignment in the makefile, or with a command argument, 4157 overrides the environment. (If the `-e' flag is specified, then values 4158 from the environment override assignments in the makefile. *Note 4159 Summary of Options: Options Summary. But this is not recommended4661 transformed into a `make' variable with the same name and value. 4662 However, an explicit assignment in the makefile, or with a command 4663 argument, overrides the environment. (If the `-e' flag is specified, 4664 then values from the environment override assignments in the makefile. 4665 *Note Summary of Options: Options Summary. But this is not recommended 4160 4666 practice.) 4161 4667 … … 4164 4670 you prefer. This is safe for variables with standard or conventional 4165 4671 meanings because you know that no makefile will use them for other 4166 things. ( But this is not totally reliable; some makefiles set `CFLAGS'4167 explicitly and therefore are not affected by the value in the4672 things. (Note this is not totally reliable; some makefiles set 4673 `CFLAGS' explicitly and therefore are not affected by the value in the 4168 4674 environment.) 4169 4675 4170 When `make' is invoked recursively, variables defined in the outer4171 invocation can be passed to inner invocations through the environment 4172 (*note Recursive Use of `make': Recursion.). By default, only 4173 variables that came from the environment or the command line are passed 4174 to recursive invocations. You can use the `export' directive to pass 4175 other variables. *Note Communicating Variables to a Sub-`make': 4176 Variables /Recursion, for full details.4676 When `make' runs a command script, variables defined in the makefile 4677 are placed into the environment of that command. This allows you to 4678 pass values to sub-`make' invocations (*note Recursive Use of `make': 4679 Recursion.). By default, only variables that came from the environment 4680 or the command line are passed to recursive invocations. You can use 4681 the `export' directive to pass other variables. *Note Communicating 4682 Variables to a Sub-`make': Variables/Recursion, for full details. 4177 4683 4178 4684 Other use of variables from the environment is not recommended. It … … 4185 4691 which is normally present in the environment to specify the user's 4186 4692 choice of interactive shell. It would be very undesirable for this 4187 choice to affect `make'. So `make' ignores the environment value of 4188 `SHELL' (except on MS-DOS and MS-Windows, where `SHELL' is usually not 4189 set. *Note Special handling of SHELL on MS-DOS: Execution.) 4693 choice to affect `make'; so, `make' handles the `SHELL' environment 4694 variable in a special way; see *Note Choosing the Shell::. 4190 4695 4191 4696 4192 4697 File: make.info, Node: Target-specific, Next: Pattern-specific, Prev: Environment, Up: Using Variables 4193 4698 4194 Target-specific Variable Values4195 =============================== 4699 6.10 Target-specific Variable Values 4700 ==================================== 4196 4701 4197 4702 Variable values in `make' are usually global; that is, they are the … … 4262 4767 File: make.info, Node: Pattern-specific, Prev: Target-specific, Up: Using Variables 4263 4768 4264 Pattern-specific Variable Values4265 ================================ 4769 6.11 Pattern-specific Variable Values 4770 ===================================== 4266 4771 4267 4772 In addition to target-specific variable values (*note Target-specific … … 4300 4805 File: make.info, Node: Conditionals, Next: Functions, Prev: Using Variables, Up: Top 4301 4806 4302 Conditional Parts of Makefiles4303 ****************************** 4807 7 Conditional Parts of Makefiles 4808 ******************************** 4304 4809 4305 4810 A "conditional" causes part of a makefile to be obeyed or ignored … … 4319 4824 File: make.info, Node: Conditional Example, Next: Conditional Syntax, Prev: Conditionals, Up: Conditionals 4320 4825 4321 Example of a Conditional4322 ======================== 4826 7.1 Example of a Conditional 4827 ============================ 4323 4828 4324 4829 The following example of a conditional tells `make' to use one set of … … 4331 4836 libs_for_gcc = -lgnu 4332 4837 normal_libs = 4333 4838 4334 4839 foo: $(objects) 4335 4840 ifeq ($(CC),gcc) … … 4381 4886 libs_for_gcc = -lgnu 4382 4887 normal_libs = 4383 4888 4384 4889 ifeq ($(CC),gcc) 4385 4890 libs=$(libs_for_gcc) … … 4387 4892 libs=$(normal_libs) 4388 4893 endif 4389 4894 4390 4895 foo: $(objects) 4391 4896 $(CC) -o foo $(objects) $(libs) … … 4394 4899 File: make.info, Node: Conditional Syntax, Next: Testing Flags, Prev: Conditional Example, Up: Conditionals 4395 4900 4396 Syntax of Conditionals4397 ====================== 4901 7.2 Syntax of Conditionals 4902 ========================== 4398 4903 4399 4904 The syntax of a simple conditional with no `else' is as follows: … … 4415 4920 endif 4416 4921 4417 If the condition is true, TEXT-IF-TRUE is used; otherwise, 4418 TEXT-IF-FALSE is used instead. The TEXT-IF-FALSE can be any number of 4419 lines of text. 4922 or: 4923 4924 CONDITIONAL-DIRECTIVE 4925 TEXT-IF-ONE-IS-TRUE 4926 else CONDITIONAL-DIRECTIVE 4927 TEXT-IF-TRUE 4928 else 4929 TEXT-IF-FALSE 4930 endif 4931 4932 There can be as many "`else' CONDITIONAL-DIRECTIVE" clauses as 4933 necessary. Once a given condition is true, TEXT-IF-TRUE is used and no 4934 other clause is used; if no condition is true then TEXT-IF-FALSE is 4935 used. The TEXT-IF-TRUE and TEXT-IF-FALSE can be any number of lines of 4936 text. 4420 4937 4421 4938 The syntax of the CONDITIONAL-DIRECTIVE is the same whether the 4422 conditional is simple or complex. There are four different directives 4423 that test different conditions. Here is a table of them: 4939 conditional is simple or complex; after an `else' or not. There are 4940 four different directives that test different conditions. Here is a 4941 table of them: 4424 4942 4425 4943 `ifeq (ARG1, ARG2)' … … 4457 4975 4458 4976 `ifdef VARIABLE-NAME' 4459 If the variable VARIABLE-NAME has a non-empty value, the 4460 TEXT-IF-TRUE is effective; otherwise, the TEXT-IF-FALSE, if any, 4461 is effective. Variables that have never been defined have an 4462 empty value. The variable VARIABLE-NAME is itself expanded, so it 4463 could be a variable or function that expands to the name of a 4464 variable. 4977 The `ifdef' form takes the _name_ of a variable as its argument, 4978 not a reference to a variable. The value of that variable has a 4979 non-empty value, the TEXT-IF-TRUE is effective; otherwise, the 4980 TEXT-IF-FALSE, if any, is effective. Variables that have never 4981 been defined have an empty value. The text VARIABLE-NAME is 4982 expanded, so it could be a variable or function that expands to 4983 the name of a variable. For example: 4984 4985 bar = true 4986 foo = bar 4987 ifdef $(foo) 4988 frobozz = yes 4989 endif 4990 4991 The variable reference `$(foo)' is expanded, yielding `bar', which 4992 is considered to be the name of a variable. The variable `bar' is 4993 not expanded, but its value is examined to determine if it is 4994 non-empty. 4465 4995 4466 4996 Note that `ifdef' only tests whether a variable has a value. It … … 4492 5022 If the variable VARIABLE-NAME has an empty value, the TEXT-IF-TRUE 4493 5023 is effective; otherwise, the TEXT-IF-FALSE, if any, is effective. 5024 The rules for expansion and testing of VARIABLE-NAME are identical 5025 to the `ifdef' directive. 4494 5026 4495 5027 Extra spaces are allowed and ignored at the beginning of the … … 4526 5058 File: make.info, Node: Testing Flags, Prev: Conditional Syntax, Up: Conditionals 4527 5059 4528 Conditionals that Test Flags4529 ============================ 5060 7.3 Conditionals that Test Flags 5061 ================================ 4530 5062 4531 5063 You can write a conditional that tests `make' command flags such as … … 4557 5089 File: make.info, Node: Functions, Next: Running, Prev: Conditionals, Up: Top 4558 5090 4559 Functions for Transforming Text4560 ******************************* 5091 8 Functions for Transforming Text 5092 ********************************* 4561 5093 4562 5094 "Functions" allow you to do text processing in the makefile to compute … … 4572 5104 * Text Functions:: General-purpose text manipulation functions. 4573 5105 * File Name Functions:: Functions for manipulating file names. 5106 * Conditional Functions:: Functions that implement conditions. 4574 5107 * Foreach Function:: Repeat some text with controlled variation. 4575 * If Function:: Conditionally expand a value.4576 5108 * Call Function:: Expand a user-defined function. 4577 5109 * Value Function:: Return the un-expanded value of a variable. 4578 5110 * Eval Function:: Evaluate the arguments as makefile syntax. 4579 5111 * Origin Function:: Find where a variable got its value. 5112 * Flavor Function:: Find out the flavor of a variable. 4580 5113 * Shell Function:: Substitute the output of a shell command. 4581 5114 * Make Control Functions:: Functions that control how make runs. … … 4584 5117 File: make.info, Node: Syntax of Functions, Next: Text Functions, Prev: Functions, Up: Functions 4585 5118 4586 Function Call Syntax4587 ==================== 5119 8.1 Function Call Syntax 5120 ======================== 4588 5121 4589 5122 A function call resembles a variable reference. It looks like this: … … 4638 5171 File: make.info, Node: Text Functions, Next: File Name Functions, Prev: Syntax of Functions, Up: Functions 4639 5172 4640 Functions for String Substitution and Analysis4641 ============================================== 5173 8.2 Functions for String Substitution and Analysis 5174 ================================================== 4642 5175 4643 5176 Here are some functions that operate on strings: … … 4804 5337 `$(wordlist S,E,TEXT)' 4805 5338 Returns the list of words in TEXT starting with word S and ending 4806 with word E (inclusive). The legitimate values of S and E start4807 from 1. If S is bigger than the number of words in TEXT, the4808 value is empty. If E is bigger than the number of words in TEXT,4809 words up to the end of TEXT are returned. If S is greater than E,4810 nothing is returned. For example,5339 with word E (inclusive). The legitimate values of S start from 1; 5340 E may start from 0. If S is bigger than the number of words in 5341 TEXT, the value is empty. If E is bigger than the number of words 5342 in TEXT, words up to the end of TEXT are returned. If S is 5343 greater than E, nothing is returned. For example, 4811 5344 4812 5345 $(wordlist 2, 3, foo bar baz) … … 4830 5363 same as `$(word 1,TEXT)', the `firstword' function is retained for 4831 5364 its simplicity. 5365 5366 `$(lastword NAMES...)' 5367 The argument NAMES is regarded as a series of names, separated by 5368 whitespace. The value is the last name in the series. 5369 5370 For example, 5371 5372 $(lastword foo bar) 5373 5374 produces the result `bar'. Although `$(lastword TEXT)' is the 5375 same as `$(word $(words TEXT),TEXT)', the `lastword' function was 5376 added for its simplicity and better performance. 4832 5377 4833 5378 Here is a realistic example of the use of `subst' and `patsubst'. … … 4858 5403 4859 5404 4860 File: make.info, Node: File Name Functions, Next: Foreach Function, Prev: Text Functions, Up: Functions4861 4862 Functions for File Names4863 ======================== 5405 File: make.info, Node: File Name Functions, Next: Conditional Functions, Prev: Text Functions, Up: Functions 5406 5407 8.3 Functions for File Names 5408 ============================ 4864 5409 4865 5410 Several of the built-in expansion functions relate specifically to … … 4970 5515 File Names: Wildcards. 4971 5516 4972 4973 File: make.info, Node: Foreach Function, Next: If Function, Prev: File Name Functions, Up: Functions 4974 4975 The `foreach' Function 4976 ====================== 5517 `$(realpath NAMES...)' 5518 For each file name in NAMES return the canonical absolute name. A 5519 canonical name does not contain any `.' or `..' components, nor 5520 any repeated path separators (`/') or symlinks. In case of a 5521 failure the empty string is returned. Consult the `realpath(3)' 5522 documentation for a list of possible failure causes. 5523 5524 `$(abspath NAMES...)' 5525 For each file name in NAMES return an absolute name that does not 5526 contain any `.' or `..' components, nor any repeated path 5527 separators (`/'). Note that, in contrast to `realpath' function, 5528 `abspath' does not resolve symlinks and does not require the file 5529 names to refer to an existing file or directory. Use the 5530 `wildcard' function to test for existence. 5531 5532 5533 File: make.info, Node: Conditional Functions, Next: Foreach Function, Prev: File Name Functions, Up: Functions 5534 5535 8.4 Functions for Conditionals 5536 ============================== 5537 5538 There are three functions that provide conditional expansion. A key 5539 aspect of these functions is that not all of the arguments are expanded 5540 initially. Only those arguments which need to be expanded, will be 5541 expanded. 5542 5543 `$(if CONDITION,THEN-PART[,ELSE-PART])' 5544 The `if' function provides support for conditional expansion in a 5545 functional context (as opposed to the GNU `make' makefile 5546 conditionals such as `ifeq' (*note Syntax of Conditionals: 5547 Conditional Syntax.). 5548 5549 The first argument, CONDITION, first has all preceding and 5550 trailing whitespace stripped, then is expanded. If it expands to 5551 any non-empty string, then the condition is considered to be true. 5552 If it expands to an empty string, the condition is considered to 5553 be false. 5554 5555 If the condition is true then the second argument, THEN-PART, is 5556 evaluated and this is used as the result of the evaluation of the 5557 entire `if' function. 5558 5559 If the condition is false then the third argument, ELSE-PART, is 5560 evaluated and this is the result of the `if' function. If there is 5561 no third argument, the `if' function evaluates to nothing (the 5562 empty string). 5563 5564 Note that only one of the THEN-PART or the ELSE-PART will be 5565 evaluated, never both. Thus, either can contain side-effects 5566 (such as `shell' function calls, etc.) 5567 5568 `$(or CONDITION1[,CONDITION2[,CONDITION3...]])' 5569 The `or' function provides a "short-circuiting" OR operation. 5570 Each argument is expanded, in order. If an argument expands to a 5571 non-empty string the processing stops and the result of the 5572 expansion is that string. If, after all arguments are expanded, 5573 all of them are false (empty), then the result of the expansion is 5574 the empty string. 5575 5576 `$(and CONDITION1[,CONDITION2[,CONDITION3...]])' 5577 The `and' function provides a "short-circuiting" AND operation. 5578 Each argument is expanded, in order. If an argument expands to an 5579 empty string the processing stops and the result of the expansion 5580 is the empty string. If all arguments expand to a non-empty 5581 string then the result of the expansion is the expansion of the 5582 last argument. 5583 5584 5585 5586 File: make.info, Node: Foreach Function, Next: Call Function, Prev: Conditional Functions, Up: Functions 5587 5588 8.5 The `foreach' Function 5589 ========================== 4977 5590 4978 5591 The `foreach' function is very different from other functions. It … … 5046 5659 5047 5660 5048 File: make.info, Node: If Function, Next: Call Function, Prev: Foreach Function, Up: Functions 5049 5050 The `if' Function 5051 ================= 5052 5053 The `if' function provides support for conditional expansion in a 5054 functional context (as opposed to the GNU `make' makefile conditionals 5055 such as `ifeq' (*note Syntax of Conditionals: Conditional Syntax.). 5056 5057 An `if' function call can contain either two or three arguments: 5058 5059 $(if CONDITION,THEN-PART[,ELSE-PART]) 5060 5061 The first argument, CONDITION, first has all preceding and trailing 5062 whitespace stripped, then is expanded. If it expands to any non-empty 5063 string, then the condition is considered to be true. If it expands to 5064 an empty string, the condition is considered to be false. 5065 5066 If the condition is true then the second argument, THEN-PART, is 5067 evaluated and this is used as the result of the evaluation of the entire 5068 `if' function. 5069 5070 If the condition is false then the third argument, ELSE-PART, is 5071 evaluated and this is the result of the `if' function. If there is no 5072 third argument, the `if' function evaluates to nothing (the empty 5073 string). 5074 5075 Note that only one of the THEN-PART or the ELSE-PART will be 5076 evaluated, never both. Thus, either can contain side-effects (such as 5077 `shell' function calls, etc.) 5078 5079 5080 File: make.info, Node: Call Function, Next: Value Function, Prev: If Function, Up: Functions 5081 5082 The `call' Function 5083 =================== 5661 File: make.info, Node: Call Function, Next: Value Function, Prev: Foreach Function, Up: Functions 5662 5663 8.6 The `call' Function 5664 ======================= 5084 5665 5085 5666 The `call' function is unique in that it can be used to create new … … 5120 5701 5121 5702 reverse = $(2) $(1) 5122 5703 5123 5704 foo = $(call reverse,a,b) 5124 5705 … … 5129 5710 5130 5711 pathsearch = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,$(PATH))))) 5131 5712 5132 5713 LS := $(call pathsearch,ls) 5133 5714 … … 5157 5738 File: make.info, Node: Value Function, Next: Eval Function, Prev: Call Function, Up: Functions 5158 5739 5159 The `value' Function5160 ==================== 5740 8.7 The `value' Function 5741 ======================== 5161 5742 5162 5743 The `value' function provides a way for you to use the value of a … … 5181 5762 5182 5763 FOO = $PATH 5183 5764 5184 5765 all: 5185 5766 @echo $(FOO) … … 5197 5778 File: make.info, Node: Eval Function, Next: Origin Function, Prev: Value Function, Up: Functions 5198 5779 5199 The `eval' Function5200 =================== 5780 8.8 The `eval' Function 5781 ======================= 5201 5782 5202 5783 The `eval' function is very special: it allows you to define new … … 5229 5810 5230 5811 PROGRAMS = server client 5231 5812 5232 5813 server_OBJS = server.o server_priv.o server_access.o 5233 5814 server_LIBS = priv protocol 5234 5815 5235 5816 client_OBJS = client.o client_api.o client_mem.o 5236 5817 client_LIBS = protocol 5237 5818 5238 5819 # Everything after this is generic 5239 5820 5240 5821 .PHONY: all 5241 5822 all: $(PROGRAMS) 5242 5823 5243 5824 define PROGRAM_template 5244 5825 $(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%) 5245 5826 ALL_OBJS += $$($(1)_OBJS) 5246 5827 endef 5247 5828 5248 5829 $(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog)))) 5249 5830 5250 5831 $(PROGRAMS): 5251 5832 $(LINK.o) $^ $(LDLIBS) -o $@ 5252 5833 5253 5834 clean: 5254 5835 rm -f $(ALL_OBJS) $(PROGRAMS) 5255 5836 5256 5837 5257 File: make.info, Node: Origin Function, Next: ShellFunction, Prev: Eval Function, Up: Functions5258 5259 The `origin' Function5260 ===================== 5838 File: make.info, Node: Origin Function, Next: Flavor Function, Prev: Eval Function, Up: Functions 5839 5840 8.9 The `origin' Function 5841 ========================= 5261 5842 5262 5843 The `origin' function is unlike most other functions in that it does … … 5341 5922 5342 5923 5343 File: make.info, Node: Shell Function, Next: Make Control Functions, Prev: Origin Function, Up: Functions 5344 5345 The `shell' Function 5346 ==================== 5924 File: make.info, Node: Flavor Function, Next: Shell Function, Prev: Origin Function, Up: Functions 5925 5926 8.10 The `flavor' Function 5927 ========================== 5928 5929 The `flavor' function is unlike most other functions (and like `origin' 5930 function) in that it does not operate on the values of variables; it 5931 tells you something _about_ a variable. Specifically, it tells you the 5932 flavor of a variable (*note The Two Flavors of Variables: Flavors.). 5933 5934 The syntax of the `flavor' function is: 5935 5936 $(flavor VARIABLE) 5937 5938 Note that VARIABLE is the _name_ of a variable to inquire about; not 5939 a _reference_ to that variable. Therefore you would not normally use a 5940 `$' or parentheses when writing it. (You can, however, use a variable 5941 reference in the name if you want the name not to be a constant.) 5942 5943 The result of this function is a string that identifies the flavor 5944 of the variable VARIABLE: 5945 5946 `undefined' 5947 if VARIABLE was never defined. 5948 5949 `recursive' 5950 if VARIABLE is a recursively expanded variable. 5951 5952 `simple' 5953 if VARIABLE is a simply expanded variable. 5954 5955 5956 5957 File: make.info, Node: Shell Function, Next: Make Control Functions, Prev: Flavor Function, Up: Functions 5958 5959 8.11 The `shell' Function 5960 ========================= 5347 5961 5348 5962 The `shell' function is unlike any other function other than the … … 5375 5989 5376 5990 sets `files' to the expansion of `*.c'. Unless `make' is using a very 5377 strange shell, this has the same result as `$(wildcard *.c)'. 5991 strange shell, this has the same result as `$(wildcard *.c)' (as long 5992 as at least one `.c' file exists). 5378 5993 5379 5994 5380 5995 File: make.info, Node: Make Control Functions, Prev: Shell Function, Up: Functions 5381 5996 5382 Functions That Control Make5383 =========================== 5997 8.12 Functions That Control Make 5998 ================================ 5384 5999 5385 6000 These functions control the way make runs. Generally, they are used to … … 5404 6019 5405 6020 ERR = $(error found an error!) 5406 6021 5407 6022 .PHONY: err 5408 6023 err: ; $(ERR) … … 5419 6034 The result of the expansion of this function is the empty string. 5420 6035 6036 `$(info TEXT...)' 6037 This function does nothing more than print its (expanded) 6038 argument(s) to standard output. No makefile name or line number 6039 is added. The result of the expansion of this function is the 6040 empty string. 6041 5421 6042 5422 6043 File: make.info, Node: Running, Next: Implicit Rules, Prev: Functions, Up: Top 5423 6044 5424 How to Run `make'5425 ***************** 6045 9 How to Run `make' 6046 ******************* 5426 6047 5427 6048 A makefile that says how to recompile a program can be used in more … … 5469 6090 File: make.info, Node: Makefile Arguments, Next: Goals, Prev: Running, Up: Running 5470 6091 5471 Arguments to Specify the Makefile5472 ================================= 6092 9.1 Arguments to Specify the Makefile 6093 ===================================== 5473 6094 5474 6095 The way to specify the name of the makefile is with the `-f' or … … 5487 6108 File: make.info, Node: Goals, Next: Instead of Execution, Prev: Makefile Arguments, Up: Running 5488 6109 5489 Arguments to Specify the Goals5490 ============================== 6110 9.2 Arguments to Specify the Goals 6111 ================================== 5491 6112 5492 6113 The "goals" are the targets that `make' should strive ultimately to … … 5499 6120 program or programs they describe. If the first rule in the makefile 5500 6121 has several targets, only the first target in the rule becomes the 5501 default goal, not the whole list. 5502 5503 You can specify a different goal or goals with arguments to `make'. 5504 Use the name of the goal as an argument. If you specify several goals, 5505 `make' processes each of them in turn, in the order you name them. 6122 default goal, not the whole list. You can manage the selection of the 6123 default goal from within your makefile using the `.DEFAULT_GOAL' 6124 variable (*note Other Special Variables: Special Variables.). 6125 6126 You can also specify a different goal or goals with command-line 6127 arguments to `make'. Use the name of the goal as an argument. If you 6128 specify several goals, `make' processes each of them in turn, in the 6129 order you name them. 5506 6130 5507 6131 Any target in the makefile may be specified as a goal (unless it … … 5521 6145 5522 6146 sources = foo.c bar.c 5523 6147 5524 6148 ifneq ($(MAKECMDGOALS),clean) 5525 6149 include $(sources:.c=.d) … … 5601 6225 File: make.info, Node: Instead of Execution, Next: Avoiding Compilation, Prev: Goals, Up: Running 5602 6226 5603 Instead of Executing the Commands5604 ================================= 6227 9.3 Instead of Executing the Commands 6228 ===================================== 5605 6229 5606 6230 The makefile tells `make' how to tell whether a target is up to date, … … 5680 6304 File: make.info, Node: Avoiding Compilation, Next: Overriding, Prev: Instead of Execution, Up: Running 5681 6305 5682 Avoiding Recompilation of Some Files5683 ==================================== 6306 9.4 Avoiding Recompilation of Some Files 6307 ======================================== 5684 6308 5685 6309 Sometimes you may have changed a source file but you do not want to … … 5723 6347 File: make.info, Node: Overriding, Next: Testing, Prev: Avoiding Compilation, Up: Running 5724 6348 5725 Overriding Variables5726 ==================== 6349 9.5 Overriding Variables 6350 ======================== 5727 6351 5728 6352 An argument that contains `=' specifies the value of a variable: `V=X' … … 5775 6399 File: make.info, Node: Testing, Next: Options Summary, Prev: Overriding, Up: Running 5776 6400 5777 Testing the Compilation of a Program5778 ==================================== 6401 9.6 Testing the Compilation of a Program 6402 ======================================== 5779 6403 5780 6404 Normally, when an error happens in executing a shell command, `make' … … 5811 6435 File: make.info, Node: Options Summary, Prev: Testing, Up: Running 5812 6436 5813 Summary of Options5814 ================== 6437 9.7 Summary of Options 6438 ====================== 5815 6439 5816 6440 Here is a table of all the options `make' understands: … … 5825 6449 Consider all targets out-of-date. GNU `make' proceeds to consider 5826 6450 targets and their prerequisites using the normal algorithms; 5827 however, all these targets are remade, regardless of the status of 5828 their prerequisites. 6451 however, all targets so considered are always remade regardless of 6452 the status of their prerequisites. To avoid infinite recursion, if 6453 `MAKE_RESTARTS' (*note Other Special Variables: Special 6454 Variables.) is set to a number greater than 0 this option is 6455 disabled when considering whether to remake makefiles (*note How 6456 Makefiles Are Remade: Remaking Makefiles.). 5829 6457 5830 6458 `-C DIR' … … 5931 6559 floating-point number). With no argument, removes a previous load 5932 6560 limit. *Note Parallel Execution: Parallel. 6561 6562 `-L' 6563 `--check-symlink-times' 6564 On systems that support symbolic links, this option causes `make' 6565 to consider the timestamps on any symbolic links in addition to the 6566 timestamp on the file referenced by those links. When this option 6567 is provided, the most recent timestamp among the file and the 6568 symbolic links is taken as the modification time for this target 6569 file. 5933 6570 5934 6571 `-n' … … 6053 6690 File: make.info, Node: Implicit Rules, Next: Archives, Prev: Running, Up: Top 6054 6691 6055 Using Implicit Rules6056 ******************** 6692 10 Using Implicit Rules 6693 *********************** 6057 6694 6058 6695 Certain standard ways of remaking target files are used very often. For … … 6091 6728 * Chained Rules:: How to use a chain of implicit rules. 6092 6729 * Pattern Rules:: How to define new implicit rules. 6093 * Last Resort:: How to defin ing commands for rules6094 whichcannot find any.6730 * Last Resort:: How to define commands for rules which 6731 cannot find any. 6095 6732 * Suffix Rules:: The old-fashioned style of implicit rule. 6096 6733 * Implicit Rule Search:: The precise algorithm for applying … … 6100 6737 File: make.info, Node: Using Implicit, Next: Catalogue of Rules, Prev: Implicit Rules, Up: Implicit Rules 6101 6738 6102 Using Implicit Rules6103 ==================== 6739 10.1 Using Implicit Rules 6740 ========================= 6104 6741 6105 6742 To allow `make' to find a customary method for updating a target file, … … 6174 6811 File: make.info, Node: Catalogue of Rules, Next: Implicit Variables, Prev: Using Implicit, Up: Implicit Rules 6175 6812 6176 Catalogue of Implicit Rules6177 =========================== 6813 10.2 Catalogue of Implicit Rules 6814 ================================ 6178 6815 6179 6816 Here is a catalogue of predefined implicit rules which are always … … 6183 6820 `--no-builtin-rules' option cancels all predefined rules. 6184 6821 6822 This manual only documents the default rules available on POSIX-based 6823 operating systems. Other operating systems, such as VMS, Windows, 6824 OS/2, etc. may have different sets of default rules. To see the full 6825 list of default rules and variables available in your version of GNU 6826 `make', run `make -p' in a directory with no makefile. 6827 6185 6828 Not all of these rules will always be defined, even when the `-r' 6186 6829 option is not given. Many of the predefined implicit rules are … … 6188 6831 depends on the "suffix list" (the list of prerequisites of the special 6189 6832 target `.SUFFIXES'). The default suffix list is: `.out', `.a', `.ln', 6190 `.o', `.c', `.cc', `.C', `. p', `.f', `.F', `.r', `.y', `.l', `.s',6191 `. S', `.mod', `.sym', `.def', `.h', `.info', `.dvi', `.tex', `.texinfo',6192 `.texi ', `.txinfo', `.w', `.ch' `.web', `.sh', `.elc', `.el'. All of6193 the implicit rules described below whose prerequisites have one of 6194 these suffixes are actually suffix rules. If you modify the suffix 6195 list, the only predefined suffix rules in effect will be those named by 6196 one or two of the suffixes that are on the list you specify; rules 6197 whose suffixes fail to be on the list are disabled. *Note 6198 Old-Fashioned Suffix Rules: Suffix Rules, for full details on suffix 6199 rules.6833 `.o', `.c', `.cc', `.C', `.cpp', `.p', `.f', `.F', `.r', `.y', `.l', 6834 `.s', `.S', `.mod', `.sym', `.def', `.h', `.info', `.dvi', `.tex', 6835 `.texinfo', `.texi', `.txinfo', `.w', `.ch' `.web', `.sh', `.elc', 6836 `.el'. All of the implicit rules described below whose prerequisites 6837 have one of these suffixes are actually suffix rules. If you modify 6838 the suffix list, the only predefined suffix rules in effect will be 6839 those named by one or two of the suffixes that are on the list you 6840 specify; rules whose suffixes fail to be on the list are disabled. 6841 *Note Old-Fashioned Suffix Rules: Suffix Rules, for full details on 6842 suffix rules. 6200 6843 6201 6844 Compiling C programs … … 6204 6847 6205 6848 Compiling C++ programs 6206 `N.o' is made automatically from `N.cc' or `N.C' with a command of 6207 the form `$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)'. We encourage you to 6208 use the suffix `.cc' for C++ source files instead of `.C'. 6849 `N.o' is made automatically from `N.cc', `N.cpp', or `N.C' with a 6850 command of the form `$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)'. We 6851 encourage you to use the suffix `.cc' for C++ source files instead 6852 of `.C'. 6209 6853 6210 6854 Compiling Pascal programs … … 6380 7024 File: make.info, Node: Implicit Variables, Next: Chained Rules, Prev: Catalogue of Rules, Up: Implicit Rules 6381 7025 6382 Variables Used by Implicit Rules6383 ================================ 7026 10.3 Variables Used by Implicit Rules 7027 ===================================== 6384 7028 6385 7029 The commands in built-in implicit rules make liberal use of certain 6386 predefined variables. You can alter the se variables in the makefile,6387 with arguments to `make', or in the environment to alter how the 6388 implicit rules work without redefining the rules themselves. You can 6389 cancel all variables used by implicit rules with the `-R' or7030 predefined variables. You can alter the values of these variables in 7031 the makefile, with arguments to `make', or in the environment to alter 7032 how the implicit rules work without redefining the rules themselves. 7033 You can cancel all variables used by implicit rules with the `-R' or 6390 7034 `--no-builtin-variables' option. 6391 7035 … … 6407 7051 argument, separate them with spaces. 6408 7052 6409 Here is a table of variables used as names of programs in built-in 6410 rules: 7053 The following tables describe of some of the more commonly-used 7054 predefined variables. This list is not exhaustive, and the default 7055 values shown here may not be what are selected by `make' for your 7056 environment. To see the complete list of predefined variables for your 7057 instance of GNU `make' you can run `make -p' in a directory with no 7058 makefiles. 7059 7060 Here is a table of some of the more common variables used as names of 7061 programs in built-in rules: makefiles. 6411 7062 6412 7063 `AR' 6413 Archive-maintaining program; default `ar'. 7064 Archive-maintaining program; default `ar'. 6414 7065 6415 7066 `AS' 6416 Program for doing assembly; default `as'.7067 Program for compiling assembly files; default `as'. 6417 7068 6418 7069 `CC' 6419 Program for compiling C programs; default `cc'. 7070 Program for compiling C programs; default `cc'. 7071 7072 `CO' 7073 Program for checking out files from RCS; default `co'. 6420 7074 6421 7075 `CXX' 6422 Program for compiling C++ programs; default `g++'. 7076 Program for compiling C++ programs; default `g++'. 6423 7077 6424 7078 `CO' 6425 Program for extracting a file from RCS; default `co'. 7079 Program for extracting a file from RCS; default `co'. 6426 7080 6427 7081 `CPP' … … 6431 7085 `FC' 6432 7086 Program for compiling or preprocessing Fortran and Ratfor programs; 6433 default `f77'. 7087 default `f77'. 6434 7088 6435 7089 `GET' 6436 Program for extracting a file from SCCS; default `get'. 7090 Program for extracting a file from SCCS; default `get'. 6437 7091 6438 7092 `LEX' 6439 Program to use to turn Lex grammars into C programs or Ratfor 6440 programs; default `lex'. 7093 Program to use to turn Lex grammars into source code; default 7094 `lex'. 7095 7096 `YACC' 7097 Program to use to turn Yacc grammars into source code; default 7098 `yacc'. 7099 7100 `LINT' 7101 Program to use to run lint on source code; default `lint'. 7102 7103 `M2C' 7104 Program to use to compile Modula-2 source code; default `m2c'. 6441 7105 6442 7106 `PC' 6443 Program for compiling Pascal programs; default `pc'. 6444 6445 `YACC' 6446 Program to use to turn Yacc grammars into C programs; default 6447 `yacc'. 6448 6449 `YACCR' 6450 Program to use to turn Yacc grammars into Ratfor programs; default 6451 `yacc -r'. 7107 Program for compiling Pascal programs; default `pc'. 6452 7108 6453 7109 `MAKEINFO' 6454 7110 Program to convert a Texinfo source file into an Info file; default 6455 `makeinfo'. 7111 `makeinfo'. 6456 7112 6457 7113 `TEX' 6458 Program to make TeX DVI files from TeX source; default `tex'. 7114 Program to make TeX DVI files from TeX source; default `tex'. 6459 7115 6460 7116 `TEXI2DVI' 6461 7117 Program to make TeX DVI files from Texinfo source; default 6462 `texi2dvi'. 7118 `texi2dvi'. 6463 7119 6464 7120 `WEAVE' 6465 Program to translate Web into TeX; default `weave'. 7121 Program to translate Web into TeX; default `weave'. 6466 7122 6467 7123 `CWEAVE' 6468 Program to translate C Web into TeX; default `cweave'. 7124 Program to translate C Web into TeX; default `cweave'. 6469 7125 6470 7126 `TANGLE' 6471 Program to translate Web into Pascal; default `tangle'. 7127 Program to translate Web into Pascal; default `tangle'. 6472 7128 6473 7129 `CTANGLE' 6474 Program to translate C Web into C; default `ctangle'. 7130 Program to translate C Web into C; default `ctangle'. 6475 7131 6476 7132 `RM' 6477 Command to remove a file; default `rm -f'. 7133 Command to remove a file; default `rm -f'. 6478 7134 6479 7135 Here is a table of variables whose values are additional arguments … … 6514 7170 Extra flags to give to Lex. 6515 7171 7172 `YFLAGS' 7173 Extra flags to give to Yacc. 7174 6516 7175 `PFLAGS' 6517 7176 Extra flags to give to the Pascal compiler. … … 6520 7179 Extra flags to give to the Fortran compiler for Ratfor programs. 6521 7180 6522 ` YFLAGS'6523 Extra flags to give to Yacc.7181 `LINTFLAGS' 7182 Extra flags to give to lint. 6524 7183 6525 7184 6526 7185 File: make.info, Node: Chained Rules, Next: Pattern Rules, Prev: Implicit Variables, Up: Implicit Rules 6527 7186 6528 Chains of Implicit Rules6529 ======================== 7187 10.4 Chains of Implicit Rules 7188 ============================= 6530 7189 6531 7190 Sometimes a file can be made by a sequence of implicit rules. For … … 6579 7238 as a prerequisite of the special target `.PRECIOUS' to preserve 6580 7239 intermediate files made by implicit rules whose target patterns match 6581 that file's name; see *Note Interrupts::. 7240 that file's name; see *Note Interrupts::. 6582 7241 6583 7242 A chain can involve more than two implicit rules. For example, it is … … 6601 7260 earlier in the ordering of rules. 6602 7261 6603 6604 File: make.info, Node: Pattern Rules, Next: Last Resort, Prev: Chained Rules, Up: Implicit Rules6605 6606 Defining and Redefining Pattern Rules6607 =====================================6608 6609 You define an implicit rule by writing a "pattern rule". A pattern6610 rule looks like an ordinary rule, except that its target contains the6611 character `%' (exactly one of them). The target is considered a6612 pattern for matching file names; the `%' can match any nonempty6613 substring, while other characters match only themselves. The6614 prerequisites likewise use `%' to show how their names relate to the6615 target name.6616 6617 Thus, a pattern rule `%.o : %.c' says how to make any file `STEM.o'6618 from another file `STEM.c'.6619 6620 Note that expansion using `%' in pattern rules occurs *after* any6621 variable or function expansions, which take place when the makefile is6622 read. *Note How to Use Variables: Using Variables, and *Note Functions6623 for Transforming Text: Functions.6624 6625 * Menu:6626 6627 * Pattern Intro:: An introduction to pattern rules.6628 * Pattern Examples:: Examples of pattern rules.6629 * Automatic Variables:: How to use automatic variables in the6630 commands of implicit rules.6631 * Pattern Match:: How patterns match.6632 * Match-Anything Rules:: Precautions you should take prior to6633 defining rules that can match any6634 target file whatever.6635 * Canceling Rules:: How to override or cancel built-in rules.6636 6637 6638 File: make.info, Node: Pattern Intro, Next: Pattern Examples, Prev: Pattern Rules, Up: Pattern Rules6639 6640 Introduction to Pattern Rules6641 -----------------------------6642 6643 A pattern rule contains the character `%' (exactly one of them) in the6644 target; otherwise, it looks exactly like an ordinary rule. The target6645 is a pattern for matching file names; the `%' matches any nonempty6646 substring, while other characters match only themselves.6647 6648 For example, `%.c' as a pattern matches any file name that ends in6649 `.c'. `s.%.c' as a pattern matches any file name that starts with6650 `s.', ends in `.c' and is at least five characters long. (There must6651 be at least one character to match the `%'.) The substring that the6652 `%' matches is called the "stem".6653 6654 `%' in a prerequisite of a pattern rule stands for the same stem6655 that was matched by the `%' in the target. In order for the pattern6656 rule to apply, its target pattern must match the file name under6657 consideration, and its prerequisite patterns must name files that exist6658 or can be made. These files become prerequisites of the target.6659 6660 Thus, a rule of the form6661 6662 %.o : %.c ; COMMAND...6663 6664 specifies how to make a file `N.o', with another file `N.c' as its6665 prerequisite, provided that `N.c' exists or can be made.6666 6667 There may also be prerequisites that do not use `%'; such a6668 prerequisite attaches to every file made by this pattern rule. These6669 unvarying prerequisites are useful occasionally.6670 6671 A pattern rule need not have any prerequisites that contain `%', or6672 in fact any prerequisites at all. Such a rule is effectively a general6673 wildcard. It provides a way to make any file that matches the target6674 pattern. *Note Last Resort::.6675 6676 Pattern rules may have more than one target. Unlike normal rules,6677 this does not act as many different rules with the same prerequisites6678 and commands. If a pattern rule has multiple targets, `make' knows that6679 the rule's commands are responsible for making all of the targets. The6680 commands are executed only once to make all the targets. When searching6681 for a pattern rule to match a target, the target patterns of a rule6682 other than the one that matches the target in need of a rule are6683 incidental: `make' worries only about giving commands and prerequisites6684 to the file presently in question. However, when this file's commands6685 are run, the other targets are marked as having been updated themselves.6686 6687 The order in which pattern rules appear in the makefile is important6688 since this is the order in which they are considered. Of equally6689 applicable rules, only the first one found is used. The rules you6690 write take precedence over those that are built in. Note however, that6691 a rule whose prerequisites actually exist or are mentioned always takes6692 priority over a rule with prerequisites that must be made by chaining6693 other implicit rules.6694 6695 6696 File: make.info, Node: Pattern Examples, Next: Automatic Variables, Prev: Pattern Intro, Up: Pattern Rules6697 6698 Pattern Rule Examples6699 ---------------------6700 6701 Here are some examples of pattern rules actually predefined in `make'.6702 First, the rule that compiles `.c' files into `.o' files:6703 6704 %.o : %.c6705 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@6706 6707 defines a rule that can make any file `X.o' from `X.c'. The command6708 uses the automatic variables `$@' and `$<' to substitute the names of6709 the target file and the source file in each case where the rule applies6710 (*note Automatic Variables::).6711 6712 Here is a second built-in rule:6713 6714 % :: RCS/%,v6715 $(CO) $(COFLAGS) $<6716 6717 defines a rule that can make any file `X' whatsoever from a6718 corresponding file `X,v' in the subdirectory `RCS'. Since the target6719 is `%', this rule will apply to any file whatever, provided the6720 appropriate prerequisite file exists. The double colon makes the rule6721 "terminal", which means that its prerequisite may not be an intermediate6722 file (*note Match-Anything Pattern Rules: Match-Anything Rules.).6723 6724 This pattern rule has two targets:6725 6726 %.tab.c %.tab.h: %.y6727 bison -d $<6728 6729 This tells `make' that the command `bison -d X.y' will make both6730 `X.tab.c' and `X.tab.h'. If the file `foo' depends on the files6731 `parse.tab.o' and `scan.o' and the file `scan.o' depends on the file6732 `parse.tab.h', when `parse.y' is changed, the command `bison -d parse.y'6733 will be executed only once, and the prerequisites of both `parse.tab.o'6734 and `scan.o' will be satisfied. (Presumably the file `parse.tab.o'6735 will be recompiled from `parse.tab.c' and the file `scan.o' from6736 `scan.c', while `foo' is linked from `parse.tab.o', `scan.o', and its6737 other prerequisites, and it will execute happily ever after.)6738 6739 6740 File: make.info, Node: Automatic Variables, Next: Pattern Match, Prev: Pattern Examples, Up: Pattern Rules6741 6742 Automatic Variables6743 -------------------6744 6745 Suppose you are writing a pattern rule to compile a `.c' file into a6746 `.o' file: how do you write the `cc' command so that it operates on the6747 right source file name? You cannot write the name in the command,6748 because the name is different each time the implicit rule is applied.6749 6750 What you do is use a special feature of `make', the "automatic6751 variables". These variables have values computed afresh for each rule6752 that is executed, based on the target and prerequisites of the rule.6753 In this example, you would use `$@' for the object file name and `$<'6754 for the source file name.6755 6756 It's very important that you recognize the limited scope in which6757 automatic variable values are available: they only have values within6758 the command script. In particular, you cannot use them anywhere within6759 the target or prerequisite lists of a rule; they have no value there6760 and will expand to the empty string. A common mistake is attempting to6761 use `$@' within the prerequisites list in a rule; this will not work.6762 However, see below for information on the SysV-style `$$@' variables.6763 6764 Here is a table of automatic variables:6765 6766 `$@'6767 The file name of the target of the rule. If the target is an6768 archive member, then `$@' is the name of the archive file. In a6769 pattern rule that has multiple targets (*note Introduction to6770 Pattern Rules: Pattern Intro.), `$@' is the name of whichever6771 target caused the rule's commands to be run.6772 6773 `$%'6774 The target member name, when the target is an archive member.6775 *Note Archives::. For example, if the target is `foo.a(bar.o)'6776 then `$%' is `bar.o' and `$@' is `foo.a'. `$%' is empty when the6777 target is not an archive member.6778 6779 `$<'6780 The name of the first prerequisite. If the target got its6781 commands from an implicit rule, this will be the first6782 prerequisite added by the implicit rule (*note Implicit Rules::).6783 6784 `$?'6785 The names of all the prerequisites that are newer than the target,6786 with spaces between them. For prerequisites which are archive6787 members, only the member named is used (*note Archives::).6788 6789 `$^'6790 The names of all the prerequisites, with spaces between them. For6791 prerequisites which are archive members, only the member named is6792 used (*note Archives::). A target has only one prerequisite on6793 each other file it depends on, no matter how many times each file6794 is listed as a prerequisite. So if you list a prerequisite more6795 than once for a target, the value of `$^' contains just one copy6796 of the name.6797 6798 `$+'6799 This is like `$^', but prerequisites listed more than once are6800 duplicated in the order they were listed in the makefile. This is6801 primarily useful for use in linking commands where it is6802 meaningful to repeat library file names in a particular order.6803 6804 `$*'6805 The stem with which an implicit rule matches (*note How Patterns6806 Match: Pattern Match.). If the target is `dir/a.foo.b' and the6807 target pattern is `a.%.b' then the stem is `dir/foo'. The stem is6808 useful for constructing names of related files.6809 6810 In a static pattern rule, the stem is part of the file name that6811 matched the `%' in the target pattern.6812 6813 In an explicit rule, there is no stem; so `$*' cannot be determined6814 in that way. Instead, if the target name ends with a recognized6815 suffix (*note Old-Fashioned Suffix Rules: Suffix Rules.), `$*' is6816 set to the target name minus the suffix. For example, if the6817 target name is `foo.c', then `$*' is set to `foo', since `.c' is a6818 suffix. GNU `make' does this bizarre thing only for compatibility6819 with other implementations of `make'. You should generally avoid6820 using `$*' except in implicit rules or static pattern rules.6821 6822 If the target name in an explicit rule does not end with a6823 recognized suffix, `$*' is set to the empty string for that rule.6824 6825 `$?' is useful even in explicit rules when you wish to operate on6826 only the prerequisites that have changed. For example, suppose that an6827 archive named `lib' is supposed to contain copies of several object6828 files. This rule copies just the changed object files into the archive:6829 6830 lib: foo.o bar.o lose.o win.o6831 ar r lib $?6832 6833 Of the variables listed above, four have values that are single file6834 names, and three have values that are lists of file names. These seven6835 have variants that get just the file's directory name or just the file6836 name within the directory. The variant variables' names are formed by6837 appending `D' or `F', respectively. These variants are semi-obsolete6838 in GNU `make' since the functions `dir' and `notdir' can be used to get6839 a similar effect (*note Functions for File Names: File Name6840 Functions.). Note, however, that the `D' variants all omit the6841 trailing slash which always appears in the output of the `dir'6842 function. Here is a table of the variants:6843 6844 `$(@D)'6845 The directory part of the file name of the target, with the6846 trailing slash removed. If the value of `$@' is `dir/foo.o' then6847 `$(@D)' is `dir'. This value is `.' if `$@' does not contain a6848 slash.6849 6850 `$(@F)'6851 The file-within-directory part of the file name of the target. If6852 the value of `$@' is `dir/foo.o' then `$(@F)' is `foo.o'. `$(@F)'6853 is equivalent to `$(notdir $@)'.6854 6855 `$(*D)'6856 `$(*F)'6857 The directory part and the file-within-directory part of the stem;6858 `dir' and `foo' in this example.6859 6860 `$(%D)'6861 `$(%F)'6862 The directory part and the file-within-directory part of the target6863 archive member name. This makes sense only for archive member6864 targets of the form `ARCHIVE(MEMBER)' and is useful only when6865 MEMBER may contain a directory name. (*Note Archive Members as6866 Targets: Archive Members.)6867 6868 `$(<D)'6869 `$(<F)'6870 The directory part and the file-within-directory part of the first6871 prerequisite.6872 6873 `$(^D)'6874 `$(^F)'6875 Lists of the directory parts and the file-within-directory parts6876 of all prerequisites.6877 6878 `$(+D)'6879 `$(+F)'6880 Lists of the directory parts and the file-within-directory parts6881 of all prerequisites, including multiple instances of duplicated6882 prerequisites.6883 6884 `$(?D)'6885 `$(?F)'6886 Lists of the directory parts and the file-within-directory parts of6887 all prerequisites that are newer than the target.6888 6889 Note that we use a special stylistic convention when we talk about6890 these automatic variables; we write "the value of `$<'", rather than6891 "the variable `<'" as we would write for ordinary variables such as6892 `objects' and `CFLAGS'. We think this convention looks more natural in6893 this special case. Please do not assume it has a deep significance;6894 `$<' refers to the variable named `<' just as `$(CFLAGS)' refers to the6895 variable named `CFLAGS'. You could just as well use `$(<)' in place of6896 `$<'.6897 6898 GNU `make' provides support for the SysV `make' feature that allows6899 special variable references `$$@', `$$(@D)', and `$$(@F)' (note the6900 required double-"$"!) to appear with the _prerequisites list_ (normal6901 automatic variables are available only within a command script). When6902 appearing in a prerequisites list, these variables are expanded to the6903 name of the target, the directory component of the target, and the file6904 component of the target, respectively.6905 6906 Note that these variables are available only within explicit and6907 static pattern (*note Static Pattern Rules: Static Pattern.) rules;6908 they have no special significance within implicit (suffix or pattern)6909 rules. Also note that while SysV `make' actually expands its entire6910 prerequisite list _twice_, GNU `make' does not behave this way: instead6911 it simply expands these special variables without re-expanding any6912 other part of the prerequisites list.6913 6914 This somewhat bizarre feature is included only to provide some6915 compatibility with SysV makefiles. In a native GNU `make' file there6916 are other ways to accomplish the same results. This feature is6917 disabled if the special pseudo target `.POSIX' is defined.6918 6919 6920 File: make.info, Node: Pattern Match, Next: Match-Anything Rules, Prev: Automatic Variables, Up: Pattern Rules6921 6922 How Patterns Match6923 ------------------6924 6925 A target pattern is composed of a `%' between a prefix and a suffix,6926 either or both of which may be empty. The pattern matches a file name6927 only if the file name starts with the prefix and ends with the suffix,6928 without overlap. The text between the prefix and the suffix is called6929 the "stem". Thus, when the pattern `%.o' matches the file name6930 `test.o', the stem is `test'. The pattern rule prerequisites are6931 turned into actual file names by substituting the stem for the character6932 `%'. Thus, if in the same example one of the prerequisites is written6933 as `%.c', it expands to `test.c'.6934 6935 When the target pattern does not contain a slash (and it usually does6936 not), directory names in the file names are removed from the file name6937 before it is compared with the target prefix and suffix. After the6938 comparison of the file name to the target pattern, the directory names,6939 along with the slash that ends them, are added on to the prerequisite6940 file names generated from the pattern rule's prerequisite patterns and6941 the file name. The directories are ignored only for the purpose of6942 finding an implicit rule to use, not in the application of that rule.6943 Thus, `e%t' matches the file name `src/eat', with `src/a' as the stem.6944 When prerequisites are turned into file names, the directories from the6945 stem are added at the front, while the rest of the stem is substituted6946 for the `%'. The stem `src/a' with a prerequisite pattern `c%r' gives6947 the file name `src/car'.6948 6949 6950 File: make.info, Node: Match-Anything Rules, Next: Canceling Rules, Prev: Pattern Match, Up: Pattern Rules6951 6952 Match-Anything Pattern Rules6953 ----------------------------6954 6955 When a pattern rule's target is just `%', it matches any file name6956 whatever. We call these rules "match-anything" rules. They are very6957 useful, but it can take a lot of time for `make' to think about them,6958 because it must consider every such rule for each file name listed6959 either as a target or as a prerequisite.6960 6961 Suppose the makefile mentions `foo.c'. For this target, `make'6962 would have to consider making it by linking an object file `foo.c.o',6963 or by C compilation-and-linking in one step from `foo.c.c', or by6964 Pascal compilation-and-linking from `foo.c.p', and many other6965 possibilities.6966 6967 We know these possibilities are ridiculous since `foo.c' is a C6968 source file, not an executable. If `make' did consider these6969 possibilities, it would ultimately reject them, because files such as6970 `foo.c.o' and `foo.c.p' would not exist. But these possibilities are so6971 numerous that `make' would run very slowly if it had to consider them.6972 6973 To gain speed, we have put various constraints on the way `make'6974 considers match-anything rules. There are two different constraints6975 that can be applied, and each time you define a match-anything rule you6976 must choose one or the other for that rule.6977 6978 One choice is to mark the match-anything rule as "terminal" by6979 defining it with a double colon. When a rule is terminal, it does not6980 apply unless its prerequisites actually exist. Prerequisites that6981 could be made with other implicit rules are not good enough. In other6982 words, no further chaining is allowed beyond a terminal rule.6983 6984 For example, the built-in implicit rules for extracting sources from6985 RCS and SCCS files are terminal; as a result, if the file `foo.c,v' does6986 not exist, `make' will not even consider trying to make it as an6987 intermediate file from `foo.c,v.o' or from `RCS/SCCS/s.foo.c,v'. RCS6988 and SCCS files are generally ultimate source files, which should not be6989 remade from any other files; therefore, `make' can save time by not6990 looking for ways to remake them.6991 6992 If you do not mark the match-anything rule as terminal, then it is6993 nonterminal. A nonterminal match-anything rule cannot apply to a file6994 name that indicates a specific type of data. A file name indicates a6995 specific type of data if some non-match-anything implicit rule target6996 matches it.6997 6998 For example, the file name `foo.c' matches the target for the pattern6999 rule `%.c : %.y' (the rule to run Yacc). Regardless of whether this7000 rule is actually applicable (which happens only if there is a file7001 `foo.y'), the fact that its target matches is enough to prevent7002 consideration of any nonterminal match-anything rules for the file7003 `foo.c'. Thus, `make' will not even consider trying to make `foo.c' as7004 an executable file from `foo.c.o', `foo.c.c', `foo.c.p', etc.7005 7006 The motivation for this constraint is that nonterminal match-anything7007 rules are used for making files containing specific types of data (such7008 as executable files) and a file name with a recognized suffix indicates7009 some other specific type of data (such as a C source file).7010 7011 Special built-in dummy pattern rules are provided solely to recognize7012 certain file names so that nonterminal match-anything rules will not be7013 considered. These dummy rules have no prerequisites and no commands,7014 and they are ignored for all other purposes. For example, the built-in7015 implicit rule7016 7017 %.p :7018 7019 exists to make sure that Pascal source files such as `foo.p' match a7020 specific target pattern and thereby prevent time from being wasted7021 looking for `foo.p.o' or `foo.p.c'.7022 7023 Dummy pattern rules such as the one for `%.p' are made for every7024 suffix listed as valid for use in suffix rules (*note Old-Fashioned7025 Suffix Rules: Suffix Rules.).7026 7027 7028 File: make.info, Node: Canceling Rules, Prev: Match-Anything Rules, Up: Pattern Rules7029 7030 Canceling Implicit Rules7031 ------------------------7032 7033 You can override a built-in implicit rule (or one you have defined7034 yourself) by defining a new pattern rule with the same target and7035 prerequisites, but different commands. When the new rule is defined,7036 the built-in one is replaced. The new rule's position in the sequence7037 of implicit rules is determined by where you write the new rule.7038 7039 You can cancel a built-in implicit rule by defining a pattern rule7040 with the same target and prerequisites, but no commands. For example,7041 the following would cancel the rule that runs the assembler:7042 7043 %.o : %.s7044 7045 7046 File: make.info, Node: Last Resort, Next: Suffix Rules, Prev: Pattern Rules, Up: Implicit Rules7047 7048 Defining Last-Resort Default Rules7049 ==================================7050 7051 You can define a last-resort implicit rule by writing a terminal7052 match-anything pattern rule with no prerequisites (*note Match-Anything7053 Rules::). This is just like any other pattern rule; the only thing7054 special about it is that it will match any target. So such a rule's7055 commands are used for all targets and prerequisites that have no7056 commands of their own and for which no other implicit rule applies.7057 7058 For example, when testing a makefile, you might not care if the7059 source files contain real data, only that they exist. Then you might7060 do this:7061 7062 %::7063 touch $@7064 7065 to cause all the source files needed (as prerequisites) to be created7066 automatically.7067 7068 You can instead define commands to be used for targets for which7069 there are no rules at all, even ones which don't specify commands. You7070 do this by writing a rule for the target `.DEFAULT'. Such a rule's7071 commands are used for all prerequisites which do not appear as targets7072 in any explicit rule, and for which no implicit rule applies.7073 Naturally, there is no `.DEFAULT' rule unless you write one.7074 7075 If you use `.DEFAULT' with no commands or prerequisites:7076 7077 .DEFAULT:7078 7079 the commands previously stored for `.DEFAULT' are cleared. Then `make'7080 acts as if you had never defined `.DEFAULT' at all.7081 7082 If you do not want a target to get the commands from a match-anything7083 pattern rule or `.DEFAULT', but you also do not want any commands to be7084 run for the target, you can give it empty commands (*note Defining7085 Empty Commands: Empty Commands.).7086 7087 You can use a last-resort rule to override part of another makefile.7088 *Note Overriding Part of Another Makefile: Overriding Makefiles.7089 7090 7091 File: make.info, Node: Suffix Rules, Next: Implicit Rule Search, Prev: Last Resort, Up: Implicit Rules7092 7093 Old-Fashioned Suffix Rules7094 ==========================7095 7096 "Suffix rules" are the old-fashioned way of defining implicit rules for7097 `make'. Suffix rules are obsolete because pattern rules are more7098 general and clearer. They are supported in GNU `make' for7099 compatibility with old makefiles. They come in two kinds:7100 "double-suffix" and "single-suffix".7101 7102 A double-suffix rule is defined by a pair of suffixes: the target7103 suffix and the source suffix. It matches any file whose name ends with7104 the target suffix. The corresponding implicit prerequisite is made by7105 replacing the target suffix with the source suffix in the file name. A7106 two-suffix rule whose target and source suffixes are `.o' and `.c' is7107 equivalent to the pattern rule `%.o : %.c'.7108 7109 A single-suffix rule is defined by a single suffix, which is the7110 source suffix. It matches any file name, and the corresponding implicit7111 prerequisite name is made by appending the source suffix. A7112 single-suffix rule whose source suffix is `.c' is equivalent to the7113 pattern rule `% : %.c'.7114 7115 Suffix rule definitions are recognized by comparing each rule's7116 target against a defined list of known suffixes. When `make' sees a7117 rule whose target is a known suffix, this rule is considered a7118 single-suffix rule. When `make' sees a rule whose target is two known7119 suffixes concatenated, this rule is taken as a double-suffix rule.7120 7121 For example, `.c' and `.o' are both on the default list of known7122 suffixes. Therefore, if you define a rule whose target is `.c.o',7123 `make' takes it to be a double-suffix rule with source suffix `.c' and7124 target suffix `.o'. Here is the old-fashioned way to define the rule7125 for compiling a C source file:7126 7127 .c.o:7128 $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<7129 7130 Suffix rules cannot have any prerequisites of their own. If they7131 have any, they are treated as normal files with funny names, not as7132 suffix rules. Thus, the rule:7133 7134 .c.o: foo.h7135 $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<7136 7137 tells how to make the file `.c.o' from the prerequisite file `foo.h',7138 and is not at all like the pattern rule:7139 7140 %.o: %.c foo.h7141 $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<7142 7143 which tells how to make `.o' files from `.c' files, and makes all `.o'7144 files using this pattern rule also depend on `foo.h'.7145 7146 Suffix rules with no commands are also meaningless. They do not7147 remove previous rules as do pattern rules with no commands (*note7148 Canceling Implicit Rules: Canceling Rules.). They simply enter the7149 suffix or pair of suffixes concatenated as a target in the data base.7150 7151 The known suffixes are simply the names of the prerequisites of the7152 special target `.SUFFIXES'. You can add your own suffixes by writing a7153 rule for `.SUFFIXES' that adds more prerequisites, as in:7154 7155 .SUFFIXES: .hack .win7156 7157 which adds `.hack' and `.win' to the end of the list of suffixes.7158 7159 If you wish to eliminate the default known suffixes instead of just7160 adding to them, write a rule for `.SUFFIXES' with no prerequisites. By7161 special dispensation, this eliminates all existing prerequisites of7162 `.SUFFIXES'. You can then write another rule to add the suffixes you7163 want. For example,7164 7165 .SUFFIXES: # Delete the default suffixes7166 .SUFFIXES: .c .o .h # Define our suffix list7167 7168 The `-r' or `--no-builtin-rules' flag causes the default list of7169 suffixes to be empty.7170 7171 The variable `SUFFIXES' is defined to the default list of suffixes7172 before `make' reads any makefiles. You can change the list of suffixes7173 with a rule for the special target `.SUFFIXES', but that does not alter7174 this variable.7175 -
trunk/src/gmake/doc/make.info-2
r200 r503 1 This is ../../doc/make.info, produced by makeinfo version 4.6 from 2 ../../doc/make.texi. 1 This is make.info, produced by makeinfo version 4.8 from make.texi. 2 3 This file documents the GNU `make' utility, which determines 4 automatically which pieces of a large program need to be recompiled, 5 and issues the commands to recompile them. 6 7 This is Edition 0.70, last updated 1 April 2006, of `The GNU Make 8 Manual', for GNU `make' version 3.81. 9 10 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 11 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software 12 Foundation, Inc. 13 14 Permission is granted to copy, distribute and/or modify this 15 document under the terms of the GNU Free Documentation License, 16 Version 1.2 or any later version published by the Free Software 17 Foundation; with no Invariant Sections, with the Front-Cover Texts 18 being "A GNU Manual," and with the Back-Cover Texts as in (a) 19 below. A copy of the license is included in the section entitled 20 "GNU Free Documentation License." 21 22 (a) The FSF's Back-Cover Text is: "You have freedom to copy and 23 modify this GNU Manual, like GNU software. Copies published by 24 the Free Software Foundation raise funds for GNU development." 3 25 4 26 INFO-DIR-SECTION GNU Packages … … 7 29 END-INFO-DIR-ENTRY 8 30 9 This file documents the GNU Make utility, which determines 10 automatically which pieces of a large program need to be recompiled, 11 and issues the commands to recompile them. 12 13 This is Edition 0.61, last updated 02 May 2003, of `The GNU Make 14 Manual', for `make', Version 3.81. 15 16 Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 17 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. 18 19 Permission is granted to copy, distribute and/or modify this document 20 under the terms of the GNU Free Documentation License, Version 1.1 or 21 any later version published by the Free Software Foundation; with no 22 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover 23 Texts. A copy of the license is included in the section entitled "GNU 24 Free Documentation License". 31 32 File: make.info, Node: Pattern Rules, Next: Last Resort, Prev: Chained Rules, Up: Implicit Rules 33 34 10.5 Defining and Redefining Pattern Rules 35 ========================================== 36 37 You define an implicit rule by writing a "pattern rule". A pattern 38 rule looks like an ordinary rule, except that its target contains the 39 character `%' (exactly one of them). The target is considered a 40 pattern for matching file names; the `%' can match any nonempty 41 substring, while other characters match only themselves. The 42 prerequisites likewise use `%' to show how their names relate to the 43 target name. 44 45 Thus, a pattern rule `%.o : %.c' says how to make any file `STEM.o' 46 from another file `STEM.c'. 47 48 Note that expansion using `%' in pattern rules occurs *after* any 49 variable or function expansions, which take place when the makefile is 50 read. *Note How to Use Variables: Using Variables, and *Note Functions 51 for Transforming Text: Functions. 52 53 * Menu: 54 55 * Pattern Intro:: An introduction to pattern rules. 56 * Pattern Examples:: Examples of pattern rules. 57 * Automatic Variables:: How to use automatic variables in the 58 commands of implicit rules. 59 * Pattern Match:: How patterns match. 60 * Match-Anything Rules:: Precautions you should take prior to 61 defining rules that can match any 62 target file whatever. 63 * Canceling Rules:: How to override or cancel built-in rules. 64 65 66 File: make.info, Node: Pattern Intro, Next: Pattern Examples, Prev: Pattern Rules, Up: Pattern Rules 67 68 10.5.1 Introduction to Pattern Rules 69 ------------------------------------ 70 71 A pattern rule contains the character `%' (exactly one of them) in the 72 target; otherwise, it looks exactly like an ordinary rule. The target 73 is a pattern for matching file names; the `%' matches any nonempty 74 substring, while other characters match only themselves. 75 76 For example, `%.c' as a pattern matches any file name that ends in 77 `.c'. `s.%.c' as a pattern matches any file name that starts with 78 `s.', ends in `.c' and is at least five characters long. (There must 79 be at least one character to match the `%'.) The substring that the 80 `%' matches is called the "stem". 81 82 `%' in a prerequisite of a pattern rule stands for the same stem 83 that was matched by the `%' in the target. In order for the pattern 84 rule to apply, its target pattern must match the file name under 85 consideration and all of its prerequisites (after pattern substitution) 86 must name files that exist or can be made. These files become 87 prerequisites of the target. 88 89 Thus, a rule of the form 90 91 %.o : %.c ; COMMAND... 92 93 specifies how to make a file `N.o', with another file `N.c' as its 94 prerequisite, provided that `N.c' exists or can be made. 95 96 There may also be prerequisites that do not use `%'; such a 97 prerequisite attaches to every file made by this pattern rule. These 98 unvarying prerequisites are useful occasionally. 99 100 A pattern rule need not have any prerequisites that contain `%', or 101 in fact any prerequisites at all. Such a rule is effectively a general 102 wildcard. It provides a way to make any file that matches the target 103 pattern. *Note Last Resort::. 104 105 Pattern rules may have more than one target. Unlike normal rules, 106 this does not act as many different rules with the same prerequisites 107 and commands. If a pattern rule has multiple targets, `make' knows that 108 the rule's commands are responsible for making all of the targets. The 109 commands are executed only once to make all the targets. When searching 110 for a pattern rule to match a target, the target patterns of a rule 111 other than the one that matches the target in need of a rule are 112 incidental: `make' worries only about giving commands and prerequisites 113 to the file presently in question. However, when this file's commands 114 are run, the other targets are marked as having been updated themselves. 115 116 The order in which pattern rules appear in the makefile is important 117 since this is the order in which they are considered. Of equally 118 applicable rules, only the first one found is used. The rules you 119 write take precedence over those that are built in. Note however, that 120 a rule whose prerequisites actually exist or are mentioned always takes 121 priority over a rule with prerequisites that must be made by chaining 122 other implicit rules. 123 124 125 File: make.info, Node: Pattern Examples, Next: Automatic Variables, Prev: Pattern Intro, Up: Pattern Rules 126 127 10.5.2 Pattern Rule Examples 128 ---------------------------- 129 130 Here are some examples of pattern rules actually predefined in `make'. 131 First, the rule that compiles `.c' files into `.o' files: 132 133 %.o : %.c 134 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ 135 136 defines a rule that can make any file `X.o' from `X.c'. The command 137 uses the automatic variables `$@' and `$<' to substitute the names of 138 the target file and the source file in each case where the rule applies 139 (*note Automatic Variables::). 140 141 Here is a second built-in rule: 142 143 % :: RCS/%,v 144 $(CO) $(COFLAGS) $< 145 146 defines a rule that can make any file `X' whatsoever from a 147 corresponding file `X,v' in the subdirectory `RCS'. Since the target 148 is `%', this rule will apply to any file whatever, provided the 149 appropriate prerequisite file exists. The double colon makes the rule 150 "terminal", which means that its prerequisite may not be an intermediate 151 file (*note Match-Anything Pattern Rules: Match-Anything Rules.). 152 153 This pattern rule has two targets: 154 155 %.tab.c %.tab.h: %.y 156 bison -d $< 157 158 This tells `make' that the command `bison -d X.y' will make both 159 `X.tab.c' and `X.tab.h'. If the file `foo' depends on the files 160 `parse.tab.o' and `scan.o' and the file `scan.o' depends on the file 161 `parse.tab.h', when `parse.y' is changed, the command `bison -d parse.y' 162 will be executed only once, and the prerequisites of both `parse.tab.o' 163 and `scan.o' will be satisfied. (Presumably the file `parse.tab.o' 164 will be recompiled from `parse.tab.c' and the file `scan.o' from 165 `scan.c', while `foo' is linked from `parse.tab.o', `scan.o', and its 166 other prerequisites, and it will execute happily ever after.) 167 168 169 File: make.info, Node: Automatic Variables, Next: Pattern Match, Prev: Pattern Examples, Up: Pattern Rules 170 171 10.5.3 Automatic Variables 172 -------------------------- 173 174 Suppose you are writing a pattern rule to compile a `.c' file into a 175 `.o' file: how do you write the `cc' command so that it operates on the 176 right source file name? You cannot write the name in the command, 177 because the name is different each time the implicit rule is applied. 178 179 What you do is use a special feature of `make', the "automatic 180 variables". These variables have values computed afresh for each rule 181 that is executed, based on the target and prerequisites of the rule. 182 In this example, you would use `$@' for the object file name and `$<' 183 for the source file name. 184 185 It's very important that you recognize the limited scope in which 186 automatic variable values are available: they only have values within 187 the command script. In particular, you cannot use them anywhere within 188 the target list of a rule; they have no value there and will expand to 189 the empty string. Also, they cannot be accessed directly within the 190 prerequisite list of a rule. A common mistake is attempting to use 191 `$@' within the prerequisites list; this will not work. However, there 192 is a special feature of GNU `make', secondary expansion (*note 193 Secondary Expansion::), which will allow automatic variable values to 194 be used in prerequisite lists. 195 196 Here is a table of automatic variables: 197 198 `$@' 199 The file name of the target of the rule. If the target is an 200 archive member, then `$@' is the name of the archive file. In a 201 pattern rule that has multiple targets (*note Introduction to 202 Pattern Rules: Pattern Intro.), `$@' is the name of whichever 203 target caused the rule's commands to be run. 204 205 `$%' 206 The target member name, when the target is an archive member. 207 *Note Archives::. For example, if the target is `foo.a(bar.o)' 208 then `$%' is `bar.o' and `$@' is `foo.a'. `$%' is empty when the 209 target is not an archive member. 210 211 `$<' 212 The name of the first prerequisite. If the target got its 213 commands from an implicit rule, this will be the first 214 prerequisite added by the implicit rule (*note Implicit Rules::). 215 216 `$?' 217 The names of all the prerequisites that are newer than the target, 218 with spaces between them. For prerequisites which are archive 219 members, only the member named is used (*note Archives::). 220 221 `$^' 222 The names of all the prerequisites, with spaces between them. For 223 prerequisites which are archive members, only the member named is 224 used (*note Archives::). A target has only one prerequisite on 225 each other file it depends on, no matter how many times each file 226 is listed as a prerequisite. So if you list a prerequisite more 227 than once for a target, the value of `$^' contains just one copy 228 of the name. This list does *not* contain any of the order-only 229 prerequisites; for those see the `$|' variable, below. 230 231 `$+' 232 This is like `$^', but prerequisites listed more than once are 233 duplicated in the order they were listed in the makefile. This is 234 primarily useful for use in linking commands where it is 235 meaningful to repeat library file names in a particular order. 236 237 `$|' 238 The names of all the order-only prerequisites, with spaces between 239 them. 240 241 `$*' 242 The stem with which an implicit rule matches (*note How Patterns 243 Match: Pattern Match.). If the target is `dir/a.foo.b' and the 244 target pattern is `a.%.b' then the stem is `dir/foo'. The stem is 245 useful for constructing names of related files. 246 247 In a static pattern rule, the stem is part of the file name that 248 matched the `%' in the target pattern. 249 250 In an explicit rule, there is no stem; so `$*' cannot be determined 251 in that way. Instead, if the target name ends with a recognized 252 suffix (*note Old-Fashioned Suffix Rules: Suffix Rules.), `$*' is 253 set to the target name minus the suffix. For example, if the 254 target name is `foo.c', then `$*' is set to `foo', since `.c' is a 255 suffix. GNU `make' does this bizarre thing only for compatibility 256 with other implementations of `make'. You should generally avoid 257 using `$*' except in implicit rules or static pattern rules. 258 259 If the target name in an explicit rule does not end with a 260 recognized suffix, `$*' is set to the empty string for that rule. 261 262 `$?' is useful even in explicit rules when you wish to operate on 263 only the prerequisites that have changed. For example, suppose that an 264 archive named `lib' is supposed to contain copies of several object 265 files. This rule copies just the changed object files into the archive: 266 267 lib: foo.o bar.o lose.o win.o 268 ar r lib $? 269 270 Of the variables listed above, four have values that are single file 271 names, and three have values that are lists of file names. These seven 272 have variants that get just the file's directory name or just the file 273 name within the directory. The variant variables' names are formed by 274 appending `D' or `F', respectively. These variants are semi-obsolete 275 in GNU `make' since the functions `dir' and `notdir' can be used to get 276 a similar effect (*note Functions for File Names: File Name 277 Functions.). Note, however, that the `D' variants all omit the 278 trailing slash which always appears in the output of the `dir' 279 function. Here is a table of the variants: 280 281 `$(@D)' 282 The directory part of the file name of the target, with the 283 trailing slash removed. If the value of `$@' is `dir/foo.o' then 284 `$(@D)' is `dir'. This value is `.' if `$@' does not contain a 285 slash. 286 287 `$(@F)' 288 The file-within-directory part of the file name of the target. If 289 the value of `$@' is `dir/foo.o' then `$(@F)' is `foo.o'. `$(@F)' 290 is equivalent to `$(notdir $@)'. 291 292 `$(*D)' 293 `$(*F)' 294 The directory part and the file-within-directory part of the stem; 295 `dir' and `foo' in this example. 296 297 `$(%D)' 298 `$(%F)' 299 The directory part and the file-within-directory part of the target 300 archive member name. This makes sense only for archive member 301 targets of the form `ARCHIVE(MEMBER)' and is useful only when 302 MEMBER may contain a directory name. (*Note Archive Members as 303 Targets: Archive Members.) 304 305 `$(<D)' 306 `$(<F)' 307 The directory part and the file-within-directory part of the first 308 prerequisite. 309 310 `$(^D)' 311 `$(^F)' 312 Lists of the directory parts and the file-within-directory parts 313 of all prerequisites. 314 315 `$(+D)' 316 `$(+F)' 317 Lists of the directory parts and the file-within-directory parts 318 of all prerequisites, including multiple instances of duplicated 319 prerequisites. 320 321 `$(?D)' 322 `$(?F)' 323 Lists of the directory parts and the file-within-directory parts of 324 all prerequisites that are newer than the target. 325 326 Note that we use a special stylistic convention when we talk about 327 these automatic variables; we write "the value of `$<'", rather than 328 "the variable `<'" as we would write for ordinary variables such as 329 `objects' and `CFLAGS'. We think this convention looks more natural in 330 this special case. Please do not assume it has a deep significance; 331 `$<' refers to the variable named `<' just as `$(CFLAGS)' refers to the 332 variable named `CFLAGS'. You could just as well use `$(<)' in place of 333 `$<'. 334 335 336 File: make.info, Node: Pattern Match, Next: Match-Anything Rules, Prev: Automatic Variables, Up: Pattern Rules 337 338 10.5.4 How Patterns Match 339 ------------------------- 340 341 A target pattern is composed of a `%' between a prefix and a suffix, 342 either or both of which may be empty. The pattern matches a file name 343 only if the file name starts with the prefix and ends with the suffix, 344 without overlap. The text between the prefix and the suffix is called 345 the "stem". Thus, when the pattern `%.o' matches the file name 346 `test.o', the stem is `test'. The pattern rule prerequisites are 347 turned into actual file names by substituting the stem for the character 348 `%'. Thus, if in the same example one of the prerequisites is written 349 as `%.c', it expands to `test.c'. 350 351 When the target pattern does not contain a slash (and it usually does 352 not), directory names in the file names are removed from the file name 353 before it is compared with the target prefix and suffix. After the 354 comparison of the file name to the target pattern, the directory names, 355 along with the slash that ends them, are added on to the prerequisite 356 file names generated from the pattern rule's prerequisite patterns and 357 the file name. The directories are ignored only for the purpose of 358 finding an implicit rule to use, not in the application of that rule. 359 Thus, `e%t' matches the file name `src/eat', with `src/a' as the stem. 360 When prerequisites are turned into file names, the directories from the 361 stem are added at the front, while the rest of the stem is substituted 362 for the `%'. The stem `src/a' with a prerequisite pattern `c%r' gives 363 the file name `src/car'. 364 365 366 File: make.info, Node: Match-Anything Rules, Next: Canceling Rules, Prev: Pattern Match, Up: Pattern Rules 367 368 10.5.5 Match-Anything Pattern Rules 369 ----------------------------------- 370 371 When a pattern rule's target is just `%', it matches any file name 372 whatever. We call these rules "match-anything" rules. They are very 373 useful, but it can take a lot of time for `make' to think about them, 374 because it must consider every such rule for each file name listed 375 either as a target or as a prerequisite. 376 377 Suppose the makefile mentions `foo.c'. For this target, `make' 378 would have to consider making it by linking an object file `foo.c.o', 379 or by C compilation-and-linking in one step from `foo.c.c', or by 380 Pascal compilation-and-linking from `foo.c.p', and many other 381 possibilities. 382 383 We know these possibilities are ridiculous since `foo.c' is a C 384 source file, not an executable. If `make' did consider these 385 possibilities, it would ultimately reject them, because files such as 386 `foo.c.o' and `foo.c.p' would not exist. But these possibilities are so 387 numerous that `make' would run very slowly if it had to consider them. 388 389 To gain speed, we have put various constraints on the way `make' 390 considers match-anything rules. There are two different constraints 391 that can be applied, and each time you define a match-anything rule you 392 must choose one or the other for that rule. 393 394 One choice is to mark the match-anything rule as "terminal" by 395 defining it with a double colon. When a rule is terminal, it does not 396 apply unless its prerequisites actually exist. Prerequisites that 397 could be made with other implicit rules are not good enough. In other 398 words, no further chaining is allowed beyond a terminal rule. 399 400 For example, the built-in implicit rules for extracting sources from 401 RCS and SCCS files are terminal; as a result, if the file `foo.c,v' does 402 not exist, `make' will not even consider trying to make it as an 403 intermediate file from `foo.c,v.o' or from `RCS/SCCS/s.foo.c,v'. RCS 404 and SCCS files are generally ultimate source files, which should not be 405 remade from any other files; therefore, `make' can save time by not 406 looking for ways to remake them. 407 408 If you do not mark the match-anything rule as terminal, then it is 409 nonterminal. A nonterminal match-anything rule cannot apply to a file 410 name that indicates a specific type of data. A file name indicates a 411 specific type of data if some non-match-anything implicit rule target 412 matches it. 413 414 For example, the file name `foo.c' matches the target for the pattern 415 rule `%.c : %.y' (the rule to run Yacc). Regardless of whether this 416 rule is actually applicable (which happens only if there is a file 417 `foo.y'), the fact that its target matches is enough to prevent 418 consideration of any nonterminal match-anything rules for the file 419 `foo.c'. Thus, `make' will not even consider trying to make `foo.c' as 420 an executable file from `foo.c.o', `foo.c.c', `foo.c.p', etc. 421 422 The motivation for this constraint is that nonterminal match-anything 423 rules are used for making files containing specific types of data (such 424 as executable files) and a file name with a recognized suffix indicates 425 some other specific type of data (such as a C source file). 426 427 Special built-in dummy pattern rules are provided solely to recognize 428 certain file names so that nonterminal match-anything rules will not be 429 considered. These dummy rules have no prerequisites and no commands, 430 and they are ignored for all other purposes. For example, the built-in 431 implicit rule 432 433 %.p : 434 435 exists to make sure that Pascal source files such as `foo.p' match a 436 specific target pattern and thereby prevent time from being wasted 437 looking for `foo.p.o' or `foo.p.c'. 438 439 Dummy pattern rules such as the one for `%.p' are made for every 440 suffix listed as valid for use in suffix rules (*note Old-Fashioned 441 Suffix Rules: Suffix Rules.). 442 443 444 File: make.info, Node: Canceling Rules, Prev: Match-Anything Rules, Up: Pattern Rules 445 446 10.5.6 Canceling Implicit Rules 447 ------------------------------- 448 449 You can override a built-in implicit rule (or one you have defined 450 yourself) by defining a new pattern rule with the same target and 451 prerequisites, but different commands. When the new rule is defined, 452 the built-in one is replaced. The new rule's position in the sequence 453 of implicit rules is determined by where you write the new rule. 454 455 You can cancel a built-in implicit rule by defining a pattern rule 456 with the same target and prerequisites, but no commands. For example, 457 the following would cancel the rule that runs the assembler: 458 459 %.o : %.s 460 461 462 File: make.info, Node: Last Resort, Next: Suffix Rules, Prev: Pattern Rules, Up: Implicit Rules 463 464 10.6 Defining Last-Resort Default Rules 465 ======================================= 466 467 You can define a last-resort implicit rule by writing a terminal 468 match-anything pattern rule with no prerequisites (*note Match-Anything 469 Rules::). This is just like any other pattern rule; the only thing 470 special about it is that it will match any target. So such a rule's 471 commands are used for all targets and prerequisites that have no 472 commands of their own and for which no other implicit rule applies. 473 474 For example, when testing a makefile, you might not care if the 475 source files contain real data, only that they exist. Then you might 476 do this: 477 478 %:: 479 touch $@ 480 481 to cause all the source files needed (as prerequisites) to be created 482 automatically. 483 484 You can instead define commands to be used for targets for which 485 there are no rules at all, even ones which don't specify commands. You 486 do this by writing a rule for the target `.DEFAULT'. Such a rule's 487 commands are used for all prerequisites which do not appear as targets 488 in any explicit rule, and for which no implicit rule applies. 489 Naturally, there is no `.DEFAULT' rule unless you write one. 490 491 If you use `.DEFAULT' with no commands or prerequisites: 492 493 .DEFAULT: 494 495 the commands previously stored for `.DEFAULT' are cleared. Then `make' 496 acts as if you had never defined `.DEFAULT' at all. 497 498 If you do not want a target to get the commands from a match-anything 499 pattern rule or `.DEFAULT', but you also do not want any commands to be 500 run for the target, you can give it empty commands (*note Defining 501 Empty Commands: Empty Commands.). 502 503 You can use a last-resort rule to override part of another makefile. 504 *Note Overriding Part of Another Makefile: Overriding Makefiles. 505 506 507 File: make.info, Node: Suffix Rules, Next: Implicit Rule Search, Prev: Last Resort, Up: Implicit Rules 508 509 10.7 Old-Fashioned Suffix Rules 510 =============================== 511 512 "Suffix rules" are the old-fashioned way of defining implicit rules for 513 `make'. Suffix rules are obsolete because pattern rules are more 514 general and clearer. They are supported in GNU `make' for 515 compatibility with old makefiles. They come in two kinds: 516 "double-suffix" and "single-suffix". 517 518 A double-suffix rule is defined by a pair of suffixes: the target 519 suffix and the source suffix. It matches any file whose name ends with 520 the target suffix. The corresponding implicit prerequisite is made by 521 replacing the target suffix with the source suffix in the file name. A 522 two-suffix rule whose target and source suffixes are `.o' and `.c' is 523 equivalent to the pattern rule `%.o : %.c'. 524 525 A single-suffix rule is defined by a single suffix, which is the 526 source suffix. It matches any file name, and the corresponding implicit 527 prerequisite name is made by appending the source suffix. A 528 single-suffix rule whose source suffix is `.c' is equivalent to the 529 pattern rule `% : %.c'. 530 531 Suffix rule definitions are recognized by comparing each rule's 532 target against a defined list of known suffixes. When `make' sees a 533 rule whose target is a known suffix, this rule is considered a 534 single-suffix rule. When `make' sees a rule whose target is two known 535 suffixes concatenated, this rule is taken as a double-suffix rule. 536 537 For example, `.c' and `.o' are both on the default list of known 538 suffixes. Therefore, if you define a rule whose target is `.c.o', 539 `make' takes it to be a double-suffix rule with source suffix `.c' and 540 target suffix `.o'. Here is the old-fashioned way to define the rule 541 for compiling a C source file: 542 543 .c.o: 544 $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< 545 546 Suffix rules cannot have any prerequisites of their own. If they 547 have any, they are treated as normal files with funny names, not as 548 suffix rules. Thus, the rule: 549 550 .c.o: foo.h 551 $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< 552 553 tells how to make the file `.c.o' from the prerequisite file `foo.h', 554 and is not at all like the pattern rule: 555 556 %.o: %.c foo.h 557 $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< 558 559 which tells how to make `.o' files from `.c' files, and makes all `.o' 560 files using this pattern rule also depend on `foo.h'. 561 562 Suffix rules with no commands are also meaningless. They do not 563 remove previous rules as do pattern rules with no commands (*note 564 Canceling Implicit Rules: Canceling Rules.). They simply enter the 565 suffix or pair of suffixes concatenated as a target in the data base. 566 567 The known suffixes are simply the names of the prerequisites of the 568 special target `.SUFFIXES'. You can add your own suffixes by writing a 569 rule for `.SUFFIXES' that adds more prerequisites, as in: 570 571 .SUFFIXES: .hack .win 572 573 which adds `.hack' and `.win' to the end of the list of suffixes. 574 575 If you wish to eliminate the default known suffixes instead of just 576 adding to them, write a rule for `.SUFFIXES' with no prerequisites. By 577 special dispensation, this eliminates all existing prerequisites of 578 `.SUFFIXES'. You can then write another rule to add the suffixes you 579 want. For example, 580 581 .SUFFIXES: # Delete the default suffixes 582 .SUFFIXES: .c .o .h # Define our suffix list 583 584 The `-r' or `--no-builtin-rules' flag causes the default list of 585 suffixes to be empty. 586 587 The variable `SUFFIXES' is defined to the default list of suffixes 588 before `make' reads any makefiles. You can change the list of suffixes 589 with a rule for the special target `.SUFFIXES', but that does not alter 590 this variable. 25 591 26 592 27 593 File: make.info, Node: Implicit Rule Search, Prev: Suffix Rules, Up: Implicit Rules 28 594 29 Implicit Rule Search Algorithm30 ============================== 595 10.8 Implicit Rule Search Algorithm 596 =================================== 31 597 32 598 Here is the procedure `make' uses for searching for an implicit rule … … 110 676 File: make.info, Node: Archives, Next: Features, Prev: Implicit Rules, Up: Top 111 677 112 Using `make' to Update Archive Files113 ************************************ 678 11 Using `make' to Update Archive Files 679 *************************************** 114 680 115 681 "Archive files" are files containing named subfiles called "members"; … … 128 694 File: make.info, Node: Archive Members, Next: Archive Update, Prev: Archives, Up: Archives 129 695 130 Archive Members as Targets131 ========================== 696 11.1 Archive Members as Targets 697 =============================== 132 698 133 699 An individual member of an archive file can be used as a target or … … 149 715 150 716 In fact, nearly all archive member targets are updated in just this 151 way and there is an implicit rule to do it for you. * Note:* The `c'152 flag to `ar' is required if the archive file does not already exist.717 way and there is an implicit rule to do it for you. *Please note:* The 718 `c' flag to `ar' is required if the archive file does not already exist. 153 719 154 720 To specify several members in the same archive, you can write all the … … 170 736 File: make.info, Node: Archive Update, Next: Archive Pitfalls, Prev: Archive Members, Up: Archives 171 737 172 Implicit Rule for Archive Member Targets173 ======================================== 738 11.2 Implicit Rule for Archive Member Targets 739 ============================================= 174 740 175 741 Recall that a target that looks like `A(M)' stands for the member named … … 220 786 File: make.info, Node: Archive Symbols, Prev: Archive Update, Up: Archive Update 221 787 222 Updating Archive Symbol Directories223 ----------------------------------- 788 11.2.1 Updating Archive Symbol Directories 789 ------------------------------------------ 224 790 225 791 An archive file that is used as a library usually contains a special … … 251 817 File: make.info, Node: Archive Pitfalls, Next: Archive Suffix Rules, Prev: Archive Update, Up: Archives 252 818 253 Dangers When Using Archives254 =========================== 819 11.3 Dangers When Using Archives 820 ================================ 255 821 256 822 It is important to be careful when using parallel execution (the `-j' … … 267 833 File: make.info, Node: Archive Suffix Rules, Prev: Archive Pitfalls, Up: Archives 268 834 269 Suffix Rules for Archive Files270 ============================== 835 11.4 Suffix Rules for Archive Files 836 =================================== 271 837 272 838 You can write a special kind of suffix rule for dealing with archive … … 306 872 File: make.info, Node: Features, Next: Missing, Prev: Archives, Up: Top 307 873 308 Features of GNU `make'309 ********************** 874 12 Features of GNU `make' 875 ************************* 310 876 311 877 Here is a summary of the features of GNU `make', for comparison with … … 500 1066 501 1067 * The built-in variable `MAKE_VERSION' gives the version number of 502 `make'. 1068 `make'. 503 1069 504 1070 505 1071 File: make.info, Node: Missing, Next: Makefile Conventions, Prev: Features, Up: Top 506 1072 507 Incompatibilities and Missing Features508 ************************************** 1073 13 Incompatibilities and Missing Features 1074 ***************************************** 509 1075 510 1076 The `make' programs in various other systems support a few features … … 546 1112 imagine what went on in the minds of Unix `make' developers to do 547 1113 this; it is utterly inconsistent with the normal definition of 548 `$*'. 1114 `$*'. 549 1115 550 1116 * In some Unix `make's, implicit rule search (*note Using Implicit … … 590 1156 File: make.info, Node: Makefile Conventions, Next: Quick Reference, Prev: Missing, Up: Top 591 1157 592 Makefile Conventions593 ******************** 1158 14 Makefile Conventions 1159 *********************** 594 1160 595 1161 This node describes conventions for writing the Makefiles for GNU … … 610 1176 File: make.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions 611 1177 612 General Conventions for Makefiles613 ================================= 1178 14.1 General Conventions for Makefiles 1179 ====================================== 614 1180 615 1181 Every Makefile should contain this line: … … 690 1256 File: make.info, Node: Utilities in Makefiles, Next: Command Variables, Prev: Makefile Basics, Up: Makefile Conventions 691 1257 692 Utilities in Makefiles693 ====================== 1258 14.2 Utilities in Makefiles 1259 =========================== 694 1260 695 1261 Write the Makefile commands (and any shell scripts, such as … … 745 1311 File: make.info, Node: Command Variables, Next: Directory Variables, Prev: Utilities in Makefiles, Up: Makefile Conventions 746 1312 747 Variables for Specifying Commands748 ================================= 1313 14.3 Variables for Specifying Commands 1314 ====================================== 749 1315 750 1316 Makefiles should provide variables for overriding certain commands, … … 825 1391 File: make.info, Node: Directory Variables, Next: Standard Targets, Prev: Command Variables, Up: Makefile Conventions 826 1392 827 Variables for Installation Directories828 ====================================== 1393 14.4 Variables for Installation Directories 1394 =========================================== 829 1395 830 1396 Installation directories should always be named by variables, so it is 831 1397 easy to install in a nonstandard place. The standard names for these 832 variables are described below. They are based on a standard filesystem 833 layout; variants of it are used in SVR4, 4.4BSD, GNU/Linux, Ultrix v4, 834 and other modern operating systems. 1398 variables and the values they should have in GNU packages are described 1399 below. They are based on a standard filesystem layout; variants of it 1400 are used in GNU/Linux and other modern operating systems. 1401 1402 Installers are expected to override these values when calling `make' 1403 (e.g., `make prefix=/usr install' or `configure' (e.g., `configure 1404 --prefix=/usr'). GNU packages should not try to guess which value 1405 should be appropriate for these variables on the system they are being 1406 installed onto: use the default settings specified here so that all GNU 1407 packages behave identically, allowing the installer to achieve any 1408 desired layout. 835 1409 836 1410 These two variables set the root for the installation. All the other … … 885 1459 (If you are using Autoconf, write it as `@libexecdir@'.) 886 1460 1461 The definition of `libexecdir' is the same for all packages, so 1462 you should install your data in a subdirectory thereof. Most 1463 packages install their data under `$(libexecdir)/PACKAGE-NAME/', 1464 possibly within additional subdirectories thereof, such as 1465 `$(libexecdir)/PACKAGE-NAME/MACHINE/VERSION'. 1466 887 1467 Data files used by the program during its execution are divided into 888 1468 categories in two ways. … … 901 1481 architecture-independent, and it is generally not hard. 902 1482 903 Therefore, here are the variables Makefiles should use to specify 904 directories: 1483 Here are the variables Makefiles should use to specify directories 1484 to put these various kinds of files in: 1485 1486 `datarootdir' 1487 The root of the directory tree for read-only 1488 architecture-independent data files. This should normally be 1489 `/usr/local/share', but write it as `$(prefix)/share'. (If you 1490 are using Autoconf, write it as `@datarootdir@'.) `datadir''s 1491 default value is based on this variable; so are `infodir', 1492 `mandir', and others. 905 1493 906 1494 `datadir' 907 The directory for installing read-only architecture independent 908 data files. This should normally be `/usr/local/share', but write 909 it as `$(prefix)/share'. (If you are using Autoconf, write it as 910 `@datadir@'.) As a special exception, see `$(infodir)' and 911 `$(includedir)' below. 1495 The directory for installing idiosyncratic read-only 1496 architecture-independent data files for this program. This is 1497 usually the same place as `datarootdir', but we use the two 1498 separate variables so that you can move these program-specific 1499 files without altering the location for Info files, man pages, etc. 1500 1501 This should normally be `/usr/local/share', but write it as 1502 `$(datarootdir)'. (If you are using Autoconf, write it as 1503 `@datadir@'.) 1504 1505 The definition of `datadir' is the same for all packages, so you 1506 should install your data in a subdirectory thereof. Most packages 1507 install their data under `$(datadir)/PACKAGE-NAME/'. 912 1508 913 1509 `sysconfdir' … … 942 1538 `@localstatedir@'.) 943 1539 944 `libdir' 945 The directory for object files and libraries of object code. Do 946 not install executables here, they probably ought to go in 947 `$(libexecdir)' instead. The value of `libdir' should normally be 948 `/usr/local/lib', but write it as `$(exec_prefix)/lib'. (If you 949 are using Autoconf, write it as `@libdir@'.) 950 951 `infodir' 952 The directory for installing the Info files for this package. By 953 default, it should be `/usr/local/info', but it should be written 954 as `$(prefix)/info'. (If you are using Autoconf, write it as 955 `@infodir@'.) 956 957 `lispdir' 958 The directory for installing any Emacs Lisp files in this package. 959 By default, it should be `/usr/local/share/emacs/site-lisp', but 960 it should be written as `$(prefix)/share/emacs/site-lisp'. 961 962 If you are using Autoconf, write the default as `@lispdir@'. In 963 order to make `@lispdir@' work, you need the following lines in 964 your `configure.in' file: 965 966 lispdir='${datadir}/emacs/site-lisp' 967 AC_SUBST(lispdir) 1540 These variables specify the directory for installing certain specific 1541 types of files, if your program has them. Every GNU package should 1542 have Info files, so every program needs `infodir', but not all need 1543 `libdir' or `lispdir'. 968 1544 969 1545 `includedir' … … 1001 1577 string in the file--part of a comment--and `grep' for that string. 1002 1578 1579 `docdir' 1580 The directory for installing documentation files (other than Info) 1581 for this package. By default, it should be 1582 `/usr/local/share/doc/YOURPKG', but it should be written as 1583 `$(datarootdir)/doc/YOURPKG'. (If you are using Autoconf, write 1584 it as `@docdir@'.) The YOURPKG subdirectory, which may include a 1585 version number, prevents collisions among files with common names, 1586 such as `README'. 1587 1588 `infodir' 1589 The directory for installing the Info files for this package. By 1590 default, it should be `/usr/local/share/info', but it should be 1591 written as `$(datarootdir)/info'. (If you are using Autoconf, 1592 write it as `@infodir@'.) `infodir' is separate from `docdir' for 1593 compatibility with existing practice. 1594 1595 `htmldir' 1596 `dvidir' 1597 `pdfdir' 1598 `psdir' 1599 Directories for installing documentation files in the particular 1600 format. (It is not required to support documentation in all these 1601 formats.) They should all be set to `$(docdir)' by default. (If 1602 you are using Autoconf, write them as `@htmldir@', `@dvidir@', 1603 etc.) Packages which supply several translations of their 1604 documentation should install them in `$(htmldir)/'LL, 1605 `$(pdfdir)/'LL, etc. where LL is a locale abbreviation such as 1606 `en' or `pt_BR'. 1607 1608 `libdir' 1609 The directory for object files and libraries of object code. Do 1610 not install executables here, they probably ought to go in 1611 `$(libexecdir)' instead. The value of `libdir' should normally be 1612 `/usr/local/lib', but write it as `$(exec_prefix)/lib'. (If you 1613 are using Autoconf, write it as `@libdir@'.) 1614 1615 `lispdir' 1616 The directory for installing any Emacs Lisp files in this package. 1617 By default, it should be `/usr/local/share/emacs/site-lisp', but 1618 it should be written as `$(datarootdir)/emacs/site-lisp'. 1619 1620 If you are using Autoconf, write the default as `@lispdir@'. In 1621 order to make `@lispdir@' work, you need the following lines in 1622 your `configure.in' file: 1623 1624 lispdir='${datarootdir}/emacs/site-lisp' 1625 AC_SUBST(lispdir) 1626 1627 `localedir' 1628 The directory for installing locale-specific message catalogs for 1629 this package. By default, it should be `/usr/local/share/locale', 1630 but it should be written as `$(datarootdir)/locale'. (If you are 1631 using Autoconf, write it as `@localedir@'.) This directory 1632 usually has a subdirectory per locale. 1633 1003 1634 Unix-style man pages are installed in one of the following: 1004 1635 1005 1636 `mandir' 1006 1637 The top-level directory for installing the man pages (if any) for 1007 this package. It will normally be `/usr/local/ man', but you should1008 write it as `$(prefix)/man'. (If you are using Autoconf, write it1009 as `@mandir@'.)1638 this package. It will normally be `/usr/local/share/man', but you 1639 should write it as `$(datarootdir)/man'. (If you are using 1640 Autoconf, write it as `@mandir@'.) 1010 1641 1011 1642 `man1dir' … … 1050 1681 # NOTE: This directory must exist when you start the install. 1051 1682 prefix = /usr/local 1683 datarootdir = $(prefix)/share 1684 datadir = $(datarootdir) 1052 1685 exec_prefix = $(prefix) 1053 1686 # Where to put the executable for the command `gcc'. … … 1056 1689 libexecdir = $(exec_prefix)/libexec 1057 1690 # Where to put the Info files. 1058 infodir = $( prefix)/info1691 infodir = $(datarootdir)/info 1059 1692 1060 1693 If your program installs a large number of files into one of the … … 1073 1706 File: make.info, Node: Standard Targets, Next: Install Command Categories, Prev: Directory Variables, Up: Makefile Conventions 1074 1707 1075 Standard Targets for Users1076 ========================== 1708 14.5 Standard Targets for Users 1709 =============================== 1077 1710 1078 1711 All GNU programs should have the following targets in their Makefiles: … … 1143 1776 Categories::. 1144 1777 1778 `install-html' 1779 `install-dvi' 1780 `install-pdf' 1781 `install-ps' 1782 These targets install documentation in formats other than Info; 1783 they're intended to be called explicitly by the person installing 1784 the package, if that format is desired. GNU prefers Info files, 1785 so these must be installed by the `install' target. 1786 1787 When you have many documentation files to install, we recommend 1788 that you avoid collisions and clutter by arranging for these 1789 targets to install in subdirectories of the appropriate 1790 installation directory, such as `htmldir'. As one example, if 1791 your package has multiple manuals, and you wish to install HTML 1792 documentation with many files (such as the "split" mode output by 1793 `makeinfo --html'), you'll certainly want to use subdirectories, 1794 or two nodes with the same name in different manuals will 1795 overwrite each other. 1796 1145 1797 `uninstall' 1146 Delete all the installed files--the copies that the `install' 1147 target creates.1798 Delete all the installed files--the copies that the `install' and 1799 `install-*' targets create. 1148 1800 1149 1801 This rule should not modify the directories where compilation is … … 1177 1829 1178 1830 `clean' 1179 Delete all files from the current directory that are normally 1180 created by building the program. Don't delete the files that 1181 record the configuration. Also preserve files that could be made 1182 by building, but normally aren't because the distribution comes 1183 with them. 1831 Delete all files in the current directory that are normally 1832 created by building the program. Also delete files in other 1833 directories if they are created by this makefile. However, don't 1834 delete the files that record the configuration. Also preserve 1835 files that could be made by building, but normally aren't because 1836 the distribution comes with them. There is no need to delete 1837 parent directories that were created with `mkdir -p', since they 1838 could have existed anyway. 1184 1839 1185 1840 Delete `.dvi' files here if they are not part of the distribution. 1186 1841 1187 1842 `distclean' 1188 Delete all files from the current directory that are created by 1189 configuring or building the program. If you have unpacked the 1190 source and built the program without creating any other files, 1191 `make distclean' should leave only the files that were in the 1192 distribution. 1843 Delete all files in the current directory (or created by this 1844 makefile) that are created by configuring or building the program. 1845 If you have unpacked the source and built the program without 1846 creating any other files, `make distclean' should leave only the 1847 files that were in the distribution. However, there is no need to 1848 delete parent directories that were created with `mkdir -p', since 1849 they could have existed anyway. 1193 1850 1194 1851 `mostlyclean' … … 1199 1856 1200 1857 `maintainer-clean' 1201 Delete almost everything from the current directory that can be1202 reconstructed with this Makefile. This typically includes1203 everything deleted by `distclean', plus more: C source files1204 produced by Bison, tagstables, Info files, and so on.1858 Delete almost everything that can be reconstructed with this 1859 Makefile. This typically includes everything deleted by 1860 `distclean', plus more: C source files produced by Bison, tags 1861 tables, Info files, and so on. 1205 1862 1206 1863 The reason we say "almost everything" is that running the command … … 1209 1866 generally, `make maintainer-clean' should not delete anything that 1210 1867 needs to exist in order to run `configure' and then begin to build 1211 the program. This is the only exception; `maintainer-clean' should 1868 the program. Also, there is no need to delete parent directories 1869 that were created with `mkdir -p', since they could have existed 1870 anyway. These are the only exceptions; `maintainer-clean' should 1212 1871 delete everything else that can be rebuilt. 1213 1872 … … 1234 1893 1235 1894 info: foo.info 1236 1895 1237 1896 foo.info: foo.texi chap1.texi chap2.texi 1238 1897 $(MAKEINFO) $(srcdir)/foo.texi … … 1249 1908 1250 1909 `dvi' 1251 Generate DVI files for all Texinfo documentation. For example: 1910 `html' 1911 `pdf' 1912 `ps' 1913 Generate documentation files in the given format, if possible. 1914 Here's an example rule for generating DVI files from Texinfo: 1252 1915 1253 1916 dvi: foo.dvi 1254 1917 1255 1918 foo.dvi: foo.texi chap1.texi chap2.texi 1256 1919 $(TEXI2DVI) $(srcdir)/foo.texi … … 1260 1923 distribution.(1) Alternatively, write just the dependencies, and 1261 1924 allow GNU `make' to provide the command. 1925 1926 Here's another example, this one for generating HTML from Texinfo: 1927 1928 html: foo.html 1929 1930 foo.html: foo.texi chap1.texi chap2.texi 1931 $(TEXI2HTML) $(srcdir)/foo.texi 1932 1933 Again, you would define the variable `TEXI2HTML' in the Makefile; 1934 for example, it might run `makeinfo --no-split --html' (`makeinfo' 1935 is part of the Texinfo distribution). 1262 1936 1263 1937 `dist' … … 1330 2004 File: make.info, Node: Install Command Categories, Prev: Standard Targets, Up: Makefile Conventions 1331 2005 1332 Install Command Categories1333 ========================== 2006 14.6 Install Command Categories 2007 =============================== 1334 2008 1335 2009 When writing the `install' target, you must classify all the commands … … 1416 2090 Programs to build binary packages work by extracting the 1417 2091 pre-installation and post-installation commands. Here is one way of 1418 extracting the pre-installation commands: 1419 1420 make -n install -o all \ 2092 extracting the pre-installation commands (the `-s' option to `make' is 2093 needed to silence messages about entering subdirectories): 2094 2095 make -s -n install -o all \ 1421 2096 PRE_INSTALL=pre-install \ 1422 2097 POST_INSTALL=post-install \ … … 1426 2101 where the file `pre-install.awk' could contain this: 1427 2102 1428 $0 ~ /^ \t[ \t]*(normal_install|post_install)[ \t]*$/ {on = 0}2103 $0 ~ /^(normal-install|post-install)[ \t]*$/ {on = 0} 1429 2104 on {print $0} 1430 $0 ~ /^\t[ \t]*pre_install[ \t]*$/ {on = 1} 1431 1432 The resulting file of pre-installation commands is executed as a 1433 shell script as part of installing the binary package. 2105 $0 ~ /^pre-install[ \t]*$/ {on = 1} 1434 2106 1435 2107 1436 2108 File: make.info, Node: Quick Reference, Next: Error Messages, Prev: Makefile Conventions, Up: Top 1437 2109 1438 Quick Reference1439 *************** 2110 Appendix A Quick Reference 2111 ************************** 1440 2112 1441 2113 This appendix summarizes the directives, text manipulation functions, … … 1505 2177 directive. 1506 2178 1507 Here is a summary of the text manipulation functions (*note 1508 Functions::): 2179 Here is a summary of the built-in functions (*note Functions::): 1509 2180 1510 2181 `$(subst FROM,TO,TEXT)' … … 1543 2214 Functions. 1544 2215 2216 `$(word N,TEXT)' 2217 Extract the Nth word (one-origin) of TEXT. 2218 *Note Functions for String Substitution and Analysis: Text 2219 Functions. 2220 2221 `$(words TEXT)' 2222 Count the number of words in TEXT. 2223 *Note Functions for String Substitution and Analysis: Text 2224 Functions. 2225 2226 `$(wordlist S,E,TEXT)' 2227 Returns the list of words in TEXT from S to E. 2228 *Note Functions for String Substitution and Analysis: Text 2229 Functions. 2230 2231 `$(firstword NAMES...)' 2232 Extract the first word of NAMES. 2233 *Note Functions for String Substitution and Analysis: Text 2234 Functions. 2235 2236 `$(lastword NAMES...)' 2237 Extract the last word of NAMES. 2238 *Note Functions for String Substitution and Analysis: Text 2239 Functions. 2240 1545 2241 `$(dir NAMES...)' 1546 2242 Extract the directory part of each file name. … … 1572 2268 *Note Functions for File Names: File Name Functions. 1573 2269 1574 `$(word N,TEXT)'1575 Extract the Nth word (one-origin) of TEXT.1576 *Note Functions for File Names: File Name Functions.1577 1578 `$(words TEXT)'1579 Count the number of words in TEXT.1580 *Note Functions for File Names: File Name Functions.1581 1582 `$(wordlist S,E,TEXT)'1583 Returns the list of words in TEXT from S to E.1584 *Note Functions for File Names: File Name Functions.1585 1586 `$(firstword NAMES...)'1587 Extract the first word of NAMES.1588 *Note Functions for File Names: File Name Functions.1589 1590 2270 `$(wildcard PATTERN...)' 1591 2271 Find file names matching a shell file name pattern (_not_ a `%' … … 1593 2273 *Note The Function `wildcard': Wildcard Function. 1594 2274 2275 `$(realpath NAMES...)' 2276 For each file name in NAMES, expand to an absolute name that does 2277 not contain any `.', `..', nor symlinks. 2278 *Note Functions for File Names: File Name Functions. 2279 2280 `$(abspath NAMES...)' 2281 For each file name in NAMES, expand to an absolute name that does 2282 not contain any `.' or `..' components, but preserves symlinks. 2283 *Note Functions for File Names: File Name Functions. 2284 1595 2285 `$(error TEXT...)' 1596 2286 When this function is evaluated, `make' generates a fatal error … … 1611 2301 defined. 1612 2302 *Note The `origin' Function: Origin Function. 2303 2304 `$(flavor VARIABLE)' 2305 Return a string describing the flavor of the `make' variable 2306 VARIABLE. 2307 *Note The `flavor' Function: Flavor Function. 1613 2308 1614 2309 `$(foreach VAR,WORDS,TEXT)' … … 1702 2397 `/bin/sh'. You can set `SHELL' in the makefile to change the 1703 2398 shell used to run commands. *Note Command Execution: Execution. 2399 The `SHELL' variable is handled specially when importing from and 2400 exporting to the environment. *Note Choosing the Shell::. 1704 2401 1705 2402 `MAKESHELL' 1706 2403 On MS-DOS only, the name of the command interpreter that is to be 1707 used by `make'. This value takes precedence over the value of2404 used by `make'. This value takes precedence over the value of 1708 2405 `SHELL'. *Note MAKESHELL variable: Execution. 1709 2406 … … 1749 2446 File: make.info, Node: Error Messages, Next: Complex Makefile, Prev: Quick Reference, Up: Top 1750 2447 1751 Errors Generated by Make1752 ************************ 2448 Appendix B Errors Generated by Make 2449 *********************************** 1753 2450 1754 2451 Here is a list of the more common errors you might see generated by … … 1823 2520 on the command line, and `make' couldn't find any makefiles to 1824 2521 read in. The latter means that some makefile was found, but it 1825 didn't contain any default target and none was given on the1826 command line. GNU `make' has nothing to do in these situations.1827 *NoteArguments to Specify the Makefile: Makefile Arguments.2522 didn't contain any default goal and none was given on the command 2523 line. GNU `make' has nothing to do in these situations. *Note 2524 Arguments to Specify the Makefile: Makefile Arguments. 1828 2525 1829 2526 `Makefile `XXX' was not found.' … … 1902 2599 File: make.info, Node: Complex Makefile, Next: GNU Free Documentation License, Prev: Error Messages, Up: Top 1903 2600 1904 Complex Makefile Example1905 ************************ 2601 Appendix C Complex Makefile Example 2602 *********************************** 1906 2603 1907 2604 Here is the makefile for the GNU `tar' program. This is a moderately … … 1939 2636 # Un*x Makefile for GNU tar program. 1940 2637 # Copyright (C) 1991 Free Software Foundation, Inc. 1941 2638 1942 2639 # This program is free software; you can redistribute 1943 2640 # it and/or modify it under the terms of the GNU … … 1945 2642 ... 1946 2643 ... 1947 2644 1948 2645 SHELL = /bin/sh 1949 2646 1950 2647 #### Start of system configuration section. #### 1951 2648 1952 2649 srcdir = . 1953 2650 1954 2651 # If you use gcc, you should either run the 1955 2652 # fixincludes script that comes with it or else use … … 1960 2657 INSTALL = /usr/local/bin/install -c 1961 2658 INSTALLDATA = /usr/local/bin/install -c -m 644 1962 2659 1963 2660 # Things you might add to DEFS: 1964 2661 # -DSTDC_HEADERS If you have ANSI C headers and … … 2011 2708 # -DXENIX If you have sys/inode.h 2012 2709 # and need it 94 to be included. 2013 2710 2014 2711 DEFS = -DSIGTYPE=int -DDIRENT -DSTRSTR_MISSING \ 2015 2712 -DVPRINTF_MISSING -DBSD42 … … 2020 2717 DEF_AR_FILE = /dev/rmt8 2021 2718 DEFBLOCKING = 20 2022 2719 2023 2720 CDEBUG = -g 2024 2721 CFLAGS = $(CDEBUG) -I. -I$(srcdir) $(DEFS) \ … … 2026 2723 -DDEFBLOCKING=$(DEFBLOCKING) 2027 2724 LDFLAGS = -g 2028 2725 2029 2726 prefix = /usr/local 2030 2727 # Prefix for each installed program, 2031 2728 # normally empty or `g'. 2032 2729 binprefix = 2033 2730 2034 2731 # The directory to install tar in. 2035 2732 bindir = $(prefix)/bin 2036 2733 2037 2734 # The directory to install the info files in. 2038 2735 infodir = $(prefix)/info 2039 2736 2040 2737 #### End of system configuration section. #### 2041 2738 2042 2739 SRC1 = tar.c create.c extract.c buffer.c \ 2043 2740 getoldopt.c update.c gnu.c mangle.c … … 2059 2756 msd_dir.h msd_dir.c tcexparg.c \ 2060 2757 level-0 level-1 backup-specs testpad.c 2061 2758 2759 .PHONY: all 2062 2760 all: tar rmt tar.info 2063 2761 2762 .PHONY: tar 2064 2763 tar: $(OBJS) 2065 2764 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) 2066 2765 2067 2766 rmt: rmt.c 2068 2767 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ rmt.c 2069 2768 2070 2769 tar.info: tar.texinfo 2071 2770 makeinfo tar.texinfo 2072 2771 2772 .PHONY: install 2073 2773 install: all 2074 2774 $(INSTALL) tar $(bindir)/$(binprefix)tar 2075 2775 -test ! -f rmt || $(INSTALL) rmt /etc/rmt 2076 2776 $(INSTALLDATA) $(srcdir)/tar.info* $(infodir) 2077 2777 2078 2778 $(OBJS): tar.h port.h testpad.h 2079 2779 regex.o buffer.o tar.o: regex.h 2080 2780 # getdate.y has 8 shift/reduce conflicts. 2081 2781 2082 2782 testpad.h: testpad 2083 2783 ./testpad 2084 2784 2085 2785 testpad: testpad.o 2086 2786 $(CC) -o $@ testpad.o 2087 2787 2088 2788 TAGS: $(SRCS) 2089 2789 etags $(SRCS) 2090 2790 2791 .PHONY: clean 2091 2792 clean: 2092 2793 rm -f *.o tar rmt testpad testpad.h core 2093 2794 2795 .PHONY: distclean 2094 2796 distclean: clean 2095 2797 rm -f TAGS Makefile config.status 2096 2798 2799 .PHONY: realclean 2097 2800 realclean: distclean 2098 2801 rm -f tar.info* 2099 2802 2803 .PHONY: shar 2100 2804 shar: $(SRCS) $(AUX) 2101 2805 shar $(SRCS) $(AUX) | compress \ … … 2104 2808 -e q 2105 2809 version.c`.shar.Z 2106 2810 2811 .PHONY: dist 2107 2812 dist: $(SRCS) $(AUX) 2108 2813 echo tar-`sed \ … … 2116 2821 tar chZf `cat .fname`.tar.Z `cat .fname` 2117 2822 -rm -rf `cat .fname` .fname 2118 2823 2119 2824 tar.zoo: $(SRCS) $(AUX) 2120 2825 -rm -rf tmp.dir … … 2131 2836 File: make.info, Node: GNU Free Documentation License, Next: Concept Index, Prev: Complex Makefile, Up: Top 2132 2837 2133 GNU Free Documentation License 2134 ****************************** 2135 2136 Version 1.1, March 2000 2137 Copyright (C) 2000 Free Software Foundation, Inc. 2138 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA 2139 2838 Appendix D GNU Free Documentation License 2839 ***************************************** 2840 2841 Version 1.2, November 2002 2842 2843 Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 2844 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 2845 2140 2846 Everyone is permitted to copy and distribute verbatim copies 2141 2847 of this license document, but changing it is not allowed. … … 2144 2850 2145 2851 The purpose of this License is to make a manual, textbook, or other 2146 written document "free" in the sense of freedom: to assure everyone2147 the effective freedom to copy and redistribute it, with or without2148 modifying it, either commercially or noncommercially. Secondarily,2149 this License preserves for the author and publisher a way to get2150 credit for their work, while not being considered responsible for2151 modifications made by others.2852 functional and useful document "free" in the sense of freedom: to 2853 assure everyone the effective freedom to copy and redistribute it, 2854 with or without modifying it, either commercially or 2855 noncommercially. Secondarily, this License preserves for the 2856 author and publisher a way to get credit for their work, while not 2857 being considered responsible for modifications made by others. 2152 2858 2153 2859 This License is a kind of "copyleft", which means that derivative … … 2167 2873 1. APPLICABILITY AND DEFINITIONS 2168 2874 2169 This License applies to any manual or other work that contains a 2170 notice placed by the copyright holder saying it can be distributed 2171 under the terms of this License. The "Document", below, refers to 2172 any such manual or work. Any member of the public is a licensee, 2173 and is addressed as "you". 2875 This License applies to any manual or other work, in any medium, 2876 that contains a notice placed by the copyright holder saying it 2877 can be distributed under the terms of this License. Such a notice 2878 grants a world-wide, royalty-free license, unlimited in duration, 2879 to use that work under the conditions stated herein. The 2880 "Document", below, refers to any such manual or work. Any member 2881 of the public is a licensee, and is addressed as "you". You 2882 accept the license if you copy, modify or distribute the work in a 2883 way requiring permission under copyright law. 2174 2884 2175 2885 A "Modified Version" of the Document means any work containing the … … 2177 2887 modifications and/or translated into another language. 2178 2888 2179 A "Secondary Section" is a named appendix or a front-matter 2180 section of the Document that deals exclusively withthe2181 relationship of the publishers or authors of the Document to the2182 Document's overall subject (or to related matters) and contains2183 nothing that could fall directly within that overall subject.2184 (For example, if the Document is in part a textbook of2185 mathematics, a Secondary Section may not explain any mathematics.)2186 The relationship could be a matter of historical connection with2187 the subject or with related matters, or of legal, commercial,2188 philosophical, ethical or political positionregarding them.2889 A "Secondary Section" is a named appendix or a front-matter section 2890 of the Document that deals exclusively with the relationship of the 2891 publishers or authors of the Document to the Document's overall 2892 subject (or to related matters) and contains nothing that could 2893 fall directly within that overall subject. (Thus, if the Document 2894 is in part a textbook of mathematics, a Secondary Section may not 2895 explain any mathematics.) The relationship could be a matter of 2896 historical connection with the subject or with related matters, or 2897 of legal, commercial, philosophical, ethical or political position 2898 regarding them. 2189 2899 2190 2900 The "Invariant Sections" are certain Secondary Sections whose 2191 2901 titles are designated, as being those of Invariant Sections, in 2192 2902 the notice that says that the Document is released under this 2193 License. 2903 License. If a section does not fit the above definition of 2904 Secondary then it is not allowed to be designated as Invariant. 2905 The Document may contain zero Invariant Sections. If the Document 2906 does not identify any Invariant Sections then there are none. 2194 2907 2195 2908 The "Cover Texts" are certain short passages of text that are 2196 2909 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 2197 that says that the Document is released under this License. 2910 that says that the Document is released under this License. A 2911 Front-Cover Text may be at most 5 words, and a Back-Cover Text may 2912 be at most 25 words. 2198 2913 2199 2914 A "Transparent" copy of the Document means a machine-readable copy, 2200 2915 represented in a format whose specification is available to the 2201 general public, whose contents can be viewed and edited directly2202 andstraightforwardly with generic text editors or (for images2916 general public, that is suitable for revising the document 2917 straightforwardly with generic text editors or (for images 2203 2918 composed of pixels) generic paint programs or (for drawings) some 2204 2919 widely available drawing editor, and that is suitable for input to 2205 2920 text formatters or for automatic translation to a variety of 2206 2921 formats suitable for input to text formatters. A copy made in an 2207 otherwise Transparent file format whose markup has been designed 2208 to thwart or discourage subsequent modification by readers is not 2209 Transparent. A copy that is not "Transparent" is called "Opaque". 2922 otherwise Transparent file format whose markup, or absence of 2923 markup, has been arranged to thwart or discourage subsequent 2924 modification by readers is not Transparent. An image format is 2925 not Transparent if used for any substantial amount of text. A 2926 copy that is not "Transparent" is called "Opaque". 2210 2927 2211 2928 Examples of suitable formats for Transparent copies include plain 2212 2929 ASCII without markup, Texinfo input format, LaTeX input format, 2213 2930 SGML or XML using a publicly available DTD, and 2214 standard-conforming simple HTML designed for human modification. 2215 Opaque formats include PostScript, PDF, proprietary formats that 2216 can be read and edited only by proprietary word processors, SGML 2217 or XML for which the DTD and/or processing tools are not generally 2218 available, and the machine-generated HTML produced by some word 2219 processors for output purposes only. 2931 standard-conforming simple HTML, PostScript or PDF designed for 2932 human modification. Examples of transparent image formats include 2933 PNG, XCF and JPG. Opaque formats include proprietary formats that 2934 can be read and edited only by proprietary word processors, SGML or 2935 XML for which the DTD and/or processing tools are not generally 2936 available, and the machine-generated HTML, PostScript or PDF 2937 produced by some word processors for output purposes only. 2220 2938 2221 2939 The "Title Page" means, for a printed book, the title page itself, … … 2225 2943 Page" means the text near the most prominent appearance of the 2226 2944 work's title, preceding the beginning of the body of the text. 2945 2946 A section "Entitled XYZ" means a named subunit of the Document 2947 whose title either is precisely XYZ or contains XYZ in parentheses 2948 following text that translates XYZ in another language. (Here XYZ 2949 stands for a specific section name mentioned below, such as 2950 "Acknowledgements", "Dedications", "Endorsements", or "History".) 2951 To "Preserve the Title" of such a section when you modify the 2952 Document means that it remains a section "Entitled XYZ" according 2953 to this definition. 2954 2955 The Document may include Warranty Disclaimers next to the notice 2956 which states that this License applies to the Document. These 2957 Warranty Disclaimers are considered to be included by reference in 2958 this License, but only as regards disclaiming warranties: any other 2959 implication that these Warranty Disclaimers may have is void and 2960 has no effect on the meaning of this License. 2227 2961 2228 2962 2. VERBATIM COPYING … … 2244 2978 3. COPYING IN QUANTITY 2245 2979 2246 If you publish printed copies of the Document numbering more than 2247 100, and the Document's license notice requires Cover Texts, you 2248 must enclose the copies in covers that carry, clearly and legibly, 2249 all these Cover Texts: Front-Cover Texts on the front cover, and 2980 If you publish printed copies (or copies in media that commonly 2981 have printed covers) of the Document, numbering more than 100, and 2982 the Document's license notice requires Cover Texts, you must 2983 enclose the copies in covers that carry, clearly and legibly, all 2984 these Cover Texts: Front-Cover Texts on the front cover, and 2250 2985 Back-Cover Texts on the back cover. Both covers must also clearly 2251 2986 and legibly identify you as the publisher of these copies. The … … 2265 3000 numbering more than 100, you must either include a 2266 3001 machine-readable Transparent copy along with each Opaque copy, or 2267 state in or with each Opaque copy a publicly-accessible 2268 computer-network location containing a complete Transparent copy 2269 of the Document, free of added material, which the general 2270 network-using public has access to download anonymously at no 2271 charge using public-standard network protocols. If you use the 3002 state in or with each Opaque copy a computer-network location from 3003 which the general network-using public has access to download 3004 using public-standard network protocols a complete Transparent 3005 copy of the Document, free of added material. If you use the 2272 3006 latter option, you must take reasonably prudent steps, when you 2273 3007 begin distribution of Opaque copies in quantity, to ensure that … … 2303 3037 the Modified Version, together with at least five of the 2304 3038 principal authors of the Document (all of its principal 2305 authors, if it has less than five). 3039 authors, if it has fewer than five), unless they release you 3040 from this requirement. 2306 3041 2307 3042 C. State on the Title page the name of the publisher of the … … 2324 3059 H. Include an unaltered copy of this License. 2325 3060 2326 I. Preserve the section entitled "History", and its title, and2327 a dd to it an item stating at least the title, year, new3061 I. Preserve the section Entitled "History", Preserve its Title, 3062 and add to it an item stating at least the title, year, new 2328 3063 authors, and publisher of the Modified Version as given on 2329 the Title Page. If there is no section entitled "History" in3064 the Title Page. If there is no section Entitled "History" in 2330 3065 the Document, create one stating the title, year, authors, 2331 3066 and publisher of the Document as given on its Title Page, … … 2342 3077 it refers to gives permission. 2343 3078 2344 K. In any section entitled "Acknowledgments" or "Dedications",2345 preserve the section's title, and preserve in the section all2346 the substance and tone of each of the contributor2347 acknowledg ments and/or dedications given therein.3079 K. For any section Entitled "Acknowledgements" or "Dedications", 3080 Preserve the Title of the section, and preserve in the 3081 section all the substance and tone of each of the contributor 3082 acknowledgements and/or dedications given therein. 2348 3083 2349 3084 L. Preserve all the Invariant Sections of the Document, … … 2352 3087 titles. 2353 3088 2354 M. Delete any section entitled "Endorsements". Such a section3089 M. Delete any section Entitled "Endorsements". Such a section 2355 3090 may not be included in the Modified Version. 2356 3091 2357 N. Do not retitle any existing section as "Endorsements" or to 2358 conflict in title with any Invariant Section. 3092 N. Do not retitle any existing section to be Entitled 3093 "Endorsements" or to conflict in title with any Invariant 3094 Section. 3095 3096 O. Preserve any Warranty Disclaimers. 2359 3097 2360 3098 If the Modified Version includes new front-matter sections or … … 2366 3104 other section titles. 2367 3105 2368 You may add a section entitled "Endorsements", provided it contains3106 You may add a section Entitled "Endorsements", provided it contains 2369 3107 nothing but endorsements of your Modified Version by various 2370 3108 parties--for example, statements of peer review or that the text … … 2394 3132 all of the Invariant Sections of all of the original documents, 2395 3133 unmodified, and list them all as Invariant Sections of your 2396 combined work in its license notice. 3134 combined work in its license notice, and that you preserve all 3135 their Warranty Disclaimers. 2397 3136 2398 3137 The combined work need only contain one copy of this License, and … … 2406 3145 combined work. 2407 3146 2408 In the combination, you must combine any sections entitled3147 In the combination, you must combine any sections Entitled 2409 3148 "History" in the various original documents, forming one section 2410 entitled "History"; likewise combine any sections entitled2411 "Acknowledg ments", and any sections entitled "Dedications". You2412 must delete all sections entitled "Endorsements."3149 Entitled "History"; likewise combine any sections Entitled 3150 "Acknowledgements", and any sections Entitled "Dedications". You 3151 must delete all sections Entitled "Endorsements." 2413 3152 2414 3153 6. COLLECTIONS OF DOCUMENTS … … 2431 3170 A compilation of the Document or its derivatives with other 2432 3171 separate and independent documents or works, in or on a volume of 2433 a storage or distribution medium, does not as a whole count as a 2434 Modified Version of the Document, provided no compilation 2435 copyright is claimed for the compilation. Such a compilation is 2436 called an "aggregate", and this License does not apply to the 2437 other self-contained works thus compiled with the Document, on 2438 account of their being thus compiled, if they are not themselves 2439 derivative works of the Document. 3172 a storage or distribution medium, is called an "aggregate" if the 3173 copyright resulting from the compilation is not used to limit the 3174 legal rights of the compilation's users beyond what the individual 3175 works permit. When the Document is included in an aggregate, this 3176 License does not apply to the other works in the aggregate which 3177 are not themselves derivative works of the Document. 2440 3178 2441 3179 If the Cover Text requirement of section 3 is applicable to these 2442 copies of the Document, then if the Document is less than one 2443 quarter of the entire aggregate, the Document's Cover Texts may be 2444 placed on covers that surround only the Document within the 2445 aggregate. Otherwise they must appear on covers around the whole 2446 aggregate. 3180 copies of the Document, then if the Document is less than one half 3181 of the entire aggregate, the Document's Cover Texts may be placed 3182 on covers that bracket the Document within the aggregate, or the 3183 electronic equivalent of covers if the Document is in electronic 3184 form. Otherwise they must appear on printed covers that bracket 3185 the whole aggregate. 2447 3186 2448 3187 8. TRANSLATION … … 2454 3193 translations of some or all Invariant Sections in addition to the 2455 3194 original versions of these Invariant Sections. You may include a 2456 translation of this License provided that you also include the 2457 original English version of this License. In case of a 2458 disagreement between the translation and the original English 2459 version of this License, the original English version will prevail. 3195 translation of this License, and all the license notices in the 3196 Document, and any Warranty Disclaimers, provided that you also 3197 include the original English version of this License and the 3198 original versions of those notices and disclaimers. In case of a 3199 disagreement between the translation and the original version of 3200 this License or a notice or disclaimer, the original version will 3201 prevail. 3202 3203 If a section in the Document is Entitled "Acknowledgements", 3204 "Dedications", or "History", the requirement (section 4) to 3205 Preserve its Title (section 1) will typically require changing the 3206 actual title. 2460 3207 2461 3208 9. TERMINATION … … 2487 3234 Free Software Foundation. 2488 3235 2489 ADDENDUM: How to use this License for your documents2490 ==================================================== 3236 D.1 ADDENDUM: How to use this License for your documents 3237 ======================================================== 2491 3238 2492 3239 To use this License in a document you have written, include a copy of … … 2496 3243 Copyright (C) YEAR YOUR NAME. 2497 3244 Permission is granted to copy, distribute and/or modify this document 2498 under the terms of the GNU Free Documentation License, Version 1. 13245 under the terms of the GNU Free Documentation License, Version 1.2 2499 3246 or any later version published by the Free Software Foundation; 2500 with the Invariant Sections being LIST THEIR TITLES, with the 2501 Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. 2502 A copy of the license is included in the section entitled ``GNU 3247 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 3248 Texts. A copy of the license is included in the section entitled ``GNU 2503 3249 Free Documentation License''. 2504 3250 2505 If you have no Invariant Sections, write "with no Invariant Sections" 2506 instead of saying which ones are invariant. If you have no Front-Cover 2507 Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being 2508 LIST"; likewise for Back-Cover Texts. 3251 If you have Invariant Sections, Front-Cover Texts and Back-Cover 3252 Texts, replace the "with...Texts." line with this: 3253 3254 with the Invariant Sections being LIST THEIR TITLES, with 3255 the Front-Cover Texts being LIST, and with the Back-Cover Texts 3256 being LIST. 3257 3258 If you have Invariant Sections without Cover Texts, or some other 3259 combination of the three, merge those two alternatives to suit the 3260 situation. 2509 3261 2510 3262 If your document contains nontrivial examples of program code, we … … 2519 3271 ***************** 2520 3272 3273 [index] 2521 3274 * Menu: 2522 3275 2523 * # (comments), in commands: Command s.2524 * # (comments), in makefile: Makefile Contents. 3276 * # (comments), in commands: Command Syntax. (line 27) 3277 * # (comments), in makefile: Makefile Contents. (line 41) 2525 3278 * #include: Automatic Prerequisites. 2526 * $$@, support for: Automatic Variables. 2527 * $, in function call: Syntax of Functions. 2528 * $, in rules: Rule Syntax. 2529 * $, in variable name: Computed Names. 2530 * $, in variable reference: Reference. 2531 * %, in pattern rules: Pattern Intro. 2532 * %, quoting in patsubst: Text Functions. 2533 * %, quoting in static pattern: Static Usage. 2534 * %, quoting in vpath: Selective Search. 2535 * %, quoting with \ (backslash) <1>: Text Functions. 2536 * %, quoting with \ (backslash) <2>: Static Usage. 2537 * %, quoting with \ (backslash): Selective Search. 2538 * * (wildcard character): Wildcards. 3279 (line 16) 3280 * $, in function call: Syntax of Functions. (line 6) 3281 * $, in rules: Rule Syntax. (line 32) 3282 * $, in variable name: Computed Names. (line 6) 3283 * $, in variable reference: Reference. (line 6) 3284 * %, in pattern rules: Pattern Intro. (line 9) 3285 * %, quoting in patsubst: Text Functions. (line 26) 3286 * %, quoting in static pattern: Static Usage. (line 37) 3287 * %, quoting in vpath: Selective Search. (line 38) 3288 * %, quoting with \ (backslash) <1>: Text Functions. (line 26) 3289 * %, quoting with \ (backslash) <2>: Static Usage. (line 37) 3290 * %, quoting with \ (backslash): Selective Search. (line 38) 3291 * * (wildcard character): Wildcards. (line 6) 2539 3292 * +, and command execution: Instead of Execution. 2540 * +, and commands: MAKE Variable. 2541 * +, and define: Sequences. 2542 * +=: Appending. 2543 * +=, expansion: Reading Makefiles. 2544 * ,v (RCS file extension): Catalogue of Rules. 2545 * - (in commands): Errors. 2546 * -, and define: Sequences. 2547 * --always-make: Options Summary. 2548 * --assume-new <1>: Options Summary. 3293 (line 58) 3294 * +, and commands: MAKE Variable. (line 18) 3295 * +, and define: Sequences. (line 50) 3296 * +=: Appending. (line 6) 3297 * +=, expansion: Reading Makefiles. (line 33) 3298 * ,v (RCS file extension): Catalogue of Rules. (line 164) 3299 * - (in commands): Errors. (line 19) 3300 * -, and define: Sequences. (line 50) 3301 * --always-make: Options Summary. (line 15) 3302 * --assume-new <1>: Options Summary. (line 242) 2549 3303 * --assume-new: Instead of Execution. 2550 * --assume-new, and recursion: Options/Recursion. 2551 * --assume-old <1>: Options Summary. 3304 (line 33) 3305 * --assume-new, and recursion: Options/Recursion. (line 22) 3306 * --assume-old <1>: Options Summary. (line 147) 2552 3307 * --assume-old: Avoiding Compilation. 2553 * --assume-old, and recursion: Options/Recursion. 2554 * --debug: Options Summary. 2555 * --directory <1>: Options Summary. 2556 * --directory: Recursion. 2557 * --directory, and --print-directory: -w Option. 2558 * --directory, and recursion: Options/Recursion. 2559 * --dry-run <1>: Options Summary. 3308 (line 6) 3309 * --assume-old, and recursion: Options/Recursion. (line 22) 3310 * --check-symlink-times: Options Summary. (line 130) 3311 * --debug: Options Summary. (line 42) 3312 * --directory <1>: Options Summary. (line 26) 3313 * --directory: Recursion. (line 20) 3314 * --directory, and --print-directory: -w Option. (line 20) 3315 * --directory, and recursion: Options/Recursion. (line 22) 3316 * --dry-run <1>: Options Summary. (line 140) 2560 3317 * --dry-run <2>: Instead of Execution. 2561 * --dry-run: Echoing. 2562 * --environment-overrides: Options Summary. 2563 * --file <1>: Options Summary. 2564 * --file <2>: Makefile Arguments. 2565 * --file: Makefile Names. 2566 * --file, and recursion: Options/Recursion. 2567 * --help: Options Summary. 2568 * --ignore-errors <1>: Options Summary. 2569 * --ignore-errors: Errors. 2570 * --include-dir <1>: Options Summary. 2571 * --include-dir: Include. 2572 * --jobs <1>: Options Summary. 2573 * --jobs: Parallel. 2574 * --jobs, and recursion: Options/Recursion. 2575 * --just-print <1>: Options Summary. 3318 (line 14) 3319 * --dry-run: Echoing. (line 18) 3320 * --environment-overrides: Options Summary. (line 78) 3321 * --file <1>: Options Summary. (line 84) 3322 * --file <2>: Makefile Arguments. (line 6) 3323 * --file: Makefile Names. (line 23) 3324 * --file, and recursion: Options/Recursion. (line 22) 3325 * --help: Options Summary. (line 90) 3326 * --ignore-errors <1>: Options Summary. (line 94) 3327 * --ignore-errors: Errors. (line 30) 3328 * --include-dir <1>: Options Summary. (line 99) 3329 * --include-dir: Include. (line 52) 3330 * --jobs <1>: Options Summary. (line 106) 3331 * --jobs: Parallel. (line 6) 3332 * --jobs, and recursion: Options/Recursion. (line 25) 3333 * --just-print <1>: Options Summary. (line 139) 2576 3334 * --just-print <2>: Instead of Execution. 2577 * --just-print: Echoing. 2578 * --keep-going <1>: Options Summary. 2579 * --keep-going <2>: Testing. 2580 * --keep-going: Errors. 2581 * --load-average <1>: Options Summary. 2582 * --load-average: Parallel. 2583 * --makefile <1>: Options Summary. 2584 * --makefile <2>: Makefile Arguments. 2585 * --makefile: Makefile Names. 2586 * --max-load <1>: Options Summary. 2587 * --max-load: Parallel. 2588 * --new-file <1>: Options Summary. 3335 (line 14) 3336 * --just-print: Echoing. (line 18) 3337 * --keep-going <1>: Options Summary. (line 115) 3338 * --keep-going <2>: Testing. (line 16) 3339 * --keep-going: Errors. (line 47) 3340 * --load-average <1>: Options Summary. (line 122) 3341 * --load-average: Parallel. (line 57) 3342 * --makefile <1>: Options Summary. (line 85) 3343 * --makefile <2>: Makefile Arguments. (line 6) 3344 * --makefile: Makefile Names. (line 23) 3345 * --max-load <1>: Options Summary. (line 123) 3346 * --max-load: Parallel. (line 57) 3347 * --new-file <1>: Options Summary. (line 241) 2589 3348 * --new-file: Instead of Execution. 2590 * --new-file, and recursion: Options/Recursion. 2591 * --no-builtin-rules: Options Summary. 2592 * --no-builtin-variables: Options Summary. 2593 * --no-keep-going: Options Summary. 2594 * --no-print-directory <1>: Options Summary. 2595 * --no-print-directory: -w Option. 2596 * --old-file <1>: Options Summary. 3349 (line 33) 3350 * --new-file, and recursion: Options/Recursion. (line 22) 3351 * --no-builtin-rules: Options Summary. (line 175) 3352 * --no-builtin-variables: Options Summary. (line 188) 3353 * --no-keep-going: Options Summary. (line 203) 3354 * --no-print-directory <1>: Options Summary. (line 233) 3355 * --no-print-directory: -w Option. (line 20) 3356 * --old-file <1>: Options Summary. (line 146) 2597 3357 * --old-file: Avoiding Compilation. 2598 * --old-file, and recursion: Options/Recursion. 2599 * --print-data-base: Options Summary. 2600 * --print-directory: Options Summary. 2601 * --print-directory, and --directory: -w Option. 2602 * --print-directory, and recursion: -w Option. 2603 * --print-directory, disabling: -w Option. 2604 * --question <1>: Options Summary. 3358 (line 6) 3359 * --old-file, and recursion: Options/Recursion. (line 22) 3360 * --print-data-base: Options Summary. (line 155) 3361 * --print-directory: Options Summary. (line 225) 3362 * --print-directory, and --directory: -w Option. (line 20) 3363 * --print-directory, and recursion: -w Option. (line 20) 3364 * --print-directory, disabling: -w Option. (line 20) 3365 * --question <1>: Options Summary. (line 167) 2605 3366 * --question: Instead of Execution. 2606 * --quiet <1>: Options Summary. 2607 * --quiet: Echoing. 2608 * --recon <1>: Options Summary. 3367 (line 25) 3368 * --quiet <1>: Options Summary. (line 198) 3369 * --quiet: Echoing. (line 24) 3370 * --recon <1>: Options Summary. (line 141) 2609 3371 * --recon <2>: Instead of Execution. 2610 * --recon: Echoing. 2611 * --silent <1>: Options Summary. 2612 * --silent: Echoing. 2613 * --stop: Options Summary. 2614 * --touch <1>: Options Summary. 3372 (line 14) 3373 * --recon: Echoing. (line 18) 3374 * --silent <1>: Options Summary. (line 197) 3375 * --silent: Echoing. (line 24) 3376 * --stop: Options Summary. (line 204) 3377 * --touch <1>: Options Summary. (line 212) 2615 3378 * --touch: Instead of Execution. 2616 * --touch, and recursion: MAKE Variable. 2617 * --version: Options Summary. 2618 * --warn-undefined-variables: Options Summary. 2619 * --what-if <1>: Options Summary. 3379 (line 19) 3380 * --touch, and recursion: MAKE Variable. (line 34) 3381 * --version: Options Summary. (line 220) 3382 * --warn-undefined-variables: Options Summary. (line 251) 3383 * --what-if <1>: Options Summary. (line 240) 2620 3384 * --what-if: Instead of Execution. 2621 * -B: Options Summary. 2622 * -b: Options Summary. 2623 * -C <1>: Options Summary. 2624 * -C: Recursion. 2625 * -C, and -w: -w Option. 2626 * -C, and recursion: Options/Recursion. 2627 * -d: Options Summary. 2628 * -e: Options Summary. 3385 (line 33) 3386 * -B: Options Summary. (line 14) 3387 * -b: Options Summary. (line 9) 3388 * -C <1>: Options Summary. (line 25) 3389 * -C: Recursion. (line 20) 3390 * -C, and -w: -w Option. (line 20) 3391 * -C, and recursion: Options/Recursion. (line 22) 3392 * -d: Options Summary. (line 33) 3393 * -e: Options Summary. (line 77) 2629 3394 * -e (shell flag): Automatic Prerequisites. 2630 * -f <1>: Options Summary. 2631 * -f <2>: Makefile Arguments. 2632 * -f: Makefile Names. 2633 * -f, and recursion: Options/Recursion. 2634 * -h: Options Summary. 2635 * -I: Options Summary. 2636 * -i <1>: Options Summary. 2637 * -i: Errors. 2638 * -I: Include. 2639 * -j <1>: Options Summary. 2640 * -j: Parallel. 2641 * -j, and archive update: Archive Pitfalls. 2642 * -j, and recursion: Options/Recursion. 2643 * -k <1>: Options Summary. 2644 * -k <2>: Testing. 2645 * -k: Errors. 2646 * -l: Options Summary. 2647 * -l (library search): Libraries/Search. 2648 * -l (load average): Parallel. 2649 * -m: Options Summary. 3395 (line 66) 3396 * -f <1>: Options Summary. (line 83) 3397 * -f <2>: Makefile Arguments. (line 6) 3398 * -f: Makefile Names. (line 23) 3399 * -f, and recursion: Options/Recursion. (line 22) 3400 * -h: Options Summary. (line 89) 3401 * -I: Options Summary. (line 98) 3402 * -i <1>: Options Summary. (line 93) 3403 * -i: Errors. (line 30) 3404 * -I: Include. (line 52) 3405 * -j <1>: Options Summary. (line 105) 3406 * -j: Parallel. (line 6) 3407 * -j, and archive update: Archive Pitfalls. (line 6) 3408 * -j, and recursion: Options/Recursion. (line 25) 3409 * -k <1>: Options Summary. (line 114) 3410 * -k <2>: Testing. (line 16) 3411 * -k: Errors. (line 47) 3412 * -L: Options Summary. (line 129) 3413 * -l: Options Summary. (line 121) 3414 * -l (library search): Libraries/Search. (line 6) 3415 * -l (load average): Parallel. (line 57) 3416 * -m: Options Summary. (line 10) 2650 3417 * -M (to compiler): Automatic Prerequisites. 3418 (line 18) 2651 3419 * -MM (to GNU compiler): Automatic Prerequisites. 2652 * -n <1>: Options Summary. 3420 (line 68) 3421 * -n <1>: Options Summary. (line 138) 2653 3422 * -n <2>: Instead of Execution. 2654 * -n: Echoing. 2655 * -o <1>: Options Summary. 3423 (line 14) 3424 * -n: Echoing. (line 18) 3425 * -o <1>: Options Summary. (line 145) 2656 3426 * -o: Avoiding Compilation. 2657 * -o, and recursion: Options/Recursion. 2658 * -p: Options Summary. 2659 * -q <1>: Options Summary. 3427 (line 6) 3428 * -o, and recursion: Options/Recursion. (line 22) 3429 * -p: Options Summary. (line 154) 3430 * -q <1>: Options Summary. (line 166) 2660 3431 * -q: Instead of Execution. 2661 * -R: Options Summary. 2662 * -r: Options Summary. 2663 * -S: Options Summary. 2664 * -s <1>: Options Summary. 2665 * -s: Echoing. 2666 * -t <1>: Options Summary. 3432 (line 25) 3433 * -R: Options Summary. (line 187) 3434 * -r: Options Summary. (line 174) 3435 * -S: Options Summary. (line 202) 3436 * -s <1>: Options Summary. (line 196) 3437 * -s: Echoing. (line 24) 3438 * -t <1>: Options Summary. (line 211) 2667 3439 * -t: Instead of Execution. 2668 * -t, and recursion: MAKE Variable. 2669 * -v: Options Summary. 2670 * -W: Options Summary. 2671 * -w: Options Summary. 3440 (line 19) 3441 * -t, and recursion: MAKE Variable. (line 34) 3442 * -v: Options Summary. (line 219) 3443 * -W: Options Summary. (line 239) 3444 * -w: Options Summary. (line 224) 2672 3445 * -W: Instead of Execution. 2673 * -w, and -C: -w Option. 2674 * -w, and recursion: -w Option. 2675 * -W, and recursion: Options/Recursion. 2676 * -w, disabling: -w Option. 3446 (line 33) 3447 * -w, and -C: -w Option. (line 20) 3448 * -w, and recursion: -w Option. (line 20) 3449 * -W, and recursion: Options/Recursion. (line 22) 3450 * -w, disabling: -w Option. (line 20) 2677 3451 * .a (archives): Archive Suffix Rules. 2678 * .C: Catalogue of Rules. 2679 * .c: Catalogue of Rules. 2680 * .cc: Catalogue of Rules. 2681 * .ch: Catalogue of Rules. 3452 (line 6) 3453 * .C: Catalogue of Rules. (line 39) 3454 * .c: Catalogue of Rules. (line 35) 3455 * .cc: Catalogue of Rules. (line 39) 3456 * .ch: Catalogue of Rules. (line 151) 3457 * .cpp: Catalogue of Rules. (line 39) 2682 3458 * .d: Automatic Prerequisites. 2683 * .def: Catalogue of Rules. 2684 * .dvi: Catalogue of Rules. 2685 * .F: Catalogue of Rules. 2686 * .f: Catalogue of Rules. 2687 * .info: Catalogue of Rules. 2688 * .l: Catalogue of Rules. 2689 * .LIBPATTERNS, and link libraries: Libraries/Search. 2690 * .ln: Catalogue of Rules. 2691 * .mod: Catalogue of Rules. 2692 * .o: Catalogue of Rules. 2693 * .p: Catalogue of Rules. 2694 * .PRECIOUS intermediate files: Chained Rules. 2695 * .r: Catalogue of Rules. 2696 * .S: Catalogue of Rules. 2697 * .s: Catalogue of Rules. 2698 * .sh: Catalogue of Rules. 2699 * .sym: Catalogue of Rules. 2700 * .tex: Catalogue of Rules. 2701 * .texi: Catalogue of Rules. 2702 * .texinfo: Catalogue of Rules. 2703 * .txinfo: Catalogue of Rules. 2704 * .w: Catalogue of Rules. 2705 * .web: Catalogue of Rules. 2706 * .y: Catalogue of Rules. 2707 * :: rules (double-colon): Double-Colon. 2708 * := <1>: Setting. 2709 * :=: Flavors. 2710 * = <1>: Setting. 2711 * =: Flavors. 2712 * =, expansion: Reading Makefiles. 2713 * ? (wildcard character): Wildcards. 2714 * ?= <1>: Setting. 2715 * ?=: Flavors. 2716 * ?=, expansion: Reading Makefiles. 2717 * @ (in commands): Echoing. 2718 * @, and define: Sequences. 2719 * [...] (wildcard characters): Wildcards. 2720 * \ (backslash), for continuation lines: Simple Makefile. 2721 * \ (backslash), in commands: Execution. 2722 * \ (backslash), to quote % <1>: Text Functions. 2723 * \ (backslash), to quote % <2>: Static Usage. 2724 * \ (backslash), to quote %: Selective Search. 2725 * __.SYMDEF: Archive Symbols. 2726 * algorithm for directory search: Search Algorithm. 2727 * all (standard target): Goals. 2728 * appending to variables: Appending. 2729 * ar: Implicit Variables. 2730 * archive: Archives. 2731 * archive member targets: Archive Members. 2732 * archive symbol directory updating: Archive Symbols. 2733 * archive, and -j: Archive Pitfalls. 2734 * archive, and parallel execution: Archive Pitfalls. 3459 (line 81) 3460 * .def: Catalogue of Rules. (line 74) 3461 * .dvi: Catalogue of Rules. (line 151) 3462 * .F: Catalogue of Rules. (line 49) 3463 * .f: Catalogue of Rules. (line 49) 3464 * .info: Catalogue of Rules. (line 158) 3465 * .l: Catalogue of Rules. (line 124) 3466 * .LIBPATTERNS, and link libraries: Libraries/Search. (line 6) 3467 * .ln: Catalogue of Rules. (line 146) 3468 * .mod: Catalogue of Rules. (line 74) 3469 * .o: Catalogue of Rules. (line 35) 3470 * .p: Catalogue of Rules. (line 45) 3471 * .PRECIOUS intermediate files: Chained Rules. (line 56) 3472 * .r: Catalogue of Rules. (line 49) 3473 * .S: Catalogue of Rules. (line 82) 3474 * .s: Catalogue of Rules. (line 79) 3475 * .sh: Catalogue of Rules. (line 180) 3476 * .sym: Catalogue of Rules. (line 74) 3477 * .tex: Catalogue of Rules. (line 151) 3478 * .texi: Catalogue of Rules. (line 158) 3479 * .texinfo: Catalogue of Rules. (line 158) 3480 * .txinfo: Catalogue of Rules. (line 158) 3481 * .w: Catalogue of Rules. (line 151) 3482 * .web: Catalogue of Rules. (line 151) 3483 * .y: Catalogue of Rules. (line 120) 3484 * :: rules (double-colon): Double-Colon. (line 6) 3485 * := <1>: Setting. (line 6) 3486 * :=: Flavors. (line 56) 3487 * = <1>: Setting. (line 6) 3488 * =: Flavors. (line 10) 3489 * =, expansion: Reading Makefiles. (line 33) 3490 * ? (wildcard character): Wildcards. (line 6) 3491 * ?= <1>: Setting. (line 6) 3492 * ?=: Flavors. (line 129) 3493 * ?=, expansion: Reading Makefiles. (line 33) 3494 * @ (in commands): Echoing. (line 6) 3495 * @, and define: Sequences. (line 50) 3496 * [...] (wildcard characters): Wildcards. (line 6) 3497 * \ (backslash), for continuation lines: Simple Makefile. (line 40) 3498 * \ (backslash), in commands: Splitting Lines. (line 6) 3499 * \ (backslash), to quote % <1>: Text Functions. (line 26) 3500 * \ (backslash), to quote % <2>: Static Usage. (line 37) 3501 * \ (backslash), to quote %: Selective Search. (line 38) 3502 * __.SYMDEF: Archive Symbols. (line 6) 3503 * abspath: File Name Functions. (line 121) 3504 * algorithm for directory search: Search Algorithm. (line 6) 3505 * all (standard target): Goals. (line 72) 3506 * appending to variables: Appending. (line 6) 3507 * ar: Implicit Variables. (line 41) 3508 * archive: Archives. (line 6) 3509 * archive member targets: Archive Members. (line 6) 3510 * archive symbol directory updating: Archive Symbols. (line 6) 3511 * archive, and -j: Archive Pitfalls. (line 6) 3512 * archive, and parallel execution: Archive Pitfalls. (line 6) 2735 3513 * archive, suffix rule for: Archive Suffix Rules. 2736 * Arg list too long: Options/Recursion. 2737 * arguments of functions: Syntax of Functions. 2738 * as <1>: Implicit Variables. 2739 * as: Catalogue of Rules. 2740 * assembly, rule to compile: Catalogue of Rules. 3514 (line 6) 3515 * Arg list too long: Options/Recursion. (line 57) 3516 * arguments of functions: Syntax of Functions. (line 6) 3517 * as <1>: Implicit Variables. (line 44) 3518 * as: Catalogue of Rules. (line 79) 3519 * assembly, rule to compile: Catalogue of Rules. (line 79) 2741 3520 * automatic generation of prerequisites <1>: Automatic Prerequisites. 2742 * automatic generation of prerequisites: Include. 2743 * automatic variables: Automatic Variables. 2744 * automatic variables in prerequisites: Automatic Variables. 2745 * backquotes: Shell Function. 2746 * backslash (\), for continuation lines: Simple Makefile. 2747 * backslash (\), in commands: Execution. 2748 * backslash (\), to quote % <1>: Text Functions. 2749 * backslash (\), to quote % <2>: Static Usage. 2750 * backslash (\), to quote %: Selective Search. 3521 (line 6) 3522 * automatic generation of prerequisites: Include. (line 50) 3523 * automatic variables: Automatic Variables. (line 6) 3524 * automatic variables in prerequisites: Automatic Variables. (line 17) 3525 * backquotes: Shell Function. (line 6) 3526 * backslash (\), for continuation lines: Simple Makefile. (line 40) 3527 * backslash (\), in commands: Splitting Lines. (line 6) 3528 * backslash (\), to quote % <1>: Text Functions. (line 26) 3529 * backslash (\), to quote % <2>: Static Usage. (line 37) 3530 * backslash (\), to quote %: Selective Search. (line 38) 2751 3531 * backslashes in pathnames and wildcard expansion: Wildcard Pitfall. 2752 * basename: File Name Functions. 3532 (line 31) 3533 * basename: File Name Functions. (line 57) 2753 3534 * binary packages: Install Command Categories. 2754 * broken pipe: Parallel. 2755 * bugs, reporting: Bugs. 2756 * built-in special targets: Special Targets. 2757 * C++, rule to compile: Catalogue of Rules. 2758 * C, rule to compile: Catalogue of Rules. 2759 * cc <1>: Implicit Variables. 2760 * cc: Catalogue of Rules. 2761 * cd (shell command) <1>: MAKE Variable. 2762 * cd (shell command): Execution. 2763 * chains of rules: Chained Rules. 2764 * check (standard target): Goals. 2765 * clean (standard target): Goals. 2766 * clean target <1>: Cleanup. 2767 * clean target: Simple Makefile. 2768 * cleaning up: Cleanup. 2769 * clobber (standard target): Goals. 2770 * co <1>: Implicit Variables. 2771 * co: Catalogue of Rules. 3535 (line 80) 3536 * broken pipe: Parallel. (line 30) 3537 * bugs, reporting: Bugs. (line 6) 3538 * built-in special targets: Special Targets. (line 6) 3539 * C++, rule to compile: Catalogue of Rules. (line 39) 3540 * C, rule to compile: Catalogue of Rules. (line 35) 3541 * cc <1>: Implicit Variables. (line 47) 3542 * cc: Catalogue of Rules. (line 35) 3543 * cd (shell command) <1>: MAKE Variable. (line 16) 3544 * cd (shell command): Execution. (line 10) 3545 * chains of rules: Chained Rules. (line 6) 3546 * check (standard target): Goals. (line 114) 3547 * clean (standard target): Goals. (line 75) 3548 * clean target <1>: Cleanup. (line 11) 3549 * clean target: Simple Makefile. (line 83) 3550 * cleaning up: Cleanup. (line 6) 3551 * clobber (standard target): Goals. (line 86) 3552 * co <1>: Implicit Variables. (line 56) 3553 * co: Catalogue of Rules. (line 164) 2772 3554 * combining rules by prerequisite: Combine By Prerequisite. 3555 (line 6) 2773 3556 * command line variable definitions, and recursion: Options/Recursion. 2774 * command line variables: Overriding. 2775 * commands: Rule Syntax. 2776 * commands, backslash (\) in: Execution. 2777 * commands, comments in: Commands. 2778 * commands, echoing: Echoing. 2779 * commands, empty: Empty Commands. 2780 * commands, errors in: Errors. 2781 * commands, execution: Execution. 2782 * commands, execution in parallel: Parallel. 2783 * commands, expansion: Shell Function. 2784 * commands, how to write: Commands. 3557 (line 17) 3558 * command line variables: Overriding. (line 6) 3559 * command syntax: Command Syntax. (line 6) 3560 * commands: Rule Syntax. (line 26) 3561 * commands setting shell variables: Execution. (line 10) 3562 * commands, backslash (\) in: Splitting Lines. (line 6) 3563 * commands, comments in: Command Syntax. (line 27) 3564 * commands, echoing: Echoing. (line 6) 3565 * commands, empty: Empty Commands. (line 6) 3566 * commands, errors in: Errors. (line 6) 3567 * commands, execution: Execution. (line 6) 3568 * commands, execution in parallel: Parallel. (line 6) 3569 * commands, expansion: Shell Function. (line 6) 3570 * commands, how to write: Commands. (line 6) 2785 3571 * commands, instead of executing: Instead of Execution. 2786 * commands, introduction to: Rule Introduction. 2787 * commands, quoting newlines in: Execution. 2788 * commands, sequences of: Sequences. 2789 * comments, in commands: Commands. 2790 * comments, in makefile: Makefile Contents. 2791 * compatibility: Features. 2792 * compatibility in exporting: Variables/Recursion. 2793 * compilation, testing: Testing. 2794 * computed variable name: Computed Names. 2795 * conditional expansion: If Function. 2796 * conditional variable assignment: Flavors. 2797 * conditionals: Conditionals. 2798 * continuation lines: Simple Makefile. 3572 (line 6) 3573 * commands, introduction to: Rule Introduction. (line 8) 3574 * commands, quoting newlines in: Splitting Lines. (line 6) 3575 * commands, sequences of: Sequences. (line 6) 3576 * commands, splitting: Splitting Lines. (line 6) 3577 * commands, using variables in: Variables in Commands. 3578 (line 6) 3579 * comments, in commands: Command Syntax. (line 27) 3580 * comments, in makefile: Makefile Contents. (line 41) 3581 * compatibility: Features. (line 6) 3582 * compatibility in exporting: Variables/Recursion. (line 105) 3583 * compilation, testing: Testing. (line 6) 3584 * computed variable name: Computed Names. (line 6) 3585 * conditional expansion: Conditional Functions. 3586 (line 6) 3587 * conditional variable assignment: Flavors. (line 129) 3588 * conditionals: Conditionals. (line 6) 3589 * continuation lines: Simple Makefile. (line 40) 2799 3590 * controlling make: Make Control Functions. 3591 (line 6) 2800 3592 * conventions for makefiles: Makefile Conventions. 2801 * ctangle <1>: Implicit Variables. 2802 * ctangle: Catalogue of Rules. 2803 * cweave <1>: Implicit Variables. 2804 * cweave: Catalogue of Rules. 2805 * data base of make rules: Options Summary. 2806 * deducing commands (implicit rules): make Deduces. 2807 * default directories for included makefiles: Include. 2808 * default goal <1>: Rules. 2809 * default goal: How Make Works. 2810 * default makefile name: Makefile Names. 2811 * default rules, last-resort: Last Resort. 2812 * define, expansion: Reading Makefiles. 2813 * defining variables verbatim: Defining. 2814 * deletion of target files <1>: Interrupts. 2815 * deletion of target files: Errors. 2816 * directive: Makefile Contents. 2817 * directories, printing them: -w Option. 2818 * directories, updating archive symbol: Archive Symbols. 2819 * directory part: File Name Functions. 2820 * directory search (VPATH): Directory Search. 3593 (line 6) 3594 * ctangle <1>: Implicit Variables. (line 107) 3595 * ctangle: Catalogue of Rules. (line 151) 3596 * cweave <1>: Implicit Variables. (line 101) 3597 * cweave: Catalogue of Rules. (line 151) 3598 * data base of make rules: Options Summary. (line 155) 3599 * deducing commands (implicit rules): make Deduces. (line 6) 3600 * default directories for included makefiles: Include. (line 52) 3601 * default goal <1>: Rules. (line 11) 3602 * default goal: How Make Works. (line 11) 3603 * default makefile name: Makefile Names. (line 6) 3604 * default rules, last-resort: Last Resort. (line 6) 3605 * define, expansion: Reading Makefiles. (line 33) 3606 * defining variables verbatim: Defining. (line 6) 3607 * deletion of target files <1>: Interrupts. (line 6) 3608 * deletion of target files: Errors. (line 64) 3609 * directive: Makefile Contents. (line 28) 3610 * directories, printing them: -w Option. (line 6) 3611 * directories, updating archive symbol: Archive Symbols. (line 6) 3612 * directory part: File Name Functions. (line 17) 3613 * directory search (VPATH): Directory Search. (line 6) 2821 3614 * directory search (VPATH), and implicit rules: Implicit/Search. 3615 (line 6) 2822 3616 * directory search (VPATH), and link libraries: Libraries/Search. 3617 (line 6) 2823 3618 * directory search (VPATH), and shell commands: Commands/Search. 2824 * directory search algorithm: Search Algorithm. 2825 * directory search, traditional (GPATH): Search Algorithm. 2826 * dist (standard target): Goals. 2827 * distclean (standard target): Goals. 2828 * dollar sign ($), in function call: Syntax of Functions. 2829 * dollar sign ($), in rules: Rule Syntax. 2830 * dollar sign ($), in variable name: Computed Names. 2831 * dollar sign ($), in variable reference: Reference. 2832 * double-colon rules: Double-Colon. 2833 * duplicate words, removing: Text Functions. 2834 * E2BIG: Options/Recursion. 2835 * echoing of commands: Echoing. 2836 * editor: Introduction. 2837 * Emacs (M-x compile): Errors. 2838 * empty commands: Empty Commands. 2839 * empty targets: Empty Targets. 2840 * environment: Environment. 2841 * environment, and recursion: Variables/Recursion. 2842 * environment, SHELL in: Execution. 3619 (line 6) 3620 * directory search algorithm: Search Algorithm. (line 6) 3621 * directory search, traditional (GPATH): Search Algorithm. (line 42) 3622 * dist (standard target): Goals. (line 106) 3623 * distclean (standard target): Goals. (line 84) 3624 * dollar sign ($), in function call: Syntax of Functions. (line 6) 3625 * dollar sign ($), in rules: Rule Syntax. (line 32) 3626 * dollar sign ($), in variable name: Computed Names. (line 6) 3627 * dollar sign ($), in variable reference: Reference. (line 6) 3628 * DOS, choosing a shell in: Choosing the Shell. (line 36) 3629 * double-colon rules: Double-Colon. (line 6) 3630 * duplicate words, removing: Text Functions. (line 155) 3631 * E2BIG: Options/Recursion. (line 57) 3632 * echoing of commands: Echoing. (line 6) 3633 * editor: Introduction. (line 22) 3634 * Emacs (M-x compile): Errors. (line 62) 3635 * empty commands: Empty Commands. (line 6) 3636 * empty targets: Empty Targets. (line 6) 3637 * environment: Environment. (line 6) 3638 * environment, and recursion: Variables/Recursion. (line 6) 3639 * environment, SHELL in: Choosing the Shell. (line 10) 2843 3640 * error, stopping on: Make Control Functions. 2844 * errors (in commands): Errors. 2845 * errors with wildcards: Wildcard Pitfall. 2846 * evaluating makefile syntax: Eval Function. 2847 * execution, in parallel: Parallel. 3641 (line 11) 3642 * errors (in commands): Errors. (line 6) 3643 * errors with wildcards: Wildcard Pitfall. (line 6) 3644 * evaluating makefile syntax: Eval Function. (line 6) 3645 * execution, in parallel: Parallel. (line 6) 2848 3646 * execution, instead of: Instead of Execution. 2849 * execution, of commands: Execution. 2850 * exit status (errors): Errors. 2851 * explicit rule, definition of: Makefile Contents. 2852 * explicit rule, expansion: Reading Makefiles. 2853 * exporting variables: Variables/Recursion. 2854 * f77 <1>: Implicit Variables. 2855 * f77: Catalogue of Rules. 3647 (line 6) 3648 * execution, of commands: Execution. (line 6) 3649 * exit status (errors): Errors. (line 6) 3650 * exit status of make: Running. (line 18) 3651 * expansion, secondary: Secondary Expansion. (line 6) 3652 * explicit rule, definition of: Makefile Contents. (line 10) 3653 * explicit rule, expansion: Reading Makefiles. (line 62) 3654 * explicit rules, secondary expansion of: Secondary Expansion. 3655 (line 106) 3656 * exporting variables: Variables/Recursion. (line 6) 3657 * f77 <1>: Implicit Variables. (line 64) 3658 * f77: Catalogue of Rules. (line 49) 2856 3659 * FDL, GNU Free Documentation License: GNU Free Documentation License. 2857 * features of GNU make: Features. 2858 * features, missing: Missing. 2859 * file name functions: File Name Functions. 2860 * file name of makefile: Makefile Names. 2861 * file name of makefile, how to specify: Makefile Names. 2862 * file name prefix, adding: File Name Functions. 2863 * file name suffix: File Name Functions. 2864 * file name suffix, adding: File Name Functions. 2865 * file name with wildcards: Wildcards. 2866 * file name, basename of: File Name Functions. 2867 * file name, directory part: File Name Functions. 2868 * file name, nondirectory part: File Name Functions. 3660 (line 6) 3661 * features of GNU make: Features. (line 6) 3662 * features, missing: Missing. (line 6) 3663 * file name functions: File Name Functions. (line 6) 3664 * file name of makefile: Makefile Names. (line 6) 3665 * file name of makefile, how to specify: Makefile Names. (line 30) 3666 * file name prefix, adding: File Name Functions. (line 79) 3667 * file name suffix: File Name Functions. (line 43) 3668 * file name suffix, adding: File Name Functions. (line 68) 3669 * file name with wildcards: Wildcards. (line 6) 3670 * file name, abspath of: File Name Functions. (line 121) 3671 * file name, basename of: File Name Functions. (line 57) 3672 * file name, directory part: File Name Functions. (line 17) 3673 * file name, nondirectory part: File Name Functions. (line 27) 3674 * file name, realpath of: File Name Functions. (line 114) 2869 3675 * files, assuming new: Instead of Execution. 3676 (line 33) 2870 3677 * files, assuming old: Avoiding Compilation. 3678 (line 6) 2871 3679 * files, avoiding recompilation of: Avoiding Compilation. 2872 * files, intermediate: Chained Rules. 2873 * filtering out words: Text Functions. 2874 * filtering words: Text Functions. 2875 * finding strings: Text Functions. 2876 * flags: Options Summary. 2877 * flags for compilers: Implicit Variables. 2878 * flavors of variables: Flavors. 2879 * FORCE: Force Targets. 2880 * force targets: Force Targets. 2881 * Fortran, rule to compile: Catalogue of Rules. 2882 * functions: Functions. 3680 (line 6) 3681 * files, intermediate: Chained Rules. (line 16) 3682 * filtering out words: Text Functions. (line 132) 3683 * filtering words: Text Functions. (line 114) 3684 * finding strings: Text Functions. (line 103) 3685 * flags: Options Summary. (line 6) 3686 * flags for compilers: Implicit Variables. (line 6) 3687 * flavor of variable: Flavor Function. (line 6) 3688 * flavors of variables: Flavors. (line 6) 3689 * FORCE: Force Targets. (line 6) 3690 * force targets: Force Targets. (line 6) 3691 * Fortran, rule to compile: Catalogue of Rules. (line 49) 3692 * functions: Functions. (line 6) 2883 3693 * functions, for controlling make: Make Control Functions. 2884 * functions, for file names: File Name Functions. 2885 * functions, for text: Text Functions. 2886 * functions, syntax of: Syntax of Functions. 2887 * functions, user defined: Call Function. 2888 * g++ <1>: Implicit Variables. 2889 * g++: Catalogue of Rules. 2890 * gcc: Catalogue of Rules. 3694 (line 6) 3695 * functions, for file names: File Name Functions. (line 6) 3696 * functions, for text: Text Functions. (line 6) 3697 * functions, syntax of: Syntax of Functions. (line 6) 3698 * functions, user defined: Call Function. (line 6) 3699 * g++ <1>: Implicit Variables. (line 53) 3700 * g++: Catalogue of Rules. (line 39) 3701 * gcc: Catalogue of Rules. (line 35) 2891 3702 * generating prerequisites automatically <1>: Automatic Prerequisites. 2892 * generating prerequisites automatically: Include. 2893 * get <1>: Implicit Variables. 2894 * get: Catalogue of Rules. 2895 * globbing (wildcards): Wildcards. 2896 * goal: How Make Works. 2897 * goal, default <1>: Rules. 2898 * goal, default: How Make Works. 2899 * goal, how to specify: Goals. 2900 * home directory: Wildcards. 2901 * IEEE Standard 1003.2: Overview. 2902 * ifdef, expansion: Reading Makefiles. 2903 * ifeq, expansion: Reading Makefiles. 2904 * ifndef, expansion: Reading Makefiles. 2905 * ifneq, expansion: Reading Makefiles. 2906 * implicit rule: Implicit Rules. 2907 * implicit rule, and directory search: Implicit/Search. 2908 * implicit rule, and VPATH: Implicit/Search. 2909 * implicit rule, definition of: Makefile Contents. 2910 * implicit rule, expansion: Reading Makefiles. 2911 * implicit rule, how to use: Using Implicit. 2912 * implicit rule, introduction to: make Deduces. 2913 * implicit rule, predefined: Catalogue of Rules. 3703 (line 6) 3704 * generating prerequisites automatically: Include. (line 50) 3705 * get <1>: Implicit Variables. (line 67) 3706 * get: Catalogue of Rules. (line 173) 3707 * globbing (wildcards): Wildcards. (line 6) 3708 * goal: How Make Works. (line 11) 3709 * goal, default <1>: Rules. (line 11) 3710 * goal, default: How Make Works. (line 11) 3711 * goal, how to specify: Goals. (line 6) 3712 * home directory: Wildcards. (line 11) 3713 * IEEE Standard 1003.2: Overview. (line 13) 3714 * ifdef, expansion: Reading Makefiles. (line 51) 3715 * ifeq, expansion: Reading Makefiles. (line 51) 3716 * ifndef, expansion: Reading Makefiles. (line 51) 3717 * ifneq, expansion: Reading Makefiles. (line 51) 3718 * implicit rule: Implicit Rules. (line 6) 3719 * implicit rule, and directory search: Implicit/Search. (line 6) 3720 * implicit rule, and VPATH: Implicit/Search. (line 6) 3721 * implicit rule, definition of: Makefile Contents. (line 16) 3722 * implicit rule, expansion: Reading Makefiles. (line 62) 3723 * implicit rule, how to use: Using Implicit. (line 6) 3724 * implicit rule, introduction to: make Deduces. (line 6) 3725 * implicit rule, predefined: Catalogue of Rules. (line 6) 2914 3726 * implicit rule, search algorithm: Implicit Rule Search. 2915 * included makefiles, default directories: Include. 3727 (line 6) 3728 * implicit rules, secondary expansion of: Secondary Expansion. 3729 (line 146) 3730 * included makefiles, default directories: Include. (line 52) 2916 3731 * including (MAKEFILE_LIST variable): MAKEFILE_LIST Variable. 2917 * including (MAKEFILES variable): MAKEFILES Variable. 2918 * including other makefiles: Include. 2919 * incompatibilities: Missing. 2920 * Info, rule to format: Catalogue of Rules. 2921 * install (standard target): Goals. 2922 * intermediate files: Chained Rules. 2923 * intermediate files, preserving: Chained Rules. 2924 * intermediate targets, explicit: Special Targets. 2925 * interrupt: Interrupts. 2926 * job slots: Parallel. 2927 * job slots, and recursion: Options/Recursion. 2928 * jobs, limiting based on load: Parallel. 2929 * joining lists of words: File Name Functions. 2930 * killing (interruption): Interrupts. 2931 * last-resort default rules: Last Resort. 2932 * ld: Catalogue of Rules. 2933 * lex <1>: Implicit Variables. 2934 * lex: Catalogue of Rules. 2935 * Lex, rule to run: Catalogue of Rules. 2936 * libraries for linking, directory search: Libraries/Search. 3732 (line 6) 3733 * including (MAKEFILES variable): MAKEFILES Variable. (line 6) 3734 * including other makefiles: Include. (line 6) 3735 * incompatibilities: Missing. (line 6) 3736 * Info, rule to format: Catalogue of Rules. (line 158) 3737 * install (standard target): Goals. (line 92) 3738 * intermediate files: Chained Rules. (line 16) 3739 * intermediate files, preserving: Chained Rules. (line 46) 3740 * intermediate targets, explicit: Special Targets. (line 44) 3741 * interrupt: Interrupts. (line 6) 3742 * job slots: Parallel. (line 6) 3743 * job slots, and recursion: Options/Recursion. (line 25) 3744 * jobs, limiting based on load: Parallel. (line 57) 3745 * joining lists of words: File Name Functions. (line 90) 3746 * killing (interruption): Interrupts. (line 6) 3747 * last-resort default rules: Last Resort. (line 6) 3748 * ld: Catalogue of Rules. (line 86) 3749 * lex <1>: Implicit Variables. (line 71) 3750 * lex: Catalogue of Rules. (line 124) 3751 * Lex, rule to run: Catalogue of Rules. (line 124) 3752 * libraries for linking, directory search: Libraries/Search. (line 6) 2937 3753 * library archive, suffix rule for: Archive Suffix Rules. 2938 * limiting jobs based on load: Parallel. 2939 * link libraries, and directory search: Libraries/Search. 2940 * link libraries, patterns matching: Libraries/Search. 2941 * linking, predefined rule for: Catalogue of Rules. 2942 * lint: Catalogue of Rules. 2943 * lint, rule to run: Catalogue of Rules. 2944 * list of all prerequisites: Automatic Variables. 2945 * list of changed prerequisites: Automatic Variables. 2946 * load average: Parallel. 2947 * loops in variable expansion: Flavors. 2948 * lpr (shell command) <1>: Empty Targets. 2949 * lpr (shell command): Wildcard Examples. 2950 * m2c: Catalogue of Rules. 2951 * macro: Using Variables. 3754 (line 6) 3755 * limiting jobs based on load: Parallel. (line 57) 3756 * link libraries, and directory search: Libraries/Search. (line 6) 3757 * link libraries, patterns matching: Libraries/Search. (line 6) 3758 * linking, predefined rule for: Catalogue of Rules. (line 86) 3759 * lint <1>: Implicit Variables. (line 78) 3760 * lint: Catalogue of Rules. (line 146) 3761 * lint, rule to run: Catalogue of Rules. (line 146) 3762 * list of all prerequisites: Automatic Variables. (line 61) 3763 * list of changed prerequisites: Automatic Variables. (line 51) 3764 * load average: Parallel. (line 57) 3765 * loops in variable expansion: Flavors. (line 44) 3766 * lpr (shell command) <1>: Empty Targets. (line 25) 3767 * lpr (shell command): Wildcard Examples. (line 21) 3768 * m2c <1>: Implicit Variables. (line 81) 3769 * m2c: Catalogue of Rules. (line 74) 3770 * macro: Using Variables. (line 10) 2952 3771 * make depend: Automatic Prerequisites. 2953 * MAKECMDGOALS: Goals. 2954 * makefile: Introduction. 2955 * makefile name: Makefile Names. 2956 * makefile name, how to specify: Makefile Names. 2957 * makefile rule parts: Rule Introduction. 2958 * makefile syntax, evaluating: Eval Function. 2959 * makefile, and MAKEFILES variable: MAKEFILES Variable. 3772 (line 37) 3773 * makefile: Introduction. (line 7) 3774 * makefile name: Makefile Names. (line 6) 3775 * makefile name, how to specify: Makefile Names. (line 30) 3776 * makefile rule parts: Rule Introduction. (line 6) 3777 * makefile syntax, evaluating: Eval Function. (line 6) 3778 * makefile, and MAKEFILES variable: MAKEFILES Variable. (line 6) 2960 3779 * makefile, conventions for: Makefile Conventions. 2961 * makefile, how make processes: How Make Works. 2962 * makefile, how to write: Makefiles. 2963 * makefile, including: Include. 3780 (line 6) 3781 * makefile, how make processes: How Make Works. (line 6) 3782 * makefile, how to write: Makefiles. (line 6) 3783 * makefile, including: Include. (line 6) 2964 3784 * makefile, overriding: Overriding Makefiles. 2965 * makefile, parsing: Reading Makefiles. 2966 * makefile, remaking of: Remaking Makefiles. 2967 * makefile, simple: Simple Makefile. 3785 (line 6) 3786 * makefile, parsing: Reading Makefiles. (line 6) 3787 * makefile, remaking of: Remaking Makefiles. (line 6) 3788 * makefile, simple: Simple Makefile. (line 6) 2968 3789 * makefiles, and MAKEFILE_LIST variable: MAKEFILE_LIST Variable. 2969 * makefiles, and special variables: Special Variables. 2970 * makeinfo <1>: Implicit Variables. 2971 * makeinfo: Catalogue of Rules. 3790 (line 6) 3791 * makefiles, and special variables: Special Variables. (line 6) 3792 * makeinfo <1>: Implicit Variables. (line 88) 3793 * makeinfo: Catalogue of Rules. (line 158) 2972 3794 * match-anything rule: Match-Anything Rules. 3795 (line 6) 2973 3796 * match-anything rule, used to override: Overriding Makefiles. 2974 * missing features: Missing. 2975 * mistakes with wildcards: Wildcard Pitfall. 2976 * modified variable reference: Substitution Refs. 2977 * Modula-2, rule to compile: Catalogue of Rules. 2978 * mostlyclean (standard target): Goals. 2979 * multiple rules for one target: Multiple Rules. 2980 * multiple rules for one target (::): Double-Colon. 2981 * multiple targets: Multiple Targets. 2982 * multiple targets, in pattern rule: Pattern Intro. 2983 * name of makefile: Makefile Names. 2984 * name of makefile, how to specify: Makefile Names. 2985 * nested variable reference: Computed Names. 2986 * newline, quoting, in commands: Execution. 2987 * newline, quoting, in makefile: Simple Makefile. 2988 * nondirectory part: File Name Functions. 2989 * normal prerequisites: Prerequisite Types. 2990 * OBJ: Variables Simplify. 2991 * obj: Variables Simplify. 2992 * OBJECTS: Variables Simplify. 2993 * objects: Variables Simplify. 2994 * OBJS: Variables Simplify. 2995 * objs: Variables Simplify. 2996 * old-fashioned suffix rules: Suffix Rules. 2997 * options: Options Summary. 2998 * options, and recursion: Options/Recursion. 2999 * options, setting from environment: Options/Recursion. 3000 * options, setting in makefiles: Options/Recursion. 3001 * order of pattern rules: Pattern Intro. 3002 * order-only prerequisites: Prerequisite Types. 3003 * origin of variable: Origin Function. 3797 (line 12) 3798 * missing features: Missing. (line 6) 3799 * mistakes with wildcards: Wildcard Pitfall. (line 6) 3800 * modified variable reference: Substitution Refs. (line 6) 3801 * Modula-2, rule to compile: Catalogue of Rules. (line 74) 3802 * mostlyclean (standard target): Goals. (line 78) 3803 * multiple rules for one target: Multiple Rules. (line 6) 3804 * multiple rules for one target (::): Double-Colon. (line 6) 3805 * multiple targets: Multiple Targets. (line 6) 3806 * multiple targets, in pattern rule: Pattern Intro. (line 49) 3807 * name of makefile: Makefile Names. (line 6) 3808 * name of makefile, how to specify: Makefile Names. (line 30) 3809 * nested variable reference: Computed Names. (line 6) 3810 * newline, quoting, in commands: Splitting Lines. (line 6) 3811 * newline, quoting, in makefile: Simple Makefile. (line 40) 3812 * nondirectory part: File Name Functions. (line 27) 3813 * normal prerequisites: Prerequisite Types. (line 6) 3814 * OBJ: Variables Simplify. (line 20) 3815 * obj: Variables Simplify. (line 20) 3816 * OBJECTS: Variables Simplify. (line 20) 3817 * objects: Variables Simplify. (line 14) 3818 * OBJS: Variables Simplify. (line 20) 3819 * objs: Variables Simplify. (line 20) 3820 * old-fashioned suffix rules: Suffix Rules. (line 6) 3821 * options: Options Summary. (line 6) 3822 * options, and recursion: Options/Recursion. (line 6) 3823 * options, setting from environment: Options/Recursion. (line 81) 3824 * options, setting in makefiles: Options/Recursion. (line 81) 3825 * order of pattern rules: Pattern Intro. (line 57) 3826 * order-only prerequisites: Prerequisite Types. (line 6) 3827 * origin of variable: Origin Function. (line 6) 3004 3828 * overriding makefiles: Overriding Makefiles. 3005 * overriding variables with arguments: Overriding. 3006 * overriding with override: Override Directive. 3007 * parallel execution: Parallel. 3008 * parallel execution, and archive update: Archive Pitfalls. 3009 * parallel execution, overriding: Special Targets. 3010 * parts of makefile rule: Rule Introduction. 3011 * Pascal, rule to compile: Catalogue of Rules. 3012 * pattern rule: Pattern Intro. 3013 * pattern rule, expansion: Reading Makefiles. 3014 * pattern rules, order of: Pattern Intro. 3015 * pattern rules, static (not implicit): Static Pattern. 3016 * pattern rules, static, syntax of: Static Usage. 3017 * pattern-specific variables: Pattern-specific. 3018 * pc <1>: Implicit Variables. 3019 * pc: Catalogue of Rules. 3020 * phony targets: Phony Targets. 3021 * pitfalls of wildcards: Wildcard Pitfall. 3022 * portability: Features. 3023 * POSIX: Overview. 3024 * POSIX.2: Options/Recursion. 3829 (line 6) 3830 * overriding variables with arguments: Overriding. (line 6) 3831 * overriding with override: Override Directive. (line 6) 3832 * parallel execution: Parallel. (line 6) 3833 * parallel execution, and archive update: Archive Pitfalls. (line 6) 3834 * parallel execution, overriding: Special Targets. (line 135) 3835 * parts of makefile rule: Rule Introduction. (line 6) 3836 * Pascal, rule to compile: Catalogue of Rules. (line 45) 3837 * pattern rule: Pattern Intro. (line 6) 3838 * pattern rule, expansion: Reading Makefiles. (line 62) 3839 * pattern rules, order of: Pattern Intro. (line 57) 3840 * pattern rules, static (not implicit): Static Pattern. (line 6) 3841 * pattern rules, static, syntax of: Static Usage. (line 6) 3842 * pattern-specific variables: Pattern-specific. (line 6) 3843 * pc <1>: Implicit Variables. (line 84) 3844 * pc: Catalogue of Rules. (line 45) 3845 * phony targets: Phony Targets. (line 6) 3846 * pitfalls of wildcards: Wildcard Pitfall. (line 6) 3847 * portability: Features. (line 6) 3848 * POSIX: Overview. (line 13) 3849 * POSIX.2: Options/Recursion. (line 60) 3025 3850 * post-installation commands: Install Command Categories. 3851 (line 6) 3026 3852 * pre-installation commands: Install Command Categories. 3027 * precious targets: Special Targets. 3028 * predefined rules and variables, printing: Options Summary. 3029 * prefix, adding: File Name Functions. 3030 * prerequisite: Rules. 3031 * prerequisite pattern, implicit: Pattern Intro. 3032 * prerequisite pattern, static (not implicit): Static Usage. 3033 * prerequisite types: Prerequisite Types. 3034 * prerequisite, expansion: Reading Makefiles. 3035 * prerequisites: Rule Syntax. 3853 (line 6) 3854 * precious targets: Special Targets. (line 29) 3855 * predefined rules and variables, printing: Options Summary. (line 155) 3856 * prefix, adding: File Name Functions. (line 79) 3857 * prerequisite: Rules. (line 6) 3858 * prerequisite pattern, implicit: Pattern Intro. (line 22) 3859 * prerequisite pattern, static (not implicit): Static Usage. (line 30) 3860 * prerequisite types: Prerequisite Types. (line 6) 3861 * prerequisite, expansion: Reading Makefiles. (line 62) 3862 * prerequisites: Rule Syntax. (line 46) 3036 3863 * prerequisites, and automatic variables: Automatic Variables. 3864 (line 17) 3037 3865 * prerequisites, automatic generation <1>: Automatic Prerequisites. 3038 * prerequisites, automatic generation: Include. 3039 * prerequisites, introduction to: Rule Introduction. 3040 * prerequisites, list of all: Automatic Variables. 3041 * prerequisites, list of changed: Automatic Variables. 3042 * prerequisites, normal: Prerequisite Types. 3043 * prerequisites, order-only: Prerequisite Types. 3044 * prerequisites, varying (static pattern): Static Pattern. 3045 * preserving intermediate files: Chained Rules. 3046 * preserving with .PRECIOUS <1>: Chained Rules. 3047 * preserving with .PRECIOUS: Special Targets. 3048 * preserving with .SECONDARY: Special Targets. 3049 * print (standard target): Goals. 3050 * print target <1>: Empty Targets. 3051 * print target: Wildcard Examples. 3052 * printing directories: -w Option. 3053 * printing of commands: Echoing. 3866 (line 6) 3867 * prerequisites, automatic generation: Include. (line 50) 3868 * prerequisites, introduction to: Rule Introduction. (line 8) 3869 * prerequisites, list of all: Automatic Variables. (line 61) 3870 * prerequisites, list of changed: Automatic Variables. (line 51) 3871 * prerequisites, normal: Prerequisite Types. (line 6) 3872 * prerequisites, order-only: Prerequisite Types. (line 6) 3873 * prerequisites, varying (static pattern): Static Pattern. (line 6) 3874 * preserving intermediate files: Chained Rules. (line 46) 3875 * preserving with .PRECIOUS <1>: Chained Rules. (line 56) 3876 * preserving with .PRECIOUS: Special Targets. (line 29) 3877 * preserving with .SECONDARY: Special Targets. (line 49) 3878 * print (standard target): Goals. (line 97) 3879 * print target <1>: Empty Targets. (line 25) 3880 * print target: Wildcard Examples. (line 21) 3881 * printing directories: -w Option. (line 6) 3882 * printing messages: Make Control Functions. 3883 (line 43) 3884 * printing of commands: Echoing. (line 6) 3054 3885 * printing user warnings: Make Control Functions. 3055 * problems and bugs, reporting: Bugs. 3056 * problems with wildcards: Wildcard Pitfall. 3057 * processing a makefile: How Make Works. 3886 (line 35) 3887 * problems and bugs, reporting: Bugs. (line 6) 3888 * problems with wildcards: Wildcard Pitfall. (line 6) 3889 * processing a makefile: How Make Works. (line 6) 3058 3890 * question mode: Instead of Execution. 3059 * quoting %, in patsubst: Text Functions. 3060 * quoting %, in static pattern: Static Usage. 3061 * quoting %, in vpath: Selective Search. 3062 * quoting newline, in commands: Execution. 3063 * quoting newline, in makefile: Simple Makefile. 3064 * Ratfor, rule to compile: Catalogue of Rules. 3065 * RCS, rule to extract from: Catalogue of Rules. 3066 * reading makefiles: Reading Makefiles. 3067 * README: Makefile Names. 3068 * realclean (standard target): Goals. 3069 * recompilation: Introduction. 3891 (line 25) 3892 * quoting %, in patsubst: Text Functions. (line 26) 3893 * quoting %, in static pattern: Static Usage. (line 37) 3894 * quoting %, in vpath: Selective Search. (line 38) 3895 * quoting newline, in commands: Splitting Lines. (line 6) 3896 * quoting newline, in makefile: Simple Makefile. (line 40) 3897 * Ratfor, rule to compile: Catalogue of Rules. (line 49) 3898 * RCS, rule to extract from: Catalogue of Rules. (line 164) 3899 * reading makefiles: Reading Makefiles. (line 6) 3900 * README: Makefile Names. (line 9) 3901 * realclean (standard target): Goals. (line 85) 3902 * realpath: File Name Functions. (line 114) 3903 * recompilation: Introduction. (line 22) 3070 3904 * recompilation, avoiding: Avoiding Compilation. 3071 * recording events with empty targets: Empty Targets. 3072 * recursion: Recursion. 3073 * recursion, and -C: Options/Recursion. 3074 * recursion, and -f: Options/Recursion. 3075 * recursion, and -j: Options/Recursion. 3076 * recursion, and -o: Options/Recursion. 3077 * recursion, and -t: MAKE Variable. 3078 * recursion, and -w: -w Option. 3079 * recursion, and -W: Options/Recursion. 3905 (line 6) 3906 * recording events with empty targets: Empty Targets. (line 6) 3907 * recursion: Recursion. (line 6) 3908 * recursion, and -C: Options/Recursion. (line 22) 3909 * recursion, and -f: Options/Recursion. (line 22) 3910 * recursion, and -j: Options/Recursion. (line 25) 3911 * recursion, and -o: Options/Recursion. (line 22) 3912 * recursion, and -t: MAKE Variable. (line 34) 3913 * recursion, and -w: -w Option. (line 20) 3914 * recursion, and -W: Options/Recursion. (line 22) 3080 3915 * recursion, and command line variable definitions: Options/Recursion. 3081 * recursion, and environment: Variables/Recursion. 3082 * recursion, and MAKE variable: MAKE Variable.3083 * recursion, and MAKE FILES variable: MAKEFILES Variable.3084 * recursion, and options: Options/Recursion.3085 * recursion, and printing directories: -w Option.3086 * recursion, and variables: Variables/Recursion.3087 * recursion, level of: Variables/Recursion.3088 * recursi ve variable expansion <1>: Flavors.3089 * recursive variable expansion : Using Variables.3090 * recursive ly expanded variables: Flavors.3091 * re ference to variables <1>: Advanced.3092 * reference to variables : Reference.3093 * re linking: How Make Works.3094 * re making makefiles: Remaking Makefiles.3095 * rem oval of target files <1>: Interrupts.3096 * removal of target files : Errors.3097 * remov ing duplicate words: Text Functions.3098 * removing targets on failure: Special Targets.3099 * removing , to clean up: Cleanup.3100 * re porting bugs: Bugs.3101 * r m: Implicit Variables.3102 * rm (shell command) <1>: Errors.3103 * rm (shell command) < 2>: Phony Targets.3104 * rm (shell command) < 3>: Wildcard Examples.3105 * rm (shell command) : Simple Makefile.3106 * r ule commands: Commands.3107 * rule prerequisites: Rule Syntax.3108 * rule syntax: Rule Syntax.3109 * rule targets: Rule Syntax.3110 * rule , and $: Rule Syntax.3111 * rule, double-colon (::): Double-Colon. 3112 * rule, explicit, definition of: Makefile Contents. 3113 * rule, how to write: Rules. 3114 * rule, implicit: Implicit Rules. 3115 * rule, implicit, and directory search: Implicit/Search. 3116 * rule, implicit, and VPATH: Implicit/Search. 3117 * rule, implicit, chains of: Chained Rules. 3118 * rule, implicit, definition of: Makefile Contents. 3119 * rule, implicit, how to use: Using Implicit. 3120 * rule, implicit, introduction to: make Deduces. 3121 * rule, implicit, predefined: Catalogue of Rules. 3122 * rule, introduction to: Rule Introduction. 3123 * rule, multiple for one target: Multiple Rules. 3124 * rule, no commands or prerequisites: Force Targets. 3125 * rule, pattern: Pattern Intro. 3126 * rule, static pattern: Static Pattern. 3916 (line 17) 3917 * recursion, and environment: Variables/Recursion. (line 6) 3918 * recursion, and MAKE variable: MAKE Variable. (line 6) 3919 * recursion, and MAKEFILES variable: MAKEFILES Variable. (line 14) 3920 * recursion, and options: Options/Recursion. (line 6) 3921 * recursion, and printing directories: -w Option. (line 6) 3922 * recursion, and variables: Variables/Recursion. (line 6) 3923 * recursion, level of: Variables/Recursion. (line 115) 3924 * recursive variable expansion <1>: Flavors. (line 6) 3925 * recursive variable expansion: Using Variables. (line 6) 3926 * recursively expanded variables: Flavors. (line 6) 3927 * reference to variables <1>: Advanced. (line 6) 3928 * reference to variables: Reference. (line 6) 3929 * relinking: How Make Works. (line 46) 3930 * remaking makefiles: Remaking Makefiles. (line 6) 3931 * removal of target files <1>: Interrupts. (line 6) 3932 * removal of target files: Errors. (line 64) 3933 * removing duplicate words: Text Functions. (line 155) 3934 * removing targets on failure: Special Targets. (line 68) 3935 * removing, to clean up: Cleanup. (line 6) 3936 * reporting bugs: Bugs. (line 6) 3937 * rm: Implicit Variables. (line 110) 3938 * rm (shell command) <1>: Errors. (line 27) 3939 * rm (shell command) <2>: Phony Targets. (line 20) 3940 * rm (shell command) <3>: Wildcard Examples. (line 12) 3941 * rm (shell command): Simple Makefile. (line 83) 3942 * rule commands: Commands. (line 6) 3943 * rule prerequisites: Rule Syntax. (line 46) 3944 * rule syntax: Rule Syntax. (line 6) 3945 * rule targets: Rule Syntax. (line 18) 3946 * rule, double-colon (::): Double-Colon. (line 6) 3947 * rule, explicit, definition of: Makefile Contents. (line 10) 3948 * rule, how to write: Rules. (line 6) 3949 * rule, implicit: Implicit Rules. (line 6) 3950 * rule, implicit, and directory search: Implicit/Search. (line 6) 3951 * rule, implicit, and VPATH: Implicit/Search. (line 6) 3952 * rule, implicit, chains of: Chained Rules. (line 6) 3953 * rule, implicit, definition of: Makefile Contents. (line 16) 3954 * rule, implicit, how to use: Using Implicit. (line 6) 3955 * rule, implicit, introduction to: make Deduces. (line 6) 3956 * rule, implicit, predefined: Catalogue of Rules. (line 6) 3957 * rule, introduction to: Rule Introduction. (line 6) 3958 * rule, multiple for one target: Multiple Rules. (line 6) 3959 * rule, no commands or prerequisites: Force Targets. (line 6) 3960 * rule, pattern: Pattern Intro. (line 6) 3961 * rule, static pattern: Static Pattern. (line 6) 3127 3962 * rule, static pattern versus implicit: Static versus Implicit. 3128 * rule, with multiple targets: Multiple Targets. 3129 * s. (SCCS file prefix): Catalogue of Rules. 3130 * SCCS, rule to extract from: Catalogue of Rules. 3963 (line 6) 3964 * rule, with multiple targets: Multiple Targets. (line 6) 3965 * rules, and $: Rule Syntax. (line 32) 3966 * s. (SCCS file prefix): Catalogue of Rules. (line 173) 3967 * SCCS, rule to extract from: Catalogue of Rules. (line 173) 3131 3968 * search algorithm, implicit rule: Implicit Rule Search. 3132 * search path for prerequisites (VPATH): Directory Search. 3969 (line 6) 3970 * search path for prerequisites (VPATH): Directory Search. (line 6) 3133 3971 * search path for prerequisites (VPATH), and implicit rules: Implicit/Search. 3972 (line 6) 3134 3973 * search path for prerequisites (VPATH), and link libraries: Libraries/Search. 3135 * searching for strings: Text Functions. 3136 * secondary files: Chained Rules. 3137 * secondary targets: Special Targets. 3974 (line 6) 3975 * searching for strings: Text Functions. (line 103) 3976 * secondary expansion: Secondary Expansion. (line 6) 3977 * secondary expansion and explicit rules: Secondary Expansion. 3978 (line 106) 3979 * secondary expansion and implicit rules: Secondary Expansion. 3980 (line 146) 3981 * secondary expansion and static pattern rules: Secondary Expansion. 3982 (line 138) 3983 * secondary files: Chained Rules. (line 46) 3984 * secondary targets: Special Targets. (line 49) 3138 3985 * sed (shell command): Automatic Prerequisites. 3139 * selecting a word: Text Functions. 3140 * selecting word lists: Text Functions. 3141 * sequences of commands: Sequences. 3142 * setting options from environment: Options/Recursion. 3143 * setting options in makefiles: Options/Recursion. 3144 * setting variables: Setting. 3145 * several rules for one target: Multiple Rules. 3146 * several targets in a rule: Multiple Targets. 3147 * shar (standard target): Goals. 3148 * shell command: Simple Makefile. 3149 * shell command, and directory search: Commands/Search. 3150 * shell command, execution: Execution. 3151 * shell command, function for: Shell Function. 3152 * shell file name pattern (in include): Include. 3153 * shell wildcards (in include): Include. 3154 * SHELL, MS-DOS specifics: Execution. 3155 * signal: Interrupts. 3156 * silent operation: Echoing. 3157 * simple makefile: Simple Makefile. 3158 * simple variable expansion: Using Variables. 3159 * simplifying with variables: Variables Simplify. 3160 * simply expanded variables: Flavors. 3161 * sorting words: Text Functions. 3162 * spaces, in variable values: Flavors. 3163 * spaces, stripping: Text Functions. 3164 * special targets: Special Targets. 3165 * special variables: Special Variables. 3166 * specifying makefile name: Makefile Names. 3167 * standard input: Parallel. 3168 * standards conformance: Overview. 3986 (line 73) 3987 * selecting a word: Text Functions. (line 159) 3988 * selecting word lists: Text Functions. (line 168) 3989 * sequences of commands: Sequences. (line 6) 3990 * setting options from environment: Options/Recursion. (line 81) 3991 * setting options in makefiles: Options/Recursion. (line 81) 3992 * setting variables: Setting. (line 6) 3993 * several rules for one target: Multiple Rules. (line 6) 3994 * several targets in a rule: Multiple Targets. (line 6) 3995 * shar (standard target): Goals. (line 103) 3996 * shell command: Simple Makefile. (line 72) 3997 * shell command, and directory search: Commands/Search. (line 6) 3998 * shell command, execution: Execution. (line 6) 3999 * shell command, function for: Shell Function. (line 6) 4000 * shell file name pattern (in include): Include. (line 13) 4001 * shell variables, setting in commands: Execution. (line 10) 4002 * shell wildcards (in include): Include. (line 13) 4003 * shell, choosing the: Choosing the Shell. (line 6) 4004 * SHELL, exported value: Variables/Recursion. (line 23) 4005 * SHELL, import from environment: Environment. (line 37) 4006 * shell, in DOS and Windows: Choosing the Shell. (line 36) 4007 * SHELL, MS-DOS specifics: Choosing the Shell. (line 42) 4008 * SHELL, value of: Choosing the Shell. (line 6) 4009 * signal: Interrupts. (line 6) 4010 * silent operation: Echoing. (line 6) 4011 * simple makefile: Simple Makefile. (line 6) 4012 * simple variable expansion: Using Variables. (line 6) 4013 * simplifying with variables: Variables Simplify. (line 6) 4014 * simply expanded variables: Flavors. (line 56) 4015 * sorting words: Text Functions. (line 146) 4016 * spaces, in variable values: Flavors. (line 103) 4017 * spaces, stripping: Text Functions. (line 80) 4018 * special targets: Special Targets. (line 6) 4019 * special variables: Special Variables. (line 6) 4020 * specifying makefile name: Makefile Names. (line 30) 4021 * splitting commands: Splitting Lines. (line 6) 4022 * standard input: Parallel. (line 30) 4023 * standards conformance: Overview. (line 13) 3169 4024 * standards for makefiles: Makefile Conventions. 3170 * static pattern rule: Static Pattern. 3171 * static pattern rule, syntax of: Static Usage. 4025 (line 6) 4026 * static pattern rule: Static Pattern. (line 6) 4027 * static pattern rule, syntax of: Static Usage. (line 6) 3172 4028 * static pattern rule, versus implicit: Static versus Implicit. 3173 * stem <1>: Pattern Match. 3174 * stem: Static Usage. 3175 * stem, variable for: Automatic Variables. 4029 (line 6) 4030 * static pattern rules, secondary expansion of: Secondary Expansion. 4031 (line 138) 4032 * stem <1>: Pattern Match. (line 6) 4033 * stem: Static Usage. (line 17) 4034 * stem, variable for: Automatic Variables. (line 77) 3176 4035 * stopping make: Make Control Functions. 3177 * strings, searching for: Text Functions. 3178 * stripping whitespace: Text Functions. 3179 * sub-make: Variables/Recursion. 3180 * subdirectories, recursion for: Recursion. 3181 * substitution variable reference: Substitution Refs. 3182 * suffix rule: Suffix Rules. 4036 (line 11) 4037 * strings, searching for: Text Functions. (line 103) 4038 * stripping whitespace: Text Functions. (line 80) 4039 * sub-make: Variables/Recursion. (line 6) 4040 * subdirectories, recursion for: Recursion. (line 6) 4041 * substitution variable reference: Substitution Refs. (line 6) 4042 * suffix rule: Suffix Rules. (line 6) 3183 4043 * suffix rule, for archive: Archive Suffix Rules. 3184 * suffix, adding: File Name Functions. 3185 * suffix, function to find: File Name Functions. 3186 * suffix, substituting in variables: Substitution Refs. 3187 * switches: Options Summary. 3188 * symbol directories, updating archive: Archive Symbols. 3189 * syntax of rules: Rule Syntax. 3190 * tab character (in commands): Rule Syntax. 3191 * tabs in rules: Rule Introduction. 3192 * TAGS (standard target): Goals. 3193 * tangle <1>: Implicit Variables. 3194 * tangle: Catalogue of Rules. 3195 * tar (standard target): Goals. 3196 * target: Rules. 3197 * target pattern, implicit: Pattern Intro. 3198 * target pattern, static (not implicit): Static Usage. 3199 * target, deleting on error: Errors. 3200 * target, deleting on interrupt: Interrupts. 3201 * target, expansion: Reading Makefiles. 3202 * target, multiple in pattern rule: Pattern Intro. 3203 * target, multiple rules for one: Multiple Rules. 4044 (line 6) 4045 * suffix, adding: File Name Functions. (line 68) 4046 * suffix, function to find: File Name Functions. (line 43) 4047 * suffix, substituting in variables: Substitution Refs. (line 6) 4048 * switches: Options Summary. (line 6) 4049 * symbol directories, updating archive: Archive Symbols. (line 6) 4050 * syntax of commands: Command Syntax. (line 6) 4051 * syntax of rules: Rule Syntax. (line 6) 4052 * tab character (in commands): Rule Syntax. (line 26) 4053 * tabs in rules: Rule Introduction. (line 21) 4054 * TAGS (standard target): Goals. (line 111) 4055 * tangle <1>: Implicit Variables. (line 104) 4056 * tangle: Catalogue of Rules. (line 151) 4057 * tar (standard target): Goals. (line 100) 4058 * target: Rules. (line 6) 4059 * target pattern, implicit: Pattern Intro. (line 9) 4060 * target pattern, static (not implicit): Static Usage. (line 17) 4061 * target, deleting on error: Errors. (line 64) 4062 * target, deleting on interrupt: Interrupts. (line 6) 4063 * target, expansion: Reading Makefiles. (line 62) 4064 * target, multiple in pattern rule: Pattern Intro. (line 49) 4065 * target, multiple rules for one: Multiple Rules. (line 6) 3204 4066 * target, touching: Instead of Execution. 3205 * target-specific variables: Target-specific. 3206 * targets: Rule Syntax. 3207 * targets without a file: Phony Targets. 3208 * targets, built-in special: Special Targets. 3209 * targets, empty: Empty Targets. 3210 * targets, force: Force Targets. 3211 * targets, introduction to: Rule Introduction. 3212 * targets, multiple: Multiple Targets. 3213 * targets, phony: Phony Targets. 4067 (line 19) 4068 * target-specific variables: Target-specific. (line 6) 4069 * targets: Rule Syntax. (line 18) 4070 * targets without a file: Phony Targets. (line 6) 4071 * targets, built-in special: Special Targets. (line 6) 4072 * targets, empty: Empty Targets. (line 6) 4073 * targets, force: Force Targets. (line 6) 4074 * targets, introduction to: Rule Introduction. (line 8) 4075 * targets, multiple: Multiple Targets. (line 6) 4076 * targets, phony: Phony Targets. (line 6) 3214 4077 * terminal rule: Match-Anything Rules. 3215 * test (standard target): Goals. 3216 * testing compilation: Testing. 3217 * tex <1>: Implicit Variables. 3218 * tex: Catalogue of Rules. 3219 * TeX, rule to run: Catalogue of Rules. 3220 * texi2dvi <1>: Implicit Variables. 3221 * texi2dvi: Catalogue of Rules. 3222 * Texinfo, rule to format: Catalogue of Rules. 3223 * tilde (~): Wildcards. 3224 * touch (shell command) <1>: Empty Targets. 3225 * touch (shell command): Wildcard Examples. 4078 (line 6) 4079 * test (standard target): Goals. (line 115) 4080 * testing compilation: Testing. (line 6) 4081 * tex <1>: Implicit Variables. (line 91) 4082 * tex: Catalogue of Rules. (line 151) 4083 * TeX, rule to run: Catalogue of Rules. (line 151) 4084 * texi2dvi <1>: Implicit Variables. (line 95) 4085 * texi2dvi: Catalogue of Rules. (line 158) 4086 * Texinfo, rule to format: Catalogue of Rules. (line 158) 4087 * tilde (~): Wildcards. (line 11) 4088 * touch (shell command) <1>: Empty Targets. (line 25) 4089 * touch (shell command): Wildcard Examples. (line 21) 3226 4090 * touching files: Instead of Execution. 3227 * traditional directory search (GPATH): Search Algorithm. 3228 * types of prerequisites: Prerequisite Types. 3229 * undefined variables, warning message: Options Summary. 3230 * updating archive symbol directories: Archive Symbols. 3231 * updating makefiles: Remaking Makefiles. 3232 * user defined functions: Call Function. 3233 * value: Using Variables. 3234 * value, how a variable gets it: Values. 3235 * variable: Using Variables. 3236 * variable definition: Makefile Contents. 3237 * variables: Variables Simplify. 3238 * variables, $ in name: Computed Names. 3239 * variables, and implicit rule: Automatic Variables. 3240 * variables, appending to: Appending. 3241 * variables, automatic: Automatic Variables. 3242 * variables, command line: Overriding. 3243 * variables, command line, and recursion: Options/Recursion. 3244 * variables, computed names: Computed Names. 3245 * variables, conditional assignment: Flavors. 3246 * variables, defining verbatim: Defining. 3247 * variables, environment <1>: Environment. 3248 * variables, environment: Variables/Recursion. 3249 * variables, exporting: Variables/Recursion. 3250 * variables, flavors: Flavors. 3251 * variables, how they get their values: Values. 3252 * variables, how to reference: Reference. 3253 * variables, loops in expansion: Flavors. 3254 * variables, modified reference: Substitution Refs. 3255 * variables, nested references: Computed Names. 3256 * variables, origin of: Origin Function. 3257 * variables, overriding: Override Directive. 3258 * variables, overriding with arguments: Overriding. 3259 * variables, pattern-specific: Pattern-specific. 3260 * variables, recursively expanded: Flavors. 3261 * variables, setting: Setting. 3262 * variables, simply expanded: Flavors. 3263 * variables, spaces in values: Flavors. 3264 * variables, substituting suffix in: Substitution Refs. 3265 * variables, substitution reference: Substitution Refs. 3266 * variables, target-specific: Target-specific. 3267 * variables, unexpanded value: Value Function. 3268 * variables, warning for undefined: Options Summary. 3269 * varying prerequisites: Static Pattern. 3270 * verbatim variable definition: Defining. 3271 * vpath: Directory Search. 3272 * VPATH, and implicit rules: Implicit/Search. 3273 * VPATH, and link libraries: Libraries/Search. 4091 (line 19) 4092 * traditional directory search (GPATH): Search Algorithm. (line 42) 4093 * types of prerequisites: Prerequisite Types. (line 6) 4094 * undefined variables, warning message: Options Summary. (line 251) 4095 * updating archive symbol directories: Archive Symbols. (line 6) 4096 * updating makefiles: Remaking Makefiles. (line 6) 4097 * user defined functions: Call Function. (line 6) 4098 * value: Using Variables. (line 6) 4099 * value, how a variable gets it: Values. (line 6) 4100 * variable: Using Variables. (line 6) 4101 * variable definition: Makefile Contents. (line 22) 4102 * variable references in commands: Variables in Commands. 4103 (line 6) 4104 * variables: Variables Simplify. (line 6) 4105 * variables, $ in name: Computed Names. (line 6) 4106 * variables, and implicit rule: Automatic Variables. (line 6) 4107 * variables, appending to: Appending. (line 6) 4108 * variables, automatic: Automatic Variables. (line 6) 4109 * variables, command line: Overriding. (line 6) 4110 * variables, command line, and recursion: Options/Recursion. (line 17) 4111 * variables, computed names: Computed Names. (line 6) 4112 * variables, conditional assignment: Flavors. (line 129) 4113 * variables, defining verbatim: Defining. (line 6) 4114 * variables, environment <1>: Environment. (line 6) 4115 * variables, environment: Variables/Recursion. (line 6) 4116 * variables, exporting: Variables/Recursion. (line 6) 4117 * variables, flavor of: Flavor Function. (line 6) 4118 * variables, flavors: Flavors. (line 6) 4119 * variables, how they get their values: Values. (line 6) 4120 * variables, how to reference: Reference. (line 6) 4121 * variables, loops in expansion: Flavors. (line 44) 4122 * variables, modified reference: Substitution Refs. (line 6) 4123 * variables, nested references: Computed Names. (line 6) 4124 * variables, origin of: Origin Function. (line 6) 4125 * variables, overriding: Override Directive. (line 6) 4126 * variables, overriding with arguments: Overriding. (line 6) 4127 * variables, pattern-specific: Pattern-specific. (line 6) 4128 * variables, recursively expanded: Flavors. (line 6) 4129 * variables, setting: Setting. (line 6) 4130 * variables, simply expanded: Flavors. (line 56) 4131 * variables, spaces in values: Flavors. (line 103) 4132 * variables, substituting suffix in: Substitution Refs. (line 6) 4133 * variables, substitution reference: Substitution Refs. (line 6) 4134 * variables, target-specific: Target-specific. (line 6) 4135 * variables, unexpanded value: Value Function. (line 6) 4136 * variables, warning for undefined: Options Summary. (line 251) 4137 * varying prerequisites: Static Pattern. (line 6) 4138 * verbatim variable definition: Defining. (line 6) 4139 * vpath: Directory Search. (line 6) 4140 * VPATH, and implicit rules: Implicit/Search. (line 6) 4141 * VPATH, and link libraries: Libraries/Search. (line 6) 3274 4142 * warnings, printing: Make Control Functions. 3275 * weave <1>: Implicit Variables. 3276 * weave: Catalogue of Rules. 3277 * Web, rule to run: Catalogue of Rules. 4143 (line 35) 4144 * weave <1>: Implicit Variables. (line 98) 4145 * weave: Catalogue of Rules. (line 151) 4146 * Web, rule to run: Catalogue of Rules. (line 151) 3278 4147 * what if: Instead of Execution. 3279 * whitespace, in variable values: Flavors. 3280 * whitespace, stripping: Text Functions. 3281 * wildcard: Wildcards. 3282 * wildcard pitfalls: Wildcard Pitfall. 3283 * wildcard, function: File Name Functions. 3284 * wildcard, in archive member: Archive Members. 3285 * wildcard, in include: Include. 4148 (line 33) 4149 * whitespace, in variable values: Flavors. (line 103) 4150 * whitespace, stripping: Text Functions. (line 80) 4151 * wildcard: Wildcards. (line 6) 4152 * wildcard pitfalls: Wildcard Pitfall. (line 6) 4153 * wildcard, function: File Name Functions. (line 107) 4154 * wildcard, in archive member: Archive Members. (line 36) 4155 * wildcard, in include: Include. (line 13) 3286 4156 * wildcards and MS-DOS/MS-Windows backslashes: Wildcard Pitfall. 3287 * word, selecting a: Text Functions. 3288 * words, extracting first: Text Functions. 3289 * words, filtering: Text Functions. 3290 * words, filtering out: Text Functions. 3291 * words, finding number: Text Functions. 3292 * words, iterating over: Foreach Function. 3293 * words, joining lists: File Name Functions. 3294 * words, removing duplicates: Text Functions. 3295 * words, selecting lists of: Text Functions. 3296 * writing rule commands: Commands. 3297 * writing rules: Rules. 3298 * yacc <1>: Implicit Variables. 3299 * yacc <2>: Catalogue of Rules. 3300 * yacc: Sequences. 3301 * Yacc, rule to run: Catalogue of Rules. 3302 * ~ (tilde): Wildcards. 4157 (line 31) 4158 * Windows, choosing a shell in: Choosing the Shell. (line 36) 4159 * word, selecting a: Text Functions. (line 159) 4160 * words, extracting first: Text Functions. (line 184) 4161 * words, extracting last: Text Functions. (line 197) 4162 * words, filtering: Text Functions. (line 114) 4163 * words, filtering out: Text Functions. (line 132) 4164 * words, finding number: Text Functions. (line 180) 4165 * words, iterating over: Foreach Function. (line 6) 4166 * words, joining lists: File Name Functions. (line 90) 4167 * words, removing duplicates: Text Functions. (line 155) 4168 * words, selecting lists of: Text Functions. (line 168) 4169 * writing rule commands: Commands. (line 6) 4170 * writing rules: Rules. (line 6) 4171 * yacc <1>: Implicit Variables. (line 75) 4172 * yacc <2>: Catalogue of Rules. (line 120) 4173 * yacc: Sequences. (line 18) 4174 * Yacc, rule to run: Catalogue of Rules. (line 120) 4175 * ~ (tilde): Wildcards. (line 11) 3303 4176 3304 4177 … … 3308 4181 ******************************************* 3309 4182 4183 [index] 3310 4184 * Menu: 3311 4185 3312 * $$(@D): Automatic Variables. 3313 * $$(@F): Automatic Variables. 3314 * $$@: Automatic Variables. 3315 * $%: Automatic Variables. 3316 * $(%D): Automatic Variables. 3317 * $(%F): Automatic Variables. 3318 * $(*D): Automatic Variables. 3319 * $(*F): Automatic Variables. 3320 * $(+D): Automatic Variables. 3321 * $(+F): Automatic Variables. 3322 * $(.VARIABLES): Special Variables. 3323 * $(<D): Automatic Variables. 3324 * $(<F): Automatic Variables. 3325 * $(?D): Automatic Variables. 3326 * $(?F): Automatic Variables. 3327 * $(@D): Automatic Variables. 3328 * $(@F): Automatic Variables. 3329 * $(^D): Automatic Variables. 3330 * $(^F): Automatic Variables. 3331 * $*: Automatic Variables. 3332 * $*, and static pattern: Static Usage. 3333 * $+: Automatic Variables. 3334 * $<: Automatic Variables. 3335 * $?: Automatic Variables. 3336 * $@: Automatic Variables. 3337 * $^: Automatic Variables. 3338 * % (automatic variable): Automatic Variables. 3339 * %D (automatic variable): Automatic Variables. 3340 * %F (automatic variable): Automatic Variables. 3341 * * (automatic variable): Automatic Variables. 3342 * * (automatic variable), unsupported bizarre usage: Missing. 3343 * *D (automatic variable): Automatic Variables. 3344 * *F (automatic variable): Automatic Variables. 3345 * + (automatic variable): Automatic Variables. 3346 * +D (automatic variable): Automatic Variables. 3347 * +F (automatic variable): Automatic Variables. 3348 * .DEFAULT <1>: Last Resort. 3349 * .DEFAULT: Special Targets. 3350 * .DEFAULT, and empty commands: Empty Commands. 3351 * .DELETE_ON_ERROR <1>: Errors. 3352 * .DELETE_ON_ERROR: Special Targets. 3353 * .EXPORT_ALL_VARIABLES <1>: Variables/Recursion. 3354 * .EXPORT_ALL_VARIABLES: Special Targets. 3355 * .IGNORE <1>: Errors. 3356 * .IGNORE: Special Targets. 3357 * .INTERMEDIATE: Special Targets. 3358 * .LIBPATTERNS: Libraries/Search. 3359 * .LOW_RESOLUTION_TIME: Special Targets. 3360 * .NOTPARALLEL: Special Targets. 3361 * .PHONY <1>: Special Targets. 3362 * .PHONY: Phony Targets. 3363 * .POSIX: Options/Recursion. 3364 * .PRECIOUS <1>: Interrupts. 3365 * .PRECIOUS: Special Targets. 3366 * .SECONDARY: Special Targets. 3367 * .SILENT <1>: Echoing. 3368 * .SILENT: Special Targets. 3369 * .SUFFIXES <1>: Suffix Rules. 3370 * .SUFFIXES: Special Targets. 3371 * .VARIABLES (list of variables): Special Variables. 3372 * /usr/gnu/include: Include. 3373 * /usr/include: Include. 3374 * /usr/local/include: Include. 3375 * < (automatic variable): Automatic Variables. 3376 * <D (automatic variable): Automatic Variables. 3377 * <F (automatic variable): Automatic Variables. 3378 * ? (automatic variable): Automatic Variables. 3379 * ?D (automatic variable): Automatic Variables. 3380 * ?F (automatic variable): Automatic Variables. 3381 * @ (automatic variable): Automatic Variables. 3382 * @D (automatic variable): Automatic Variables. 3383 * @F (automatic variable): Automatic Variables. 3384 * ^ (automatic variable): Automatic Variables. 3385 * ^D (automatic variable): Automatic Variables. 3386 * ^F (automatic variable): Automatic Variables. 3387 * addprefix: File Name Functions. 3388 * addsuffix: File Name Functions. 3389 * AR: Implicit Variables. 3390 * ARFLAGS: Implicit Variables. 3391 * AS: Implicit Variables. 3392 * ASFLAGS: Implicit Variables. 3393 * basename: File Name Functions. 3394 * bindir: Directory Variables. 3395 * call: Call Function. 3396 * CC: Implicit Variables. 3397 * CFLAGS: Implicit Variables. 3398 * CO: Implicit Variables. 3399 * COFLAGS: Implicit Variables. 3400 * COMSPEC: Execution. 3401 * CPP: Implicit Variables. 3402 * CPPFLAGS: Implicit Variables. 3403 * CTANGLE: Implicit Variables. 3404 * CURDIR: Recursion. 3405 * CWEAVE: Implicit Variables. 3406 * CXX: Implicit Variables. 3407 * CXXFLAGS: Implicit Variables. 3408 * define: Defining. 3409 * dir: File Name Functions. 3410 * else: Conditional Syntax. 3411 * endef: Defining. 3412 * endif: Conditional Syntax. 4186 * $%: Automatic Variables. (line 37) 4187 * $(%D): Automatic Variables. (line 129) 4188 * $(%F): Automatic Variables. (line 130) 4189 * $(*D): Automatic Variables. (line 124) 4190 * $(*F): Automatic Variables. (line 125) 4191 * $(+D): Automatic Variables. (line 147) 4192 * $(+F): Automatic Variables. (line 148) 4193 * $(<D): Automatic Variables. (line 137) 4194 * $(<F): Automatic Variables. (line 138) 4195 * $(?D): Automatic Variables. (line 153) 4196 * $(?F): Automatic Variables. (line 154) 4197 * $(@D): Automatic Variables. (line 113) 4198 * $(@F): Automatic Variables. (line 119) 4199 * $(^D): Automatic Variables. (line 142) 4200 * $(^F): Automatic Variables. (line 143) 4201 * $*: Automatic Variables. (line 73) 4202 * $*, and static pattern: Static Usage. (line 81) 4203 * $+: Automatic Variables. (line 63) 4204 * $<: Automatic Variables. (line 43) 4205 * $?: Automatic Variables. (line 48) 4206 * $@: Automatic Variables. (line 30) 4207 * $^: Automatic Variables. (line 53) 4208 * $|: Automatic Variables. (line 69) 4209 * % (automatic variable): Automatic Variables. (line 37) 4210 * %D (automatic variable): Automatic Variables. (line 129) 4211 * %F (automatic variable): Automatic Variables. (line 130) 4212 * * (automatic variable): Automatic Variables. (line 73) 4213 * * (automatic variable), unsupported bizarre usage: Missing. (line 44) 4214 * *D (automatic variable): Automatic Variables. (line 124) 4215 * *F (automatic variable): Automatic Variables. (line 125) 4216 * + (automatic variable): Automatic Variables. (line 63) 4217 * +D (automatic variable): Automatic Variables. (line 147) 4218 * +F (automatic variable): Automatic Variables. (line 148) 4219 * .DEFAULT <1>: Last Resort. (line 23) 4220 * .DEFAULT: Special Targets. (line 20) 4221 * .DEFAULT, and empty commands: Empty Commands. (line 16) 4222 * .DEFAULT_GOAL (define default goal): Special Variables. (line 10) 4223 * .DELETE_ON_ERROR <1>: Errors. (line 64) 4224 * .DELETE_ON_ERROR: Special Targets. (line 67) 4225 * .EXPORT_ALL_VARIABLES <1>: Variables/Recursion. (line 99) 4226 * .EXPORT_ALL_VARIABLES: Special Targets. (line 129) 4227 * .FEATURES (list of supported features): Special Variables. (line 65) 4228 * .IGNORE <1>: Errors. (line 30) 4229 * .IGNORE: Special Targets. (line 74) 4230 * .INCLUDE_DIRS (list of include directories): Special Variables. 4231 (line 98) 4232 * .INTERMEDIATE: Special Targets. (line 43) 4233 * .LIBPATTERNS: Libraries/Search. (line 6) 4234 * .LOW_RESOLUTION_TIME: Special Targets. (line 86) 4235 * .NOTPARALLEL: Special Targets. (line 134) 4236 * .PHONY <1>: Special Targets. (line 8) 4237 * .PHONY: Phony Targets. (line 22) 4238 * .POSIX: Options/Recursion. (line 60) 4239 * .PRECIOUS <1>: Interrupts. (line 22) 4240 * .PRECIOUS: Special Targets. (line 28) 4241 * .SECONDARY: Special Targets. (line 48) 4242 * .SECONDEXPANSION <1>: Special Targets. (line 57) 4243 * .SECONDEXPANSION: Secondary Expansion. (line 6) 4244 * .SILENT <1>: Echoing. (line 24) 4245 * .SILENT: Special Targets. (line 116) 4246 * .SUFFIXES <1>: Suffix Rules. (line 61) 4247 * .SUFFIXES: Special Targets. (line 15) 4248 * .VARIABLES (list of variables): Special Variables. (line 56) 4249 * /usr/gnu/include: Include. (line 52) 4250 * /usr/include: Include. (line 52) 4251 * /usr/local/include: Include. (line 52) 4252 * < (automatic variable): Automatic Variables. (line 43) 4253 * <D (automatic variable): Automatic Variables. (line 137) 4254 * <F (automatic variable): Automatic Variables. (line 138) 4255 * ? (automatic variable): Automatic Variables. (line 48) 4256 * ?D (automatic variable): Automatic Variables. (line 153) 4257 * ?F (automatic variable): Automatic Variables. (line 154) 4258 * @ (automatic variable): Automatic Variables. (line 30) 4259 * @D (automatic variable): Automatic Variables. (line 113) 4260 * @F (automatic variable): Automatic Variables. (line 119) 4261 * ^ (automatic variable): Automatic Variables. (line 53) 4262 * ^D (automatic variable): Automatic Variables. (line 142) 4263 * ^F (automatic variable): Automatic Variables. (line 143) 4264 * abspath: File Name Functions. (line 121) 4265 * addprefix: File Name Functions. (line 79) 4266 * addsuffix: File Name Functions. (line 68) 4267 * and: Conditional Functions. 4268 (line 45) 4269 * AR: Implicit Variables. (line 41) 4270 * ARFLAGS: Implicit Variables. (line 117) 4271 * AS: Implicit Variables. (line 44) 4272 * ASFLAGS: Implicit Variables. (line 120) 4273 * basename: File Name Functions. (line 57) 4274 * bindir: Directory Variables. (line 53) 4275 * call: Call Function. (line 6) 4276 * CC: Implicit Variables. (line 47) 4277 * CFLAGS: Implicit Variables. (line 124) 4278 * CO: Implicit Variables. (line 50) 4279 * COFLAGS: Implicit Variables. (line 130) 4280 * COMSPEC: Choosing the Shell. (line 39) 4281 * CPP: Implicit Variables. (line 59) 4282 * CPPFLAGS: Implicit Variables. (line 133) 4283 * CTANGLE: Implicit Variables. (line 107) 4284 * CURDIR: Recursion. (line 28) 4285 * CWEAVE: Implicit Variables. (line 101) 4286 * CXX: Implicit Variables. (line 53) 4287 * CXXFLAGS: Implicit Variables. (line 127) 4288 * define: Defining. (line 6) 4289 * dir: File Name Functions. (line 17) 4290 * else: Conditional Syntax. (line 6) 4291 * endef: Defining. (line 6) 4292 * endif: Conditional Syntax. (line 6) 3413 4293 * error: Make Control Functions. 3414 * eval: Eval Function. 3415 * exec_prefix: Directory Variables. 3416 * export: Variables/Recursion. 3417 * FC: Implicit Variables. 3418 * FFLAGS: Implicit Variables. 3419 * filter: Text Functions. 3420 * filter-out: Text Functions. 3421 * findstring: Text Functions. 3422 * firstword: Text Functions. 3423 * foreach: Foreach Function. 3424 * GET: Implicit Variables. 3425 * GFLAGS: Implicit Variables. 3426 * GNUmakefile: Makefile Names. 3427 * GPATH: Search Algorithm. 3428 * if: If Function. 3429 * ifdef: Conditional Syntax. 3430 * ifeq: Conditional Syntax. 3431 * ifndef: Conditional Syntax. 3432 * ifneq: Conditional Syntax. 3433 * include: Include. 3434 * join: File Name Functions. 3435 * LDFLAGS: Implicit Variables. 3436 * LEX: Implicit Variables. 3437 * LFLAGS: Implicit Variables. 3438 * libexecdir: Directory Variables. 3439 * MAKE <1>: Flavors. 3440 * MAKE: MAKE Variable. 3441 * MAKECMDGOALS: Goals. 3442 * makefile: Makefile Names. 3443 * Makefile: Makefile Names. 3444 * MAKEFILES <1>: Variables/Recursion. 3445 * MAKEFILES: MAKEFILES Variable. 3446 * MAKEFLAGS: Options/Recursion. 3447 * MAKEINFO: Implicit Variables. 3448 * MAKELEVEL <1>: Flavors. 3449 * MAKELEVEL: Variables/Recursion. 3450 * MAKEOVERRIDES: Options/Recursion. 3451 * MFLAGS: Options/Recursion. 3452 * notdir: File Name Functions. 3453 * origin: Origin Function. 3454 * OUTPUT_OPTION: Catalogue of Rules. 3455 * override: Override Directive. 3456 * patsubst <1>: Text Functions. 3457 * patsubst: Substitution Refs. 3458 * PC: Implicit Variables. 3459 * PFLAGS: Implicit Variables. 3460 * prefix: Directory Variables. 3461 * RFLAGS: Implicit Variables. 3462 * RM: Implicit Variables. 3463 * sbindir: Directory Variables. 3464 * shell: Shell Function. 3465 * SHELL: Execution. 3466 * SHELL (command execution): Execution. 3467 * sort: Text Functions. 3468 * strip: Text Functions. 3469 * subst <1>: Text Functions. 3470 * subst: Multiple Targets. 3471 * suffix: File Name Functions. 3472 * SUFFIXES: Suffix Rules. 3473 * TANGLE: Implicit Variables. 3474 * TEX: Implicit Variables. 3475 * TEXI2DVI: Implicit Variables. 3476 * unexport: Variables/Recursion. 3477 * value: Value Function. 3478 * vpath: Selective Search. 3479 * VPATH: General Search. 3480 * vpath: Directory Search. 3481 * VPATH: Directory Search. 4294 (line 11) 4295 * eval: Eval Function. (line 6) 4296 * exec_prefix: Directory Variables. (line 35) 4297 * export: Variables/Recursion. (line 40) 4298 * FC: Implicit Variables. (line 63) 4299 * FFLAGS: Implicit Variables. (line 137) 4300 * filter: Text Functions. (line 114) 4301 * filter-out: Text Functions. (line 132) 4302 * findstring: Text Functions. (line 103) 4303 * firstword: Text Functions. (line 184) 4304 * flavor: Flavor Function. (line 6) 4305 * foreach: Foreach Function. (line 6) 4306 * GET: Implicit Variables. (line 67) 4307 * GFLAGS: Implicit Variables. (line 140) 4308 * GNUmakefile: Makefile Names. (line 7) 4309 * GPATH: Search Algorithm. (line 48) 4310 * if: Conditional Functions. 4311 (line 6) 4312 * ifdef: Conditional Syntax. (line 6) 4313 * ifeq: Conditional Syntax. (line 6) 4314 * ifndef: Conditional Syntax. (line 6) 4315 * ifneq: Conditional Syntax. (line 6) 4316 * include: Include. (line 6) 4317 * info: Make Control Functions. 4318 (line 43) 4319 * join: File Name Functions. (line 90) 4320 * lastword: Text Functions. (line 197) 4321 * LDFLAGS: Implicit Variables. (line 143) 4322 * LEX: Implicit Variables. (line 70) 4323 * LFLAGS: Implicit Variables. (line 147) 4324 * libexecdir: Directory Variables. (line 66) 4325 * LINT: Implicit Variables. (line 78) 4326 * LINTFLAGS: Implicit Variables. (line 159) 4327 * M2C: Implicit Variables. (line 81) 4328 * MAKE <1>: Flavors. (line 84) 4329 * MAKE: MAKE Variable. (line 6) 4330 * MAKE_RESTARTS (number of times make has restarted): Special Variables. 4331 (line 49) 4332 * MAKE_VERSION: Features. (line 197) 4333 * MAKECMDGOALS: Goals. (line 30) 4334 * makefile: Makefile Names. (line 7) 4335 * Makefile: Makefile Names. (line 7) 4336 * MAKEFILE_LIST: MAKEFILE_LIST Variable. 4337 (line 6) 4338 * MAKEFILES <1>: Variables/Recursion. (line 127) 4339 * MAKEFILES: MAKEFILES Variable. (line 6) 4340 * MAKEFLAGS: Options/Recursion. (line 6) 4341 * MAKEINFO: Implicit Variables. (line 87) 4342 * MAKELEVEL <1>: Flavors. (line 84) 4343 * MAKELEVEL: Variables/Recursion. (line 115) 4344 * MAKEOVERRIDES: Options/Recursion. (line 49) 4345 * MAKESHELL (MS-DOS alternative to SHELL): Choosing the Shell. 4346 (line 25) 4347 * MFLAGS: Options/Recursion. (line 65) 4348 * notdir: File Name Functions. (line 27) 4349 * or: Conditional Functions. 4350 (line 37) 4351 * origin: Origin Function. (line 6) 4352 * OUTPUT_OPTION: Catalogue of Rules. (line 202) 4353 * override: Override Directive. (line 6) 4354 * patsubst <1>: Text Functions. (line 18) 4355 * patsubst: Substitution Refs. (line 28) 4356 * PC: Implicit Variables. (line 84) 4357 * PFLAGS: Implicit Variables. (line 153) 4358 * prefix: Directory Variables. (line 25) 4359 * realpath: File Name Functions. (line 114) 4360 * RFLAGS: Implicit Variables. (line 156) 4361 * RM: Implicit Variables. (line 110) 4362 * sbindir: Directory Variables. (line 59) 4363 * shell: Shell Function. (line 6) 4364 * SHELL: Choosing the Shell. (line 6) 4365 * SHELL (command execution): Execution. (line 6) 4366 * sort: Text Functions. (line 146) 4367 * strip: Text Functions. (line 80) 4368 * subst <1>: Text Functions. (line 9) 4369 * subst: Multiple Targets. (line 28) 4370 * suffix: File Name Functions. (line 43) 4371 * SUFFIXES: Suffix Rules. (line 81) 4372 * TANGLE: Implicit Variables. (line 104) 4373 * TEX: Implicit Variables. (line 91) 4374 * TEXI2DVI: Implicit Variables. (line 94) 4375 * unexport: Variables/Recursion. (line 45) 4376 * value: Value Function. (line 6) 4377 * vpath: Selective Search. (line 6) 4378 * VPATH: General Search. (line 6) 4379 * vpath: Directory Search. (line 6) 4380 * VPATH: Directory Search. (line 6) 3482 4381 * warning: Make Control Functions. 3483 * WEAVE: Implicit Variables. 3484 * wildcard <1>: File Name Functions. 3485 * wildcard: Wildcard Function. 3486 * word: Text Functions. 3487 * wordlist: Text Functions. 3488 * words: Text Functions. 3489 * YACC: Implicit Variables. 3490 * YACCR: Implicit Variables. 3491 * YFLAGS: Implicit Variables. 3492 3493 4382 (line 35) 4383 * WEAVE: Implicit Variables. (line 98) 4384 * wildcard <1>: File Name Functions. (line 107) 4385 * wildcard: Wildcard Function. (line 6) 4386 * word: Text Functions. (line 159) 4387 * wordlist: Text Functions. (line 168) 4388 * words: Text Functions. (line 180) 4389 * YACC: Implicit Variables. (line 74) 4390 * YFLAGS: Implicit Variables. (line 150) 4391 * | (automatic variable): Automatic Variables. (line 69) 4392 4393 -
trunk/src/gmake/doc/make.texi
r281 r503 2 2 @c %**start of header 3 3 @setfilename make.info 4 5 @include version.texi 6 @set EDITION 0.70 7 @set RCSID $Id: make.texi,v 1.45 2006/04/01 06:36:40 psmith Exp $ 8 4 9 @settitle GNU @code{make} 5 10 @setchapternewpage odd 6 @c %**end of header7 8 @c FSF publishers: format makebook.texi instead of using this file directly.9 10 @set RCSID $Id: make.texi,v 1.30 2005/05/13 12:45:31 psmith Exp $11 @set EDITION 0.7012 @set VERSION 3.8113 @set UPDATED 07 May 200514 @set UPDATE-MONTH May 200515 @c ISBN provided by Lisa M. Opus Goldstein <opus@gnu.org>, 5 May 200416 @set ISBN 1-882114-83-517 18 @c finalout19 20 @c ISPELL CHECK: done, 10 June 1993 --roland21 @c ISPELL CHECK: done, 2000-06-25 --Martin Buchholz22 23 11 @c Combine the variable and function indices: 24 12 @syncodeindex vr fn 25 13 @c Combine the program and concept indices: 26 14 @syncodeindex pg cp 15 @c FSF publishers: format makebook.texi instead of using this file directly. 16 @c ISBN provided by Lisa M. Opus Goldstein <opus@gnu.org>, 5 May 2004 17 @set ISBN 1-882114-83-5 18 @c %**end of header 19 20 @copying 21 This file documents the GNU @code{make} utility, which determines 22 automatically which pieces of a large program need to be recompiled, 23 and issues the commands to recompile them. 24 25 This is Edition @value{EDITION}, last updated @value{UPDATED}, 26 of @cite{The GNU Make Manual}, for GNU @code{make} version @value{VERSION}. 27 28 Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 29 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006 30 Free Software Foundation, Inc. 31 32 @quotation 33 Permission is granted to copy, distribute and/or modify this document 34 under the terms of the GNU Free Documentation License, Version 1.2 or 35 any later version published by the Free Software Foundation; with no 36 Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,'' 37 and with the Back-Cover Texts as in (a) below. A copy of the 38 license is included in the section entitled ``GNU Free Documentation 39 License.'' 40 41 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify 42 this GNU Manual, like GNU software. Copies published by the Free 43 Software Foundation raise funds for GNU development.'' 44 @end quotation 45 @end copying 46 47 @c finalout 48 49 @c ISPELL CHECK: done, 10 June 1993 --roland 50 @c ISPELL CHECK: done, 2000-06-25 --Martin Buchholz 51 27 52 28 53 @dircategory GNU Packages … … 30 55 * Make: (make). Remake files automatically. 31 56 @end direntry 32 33 @ifnottex34 This file documents the GNU Make utility, which determines35 automatically which pieces of a large program need to be recompiled,36 and issues the commands to recompile them.37 38 This is Edition @value{EDITION}, last updated @value{UPDATED},39 of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.40 41 Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,42 1998, 1999, 2000, 2002, 2003, 2004, 200543 Free Software Foundation, Inc.44 45 Permission is granted to copy, distribute and/or modify this document46 under the terms of the GNU Free Documentation License, Version 1.1 or47 any later version published by the Free Software Foundation; with no48 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover49 Texts. A copy of the license is included in the section entitled50 ``GNU Free Documentation License''.51 @end ifnottex52 57 53 58 @iftex … … 58 63 @subtitle A Program for Directing Recompilation 59 64 @subtitle GNU @code{make} Version @value{VERSION} 60 @subtitle @value{UPDATE -MONTH}65 @subtitle @value{UPDATED-MONTH} 61 66 @author Richard M. Stallman, Roland McGrath, Paul D. Smith 62 67 @page 63 68 @vskip 0pt plus 1filll 64 Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 65 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. 69 @insertcopying 66 70 @sp 2 67 71 Published by the Free Software Foundation @* 68 5 9 Temple Place -- Suite 330,@*69 Boston, MA 0211 1-1307USA @*72 51 Franklin St. -- Fifth Floor @* 73 Boston, MA 02110-1301 USA @* 70 74 ISBN @value{ISBN} @* 71 72 Permission is granted to copy, distribute and/or modify this document73 under the terms of the GNU Free Documentation License, Version 1.1 or74 any later version published by the Free Software Foundation; with the75 Invariant Sections being ``GNU General Public License'', the Front-Cover76 Texts being ``A GNU Manual'', and with the Back-Cover Texts being as in77 (a) below. A copy of the license is included in the section entitled78 ``GNU Free Documentation License''.79 80 (a) The FSF's Back-Cover Text is:81 82 @quotation83 You have freedom to copy and modify this GNU Manual, like GNU84 software. Copies published by the Free Software Foundation raise85 funds for GNU development.86 @end quotation87 75 @sp 2 88 76 Cover art by Etienne Suvasa. 89 77 @end titlepage 90 @page 78 79 @summarycontents 80 @contents 91 81 92 82 @ifnottex 93 83 @node Top, Overview, (dir), (dir) 94 @top Make 95 96 The GNU @code{make} utility automatically determines which pieces of a 97 large program need to be recompiled, and issues the commands to 98 recompile them.@refill 99 100 This edition of the @cite{GNU Make Manual}, 101 last updated @value{UPDATED}, 102 documents GNU @code{make} Version @value{VERSION}.@refill 103 104 This manual describes @code{make} and contains the following chapters:@refill 84 @top GNU @code{make} 85 86 @insertcopying 105 87 @end ifnottex 106 88 … … 174 156 * Phony Targets:: Using a target that is not a real file's name. 175 157 * Force Targets:: You can use a target without commands 176 or prerequisites to mark other 177 targetsas phony.158 or prerequisites to mark other targets 159 as phony. 178 160 * Empty Targets:: When only the date matters and the 179 161 files are empty. … … 215 197 Writing the Commands in Rules 216 198 199 * Command Syntax:: Command syntax features and pitfalls. 217 200 * Echoing:: How to control when commands are echoed. 218 201 * Execution:: How commands are executed. … … 223 206 * Sequences:: Defining canned sequences of commands. 224 207 * Empty Commands:: Defining useful, do-nothing commands. 208 209 Command Syntax 210 211 * Splitting Lines:: Breaking long command lines for readability. 212 * Variables in Commands:: Using @code{make} variables in commands. 213 214 Command Execution 215 216 * Choosing the Shell:: How @code{make} chooses the shell used 217 to run commands. 225 218 226 219 Recursive Use of @code{make} … … 268 261 * Text Functions:: General-purpose text manipulation functions. 269 262 * File Name Functions:: Functions for manipulating file names. 263 * Conditional Functions:: Functions that implement conditions. 270 264 * Foreach Function:: Repeat some text with controlled variation. 271 * If Function:: Conditionally expand a value.272 265 * Call Function:: Expand a user-defined function. 273 266 * Value Function:: Return the un-expanded value of a variable. 274 267 * Eval Function:: Evaluate the arguments as makefile syntax. 275 268 * Origin Function:: Find where a variable got its value. 269 * Flavor Function:: Find out the flavor of a variable. 276 270 * Shell Function:: Substitute the output of a shell command. 277 271 * Make Control Functions:: Functions that control how make runs. … … 301 295 * Chained Rules:: How to use a chain of implicit rules. 302 296 * Pattern Rules:: How to define new implicit rules. 303 * Last Resort:: How to defin ing commands for rules304 whichcannot find any.297 * Last Resort:: How to define commands for rules which 298 cannot find any. 305 299 * Suffix Rules:: The old-fashioned style of implicit rule. 306 300 * Implicit Rule Search:: The precise algorithm for applying … … 330 324 331 325 * Archive Symbols:: How to update archive symbol directories. 332 333 Makefile Conventions334 335 * Makefile Basics:: General Conventions for Makefiles336 * Utilities in Makefiles:: Utilities in Makefiles337 * Command Variables:: Variables for Specifying Commands338 * Directory Variables:: Variables for Installation Directories339 * Standard Targets:: Standard Targets for Users340 * Install Command Categories:: Three categories of commands in the `install'341 326 342 327 @end detailmenu … … 1100 1085 1101 1086 @noindent 1102 @var{filenames} can contain shell file name patterns. 1087 @var{filenames} can contain shell file name patterns. If 1088 @var{filenames} is empty, nothing is included and no error is printed. 1103 1089 @cindex shell file name pattern (in @code{include}) 1104 1090 @cindex shell wildcards (in @code{include}) … … 1289 1275 @code{.DEFAULT_GOAL} variable allows you to discover the current 1290 1276 default goal, restart the default goal selection algorithm by clearing 1291 its value, or to explicitly set the default goal. The following1277 its value, or to explicitly set the default goal. The following 1292 1278 example illustrates these cases: 1293 1279 … … 1330 1316 Note that assigning more than one target name to @code{.DEFAULT_GOAL} is 1331 1317 illegal and will result in an error. 1318 1319 @vindex MAKE_RESTARTS @r{(number of times @code{make} has restarted)} 1320 @item MAKE_RESTARTS 1321 This variable is set only if this instance of @code{make} has 1322 restarted (@pxref{Remaking Makefiles, , How Makefiles Are Remade}): it 1323 will contain the number of times this instance has restarted. Note 1324 this is not the same as recursion (counted by the @code{MAKELEVEL} 1325 variable). You should not set, modify, or export this variable. 1332 1326 1333 1327 @vindex .VARIABLES @r{(list of variables)} … … 1357 1351 1358 1352 @table @samp 1353 1354 @item archives 1355 Supports @code{ar} (archive) files using special filename syntax. 1356 @xref{Archives, ,Using @code{make} to Update Archive Files}. 1357 1358 @item check-symlink 1359 Supports the @code{-L} (@code{--check-symlink-times}) flag. 1360 @xref{Options Summary, ,Summary of Options}. 1361 1362 @item else-if 1363 Supports ``else if'' non-nested conditionals. @xref{Conditional 1364 Syntax, ,Syntax of Conditionals}. 1365 1366 @item jobserver 1367 Supports ``job server'' enhanced parallel builds. @xref{Parallel, 1368 ,Parallel Execution}. 1369 1370 @item second-expansion 1371 Supports secondary expansion of prerequisite lists. 1372 1373 @item order-only 1374 Supports order-only prerequisites. @xref{Prerequisite Types, ,Types 1375 of Prerequisites}. 1376 1359 1377 @item target-specific 1360 1378 Supports target-specific and pattern-specific variable assignments. 1361 1379 @xref{Target-specific, ,Target-specific Variable Values}. 1362 1380 1363 @item order-only1364 Supports order-only prerequisites. @xref{Prerequisite Types, ,Types1365 of Prerequisites}.1366 1367 @item second-expansion1368 Supports secondary expansion of prerequisite lists.1369 1370 @item jobserver1371 Supports ``job server'' enhanced parallel builds. @xref{Parallel,1372 ,Parallel Execution}.1373 1374 @item check-symlink1375 Supports the @code{-L} (@code{--check-symlink-times}) flag.1376 @xref{Options Summary, ,Summary of Options}.1377 1378 1381 @end table 1382 1383 @vindex .INCLUDE_DIRS @r{(list of include directories)} 1384 @item .INCLUDE_DIRS 1385 Expands to a list of directories that @code{make} searches for 1386 included makefiles (@pxref{Include, , Including Other Makefiles}). 1379 1387 1380 1388 @end table … … 1600 1608 @cindex expansion, secondary 1601 1609 1610 @findex .SECONDEXPANSION 1602 1611 In the previous section we learned that GNU @code{make} works in two 1603 1612 distinct phases: a read-in phase and a target-update phase 1604 (@pxref{Reading Makefiles, , How @code{make} Reads a Makefile}). 1605 There is an extra wrinkle that comes in between those two phases, 1606 right at the end of the read-in phase: at that time, all the 1607 prerequisites of all of the targets are expanded a @emph{second time}. 1608 In most circumstances this secondary expansion will have no effect, 1609 since all variable and function references will have been expanded 1610 during the initial parsing of the makefiles. In order to take 1611 advantage of the secondary expansion phase of the parser, then, it's 1612 necessary to @emph{escape} the variable or function reference in the 1613 makefile. In this case the first expansion merely un-escapes the 1614 reference but doesn't expand it, and expansion is left to the 1615 secondary expansion phase. For example, consider this makefile: 1616 1617 @example 1613 (@pxref{Reading Makefiles, , How @code{make} Reads a Makefile}). GNU 1614 make also has the ability to enable a @emph{second expansion} of the 1615 prerequisites (only) for some or all targets defined in the makefile. 1616 In order for this second expansion to occur, the special target 1617 @code{.SECONDEXPANSION} must be defined before the first prerequisite 1618 list that makes use of this feature. 1619 1620 If that special target is defined then in between the two phases 1621 mentioned above, right at the end of the read-in phase, all the 1622 prerequisites of the targets defined after the special target are 1623 expanded a @emph{second time}. In most circumstances this secondary 1624 expansion will have no effect, since all variable and function 1625 references will have been expanded during the initial parsing of the 1626 makefiles. In order to take advantage of the secondary expansion 1627 phase of the parser, then, it's necessary to @emph{escape} the 1628 variable or function reference in the makefile. In this case the 1629 first expansion merely un-escapes the reference but doesn't expand it, 1630 and expansion is left to the secondary expansion phase. For example, 1631 consider this makefile: 1632 1633 @example 1634 .SECONDEXPANSION: 1618 1635 ONEVAR = onefile 1619 1636 TWOVAR = twofile … … 1639 1656 1640 1657 @example 1658 .SECONDEXPANSION: 1641 1659 AVAR = top 1642 1660 onefile: $(AVAR) … … 1658 1676 defer the expansion by escaping the @code{$}. Also, secondary 1659 1677 expansion occurs for both explicit and implicit (pattern) rules. 1660 Knowing this, the possible uses for this feature are almost endless. 1661 For example: 1662 1663 @example 1678 Knowing this, the possible uses for this feature increase 1679 dramatically. For example: 1680 1681 @example 1682 .SECONDEXPANSION: 1664 1683 main_OBJS := main.o try.o test.o 1665 1684 lib_OBJS := lib.o api.o … … 1682 1701 lib_SRCS := lib.c api.c 1683 1702 1703 .SECONDEXPANSION: 1684 1704 main lib: $$(patsubst %.c,%.o,$$($$@@_SRCS)) 1685 1705 @end example … … 1708 1728 of all prerequisites of rules @emph{that have already appeared} for 1709 1729 the same target (@code{$$+} with repetitions and @code{$$^} 1710 without). The following example will help illustrate these behaviors: 1711 1712 @example 1730 without). The following example will help illustrate these behaviors: 1731 1732 @example 1733 .SECONDEXPANSION: 1734 1713 1735 foo: foo.1 bar.1 $$< $$^ $$+ # line #1 1714 1736 … … 1718 1740 @end example 1719 1741 1720 For the first line, all three variables (@code{$$<}, @code{$$^}, and 1721 @code{$$ +}) expand to the empty string. For the second line, they will1722 have values @code{foo.1}, @code{foo.1 bar.1}, and @code{foo.1 bar.1} 1723 respectively. For the third they will have values @code{foo.1}, 1724 @code{foo.1 bar.1 foo.2 bar.2}, and @code{foo.1 bar.1 foo.2 bar.2}1725 respectively.1742 In the first prerequisite list, all three variables (@code{$$<}, 1743 @code{$$^}, and @code{$$+}) expand to the empty string. In the 1744 second, they will have values @code{foo.1}, @code{foo.1 bar.1}, and 1745 @code{foo.1 bar.1} respectively. In the third they will have values 1746 @code{foo.1}, @code{foo.1 bar.1 foo.2 bar.2}, and @code{foo.1 bar.1 1747 foo.2 bar.2} respectively. 1726 1748 1727 1749 Rules undergo secondary expansion in makefile order, except that … … 1751 1773 1752 1774 @example 1775 .SECONDEXPANSION: 1776 1753 1777 foo: bar 1754 1778 … … 1769 1793 1770 1794 @example 1795 .SECONDEXPANSION: 1796 1771 1797 /tmp/foo.o: 1772 1798 … … 1816 1842 * Phony Targets:: Using a target that is not a real file's name. 1817 1843 * Force Targets:: You can use a target without commands 1818 or prerequisites to mark other 1819 targetsas phony.1844 or prerequisites to mark other targets 1845 as phony. 1820 1846 * Empty Targets:: When only the date matters and the 1821 1847 files are empty. … … 1901 1927 appear on the line after the prerequisites, with a tab character, or may 1902 1928 appear on the same line, with a semicolon. Either way, the effect is the 1903 same. @xref{Commands, ,Writing the Commands in Rules}. 1929 same. There are other differences in the syntax of command lines. 1930 @xref{Commands, ,Writing the Commands in Rules}. 1904 1931 1905 1932 @cindex dollar sign (@code{$}), in rules 1906 1933 @cindex @code{$}, in rules 1907 @cindex rule, and @code{$} 1908 Because dollar signs are used to start variable references, if you really 1909 want a dollar sign in a rule you must write two of them, @samp{$$} 1910 (@pxref{Using Variables, ,How to Use Variables}). In prerequisite 1911 lists you must actually write @emph{four} dollar signs (@samp{$$$$}), 1912 due to secondary expansion (@pxref{Secondary Expansion}). 1913 You may split a long line by inserting a backslash 1914 followed by a newline, but this is not required, as @code{make} places no 1915 limit on the length of a line in a makefile. 1934 @cindex rules, and @code{$} 1935 Because dollar signs are used to start @code{make} variable 1936 references, if you really want a dollar sign in a target or 1937 prerequisite you must write two of them, @samp{$$} (@pxref{Using 1938 Variables, ,How to Use Variables}). If you have enabled secondary 1939 expansion (@pxref{Secondary Expansion}) and you want a literal dollar 1940 sign in the prerequisites lise, you must actually write @emph{four} 1941 dollar signs (@samp{$$$$}). 1942 1943 You may split a long line by inserting a backslash followed by a 1944 newline, but this is not required, as @code{make} places no limit on 1945 the length of a line in a makefile. 1916 1946 1917 1947 A rule tells @code{make} two things: when the targets are out of date, … … 2004 2034 @var{HOME}.@refill 2005 2035 2006 Wildcard expansion happens automatically in targets, in prerequisites,2007 and in commands (where the shell does the expansion). In other 2008 contexts, wildcard expansion happens only if you request it explicitly 2009 with the @code{wildcard} function.2036 Wildcard expansion is performed by @code{make} automatically in 2037 targets and in prerequisites. In commands the shell is responsible 2038 for wildcard expansion. In other contexts, wildcard expansion happens 2039 only if you request it explicitly with the @code{wildcard} function. 2010 2040 2011 2041 The special significance of a wildcard character can be turned off by … … 2553 2583 word in the list will be used. 2554 2584 2555 The default value for @code{.LIBPATTERNS} is ``@samp{lib%.so lib%.a}'',2585 The default value for @code{.LIBPATTERNS} is @samp{lib%.so lib%.a}, 2556 2586 which provides the default behavior described above. 2557 2587 … … 2644 2674 it will do so even if @code{make} is invoked with the @code{-k} option, 2645 2675 which is unfortunate. Second, and perhaps more importantly, you cannot 2646 take advantage of the parallel build capabilities of make using this2647 method, since there is only one rule.2676 take advantage of @code{make}'s ability to build targets in parallel 2677 (@pxref{Parallel, ,Parallel Execution}), since there is only one rule. 2648 2678 2649 2679 By declaring the subdirectories as phony targets (you must do this as … … 2867 2897 as secondary (i.e., no target is removed because it is considered 2868 2898 intermediate). 2899 2900 @findex .SECONDEXPANSION 2901 @item .SECONDEXPANSION 2902 2903 If @code{.SECONDEXPANSION} is mentioned as a target anywhere in the 2904 makefile, then all prerequisite lists defined @emph{after} it appears 2905 will be expanded a second time after all makefiles have been read in. 2906 @xref{Secondary Expansion, ,Secondary Expansion}. 2907 2908 The prerequisites of the special target @code{.SUFFIXES} are the list 2909 of suffixes to be used in checking for suffix rules. 2910 @xref{Suffix Rules, , Old-Fashioned Suffix Rules}. 2869 2911 2870 2912 @findex .DELETE_ON_ERROR … … 3376 3418 @group 3377 3419 %.d: %.c 3378 @ set -e; rm -f $@@; \3420 @@set -e; rm -f $@@; \ 3379 3421 $(CC) -M $(CPPFLAGS) $< > $@@.$$$$; \ 3380 3422 sed 's,\($*\)\.o[ :]*,\1.o $@@ : ,g' < $@@.$$$$ > $@@; \ … … 3449 3491 @cindex writing rule commands 3450 3492 3451 The commands of a rule consist of shell command lines to be executed one 3452 by one. Each command line must start with a tab, except that the first 3453 command line may be attached to the target-and-prerequisites line with a 3454 semicolon in between. Blank lines and lines of just comments may appear 3455 among the command lines; they are ignored. (But beware, an apparently 3456 ``blank'' line that begins with a tab is @emph{not} blank! It is an 3457 empty command; @pxref{Empty Commands}.) 3493 The commands of a rule consist of one or more shell command lines to 3494 be executed, one at a time, in the order they appear. Typically, the 3495 result of executing these commands is that the target of the rule is 3496 brought up to date. 3458 3497 3459 3498 Users use many different shell programs, but commands in makefiles are … … 3461 3500 otherwise. @xref{Execution, ,Command Execution}. 3462 3501 3463 @cindex comments, in commands3464 @cindex commands, comments in3465 @cindex @code{#} (comments), in commands3466 The shell that is in use determines whether comments can be written on3467 command lines, and what syntax they use. When the shell is3468 @file{/bin/sh}, a @samp{#} starts a comment that extends to the end of3469 the line. The @samp{#} does not have to be at the beginning of a line.3470 Text on a line before a @samp{#} is not part of the comment.3471 3472 3502 @menu 3503 * Command Syntax:: Command syntax features and pitfalls. 3473 3504 * Echoing:: How to control when commands are echoed. 3474 3505 * Execution:: How commands are executed. … … 3481 3512 @end menu 3482 3513 3483 @node Echoing, Execution, Commands, Commands 3514 @node Command Syntax, Echoing, Commands, Commands 3515 @section Command Syntax 3516 @cindex command syntax 3517 @cindex syntax of commands 3518 3519 Makefiles have the unusual property that there are really two distinct 3520 syntaxes in one file. Most of the makefile uses @code{make} syntax 3521 (@pxref{Makefiles, ,Writing Makefiles}). However, commands are meant to be 3522 interpreted by the shell and so they are written using shell syntax. 3523 The @code{make} program does not try to understand shell syntax: it 3524 performs only a very few specific translations on the content of the 3525 command before handing it to the shell. 3526 3527 Each command line must start with a tab, except that the first command 3528 line may be attached to the target-and-prerequisites line with a 3529 semicolon in between. @emph{Any} line in the makefile that begins 3530 with a tab and appears in a ``rule context'' (that is, after a rule 3531 has been started until another rule or variable definition) will be 3532 considered a command line for that rule. Blank lines and lines of 3533 just comments may appear among the command lines; they are ignored. 3534 3535 Some consequences of these rules include: 3536 3537 @itemize @bullet 3538 @item 3539 A blank line that begins with a tab is not blank: it's an empty 3540 command (@pxref{Empty Commands}). 3541 3542 @cindex comments, in commands 3543 @cindex commands, comments in 3544 @cindex @code{#} (comments), in commands 3545 @item 3546 A comment in a command line is not a @code{make} comment; it will be 3547 passed to the shell as-is. Whether the shell treats it as a comment 3548 or not depends on your shell. 3549 3550 @item 3551 A variable definition in a ``rule context'' which is indented by a tab 3552 as the first character on the line, will be considered a command line, 3553 not a @code{make} variable definition, and passed to the shell. 3554 3555 @item 3556 A conditional expression (@code{ifdef}, @code{ifeq}, 3557 etc. @pxref{Conditional Syntax, ,Syntax of Conditionals}) in a ``rule 3558 context'' which is indented by a tab as the first character on the 3559 line, will be considered a command line and be passed to the shell. 3560 3561 @end itemize 3562 3563 @menu 3564 * Splitting Lines:: Breaking long command lines for readability. 3565 * Variables in Commands:: Using @code{make} variables in commands. 3566 @end menu 3567 3568 @node Splitting Lines, Variables in Commands, Command Syntax, Command Syntax 3569 @subsection Splitting Command Lines 3570 @cindex commands, splitting 3571 @cindex splitting commands 3572 @cindex commands, backslash (@code{\}) in 3573 @cindex commands, quoting newlines in 3574 @cindex backslash (@code{\}), in commands 3575 @cindex @code{\} (backslash), in commands 3576 @cindex quoting newline, in commands 3577 @cindex newline, quoting, in commands 3578 3579 One of the few ways in which @code{make} does interpret command lines 3580 is checking for a backslash just before the newline. As in normal 3581 makefile syntax, a single command can be split into multiple lines in 3582 the makefile by placing a backslash before each newline. A sequence 3583 of lines like this is considered a single command, and one instance of 3584 the shell will be invoked to run it. 3585 3586 However, in contrast to how they are treated in other places in a 3587 makefile, backslash-newline pairs are @emph{not} removed from the 3588 command. Both the backslash and the newline characters are preserved 3589 and passed to the shell. How the backslash-newline is interpreted 3590 depends on your shell. If the first character of the next line 3591 after the backslash-newline is a tab, then that tab (and only that 3592 tab) is removed. Whitespace is never added to the command. 3593 3594 For example, this makefile: 3595 3596 @example 3597 @group 3598 all : 3599 @@echo no\ 3600 space 3601 @@echo no\ 3602 space 3603 @@echo one \ 3604 space 3605 @@echo one\ 3606 space 3607 @end group 3608 @end example 3609 3610 @noindent 3611 consists of four separate shell commands where the output is: 3612 3613 @example 3614 @group 3615 nospace 3616 nospace 3617 one space 3618 one space 3619 @end group 3620 @end example 3621 3622 As a more complex example, this makefile: 3623 3624 @example 3625 @group 3626 all : ; @@echo 'hello \ 3627 world' ; echo "hello \ 3628 world" 3629 @end group 3630 @end example 3631 3632 @noindent 3633 will run one shell with a command script of: 3634 3635 @example 3636 @group 3637 echo 'hello \ 3638 world' ; echo "hello \ 3639 world" 3640 @end group 3641 @end example 3642 3643 @noindent 3644 which, according to shell quoting rules, will yield the following output: 3645 3646 @example 3647 @group 3648 hello \ 3649 world 3650 hello world 3651 @end group 3652 @end example 3653 3654 @noindent 3655 Notice how the backslash/newline pair was removed inside the string quoted 3656 with double quotes (@code{"..."}), but not from the string quoted with single 3657 quotes (@code{'...'}). This is the way the default shell (@file{/bin/sh}) 3658 handles backslash/newline pairs. If you specify a different shell in your 3659 makefiles it may treat them differently. 3660 3661 Sometimes you want to split a long line inside of single quotes, but 3662 you don't want the backslash-newline to appear in the quoted content. 3663 This is often the case when passing scripts to languages such as Perl, 3664 where extraneous backslashes inside the script can change its meaning 3665 or even be a syntax error. One simple way of handling this is to 3666 place the quoted string, or even the entire command, into a 3667 @code{make} variable then use the variable in the command. In this 3668 situation the newline quoting rules for makefiles will be used, and 3669 the backslash-newline will be removed. If we rewrite our example 3670 above using this method: 3671 3672 @example 3673 @group 3674 HELLO = 'hello \ 3675 world' 3676 3677 all : ; @@echo $(HELLO) 3678 @end group 3679 @end example 3680 3681 @noindent 3682 we will get output like this: 3683 3684 @example 3685 @group 3686 hello world 3687 @end group 3688 @end example 3689 3690 If you like, you can also use target-specific variables 3691 (@pxref{Target-specific, ,Target-specific Variable Values}) to obtain 3692 a tighter correspondence between the variable and the command that 3693 uses it. 3694 3695 @node Variables in Commands, , Splitting Lines, Command Syntax 3696 @subsection Using Variables in Commands 3697 @cindex variable references in commands 3698 @cindex commands, using variables in 3699 3700 The other way in which @code{make} processes commands is by expanding 3701 any variable references in them (@pxref{Reference,Basics of Variable 3702 References}). This occurs after make has finished reading all the 3703 makefiles and the target is determined to be out of date; so, the 3704 commands for targets which are not rebuilt are never expanded. 3705 3706 Variable and function references in commands have identical syntax and 3707 semantics to references elsewhere in the makefile. They also have the 3708 same quoting rules: if you want a dollar sign to appear in your 3709 command, you must double it (@samp{$$}). For shells like the default 3710 shell, that use dollar signs to introduce variables, it's important to 3711 keep clear in your mind whether the variable you want to reference is 3712 a @code{make} variable (use a single dollar sign) or a shell variable 3713 (use two dollar signs). For example: 3714 3715 @example 3716 @group 3717 LIST = one two three 3718 all: 3719 for i in $(LIST); do \ 3720 echo $$i; \ 3721 done 3722 @end group 3723 @end example 3724 3725 @noindent 3726 results in the following command being passed to the shell: 3727 3728 @example 3729 @group 3730 for i in one two three; do \ 3731 echo $i; \ 3732 done 3733 @end group 3734 @end example 3735 3736 @noindent 3737 which generates the expected result: 3738 3739 @example 3740 @group 3741 one 3742 two 3743 three 3744 @end group 3745 @end example 3746 3747 @node Echoing, Execution, Command Syntax, Commands 3484 3748 @section Command Echoing 3485 3749 @cindex echoing of commands … … 3530 3794 @cindex execution, of commands 3531 3795 @cindex shell command, execution 3532 @vindex SHELL @r{(command execution)} 3533 3534 When it is time to execute commands to update a target, they are executed 3535 by making a new subshell for each line. (In practice, @code{make} may 3536 take shortcuts that do not affect the results.) 3796 @vindex @code{SHELL} @r{(command execution)} 3797 3798 When it is time to execute commands to update a target, they are 3799 executed by invoking a new subshell for each command line. (In 3800 practice, @code{make} may take shortcuts that do not affect the 3801 results.) 3537 3802 3538 3803 @cindex @code{cd} (shell command) 3539 @strong{Please note:} this implies that shell commands such as @code{cd} 3540 that set variables local to each process will not affect the following 3541 command lines. @footnote{On MS-DOS, the value of current working 3542 directory is @strong{global}, so changing it @emph{will} affect the 3543 following command lines on those systems.} If you want to use @code{cd} 3544 to affect the next command, put the two on a single line with a 3545 semicolon between them. Then @code{make} will consider them a single 3546 command and pass them, together, to a shell which will execute them in 3547 sequence. For example: 3804 @cindex shell variables, setting in commands 3805 @cindex commands setting shell variables 3806 @strong{Please note:} this implies that setting shell variables and 3807 invoking shell commands such as @code{cd} that set a context local to 3808 each process will not affect the following command lines.@footnote{On 3809 MS-DOS, the value of current working directory is @strong{global}, so 3810 changing it @emph{will} affect the following command lines on those 3811 systems.} If you want to use @code{cd} to affect the next statement, 3812 put both statements in a single command line. Then @code{make} will 3813 invoke one shell to run the entire line, and the shell will execute 3814 the statements in sequence. For example: 3548 3815 3549 3816 @example 3550 3817 foo : bar/lose 3551 cd bar; gobble lose > ../foo 3552 @end example 3553 3554 @cindex commands, backslash (@code{\}) in 3555 @cindex commands, quoting newlines in 3556 @cindex backslash (@code{\}), in commands 3557 @cindex @code{\} (backslash), in commands 3558 @cindex quoting newline, in commands 3559 @cindex newline, quoting, in commands 3560 If you would like to split a single shell command into multiple lines of 3561 text, you must use a backslash at the end of all but the last subline. 3562 Such a sequence of lines is combined into a single line, by deleting the 3563 backslash-newline sequences, before passing it to the shell. Thus, the 3564 following is equivalent to the preceding example: 3565 3566 @example 3567 @group 3568 foo : bar/lose 3569 cd bar; \ 3570 gobble lose > ../foo 3571 @end group 3572 @end example 3818 cd $(@@D) && gobble $(@@F) > ../$@@ 3819 @end example 3820 3821 @noindent 3822 Here we use the shell AND operator (@code{&&}) so that if the 3823 @code{cd} command fails, the script will fail without trying to invoke 3824 the @code{gobble} command in the wrong directory, which could cause 3825 problems (in this case it would certainly cause @file{../foo} to be 3826 truncated, at least). 3827 3828 @menu 3829 * Choosing the Shell:: How @code{make} chooses the shell used 3830 to run commands. 3831 @end menu 3832 3833 @node Choosing the Shell, , Execution, Execution 3834 @subsection Choosing the Shell 3835 @cindex shell, choosing the 3836 @cindex @code{SHELL}, value of 3573 3837 3574 3838 @vindex SHELL 3575 3839 The program used as the shell is taken from the variable @code{SHELL}. 3576 By default, the program @file{/bin/sh} is used. 3840 If this variable is not set in your makefile, the program 3841 @file{/bin/sh} is used as the shell. 3842 3843 @cindex environment, @code{SHELL} in 3844 Unlike most variables, the variable @code{SHELL} is never set from the 3845 environment. This is because the @code{SHELL} environment variable is 3846 used to specify your personal choice of shell program for interactive 3847 use. It would be very bad for personal choices like this to affect the 3848 functioning of makefiles. @xref{Environment, ,Variables from the 3849 Environment}. 3850 3851 Furthermore, when you do set @code{SHELL} in your makefile that value 3852 is @emph{not} exported in the environment to commands that @code{make} 3853 invokes. Instead, the value inherited from the user's environment, if 3854 any, is exported. You can override this behavior by explicitly 3855 exporting @code{SHELL} (@pxref{Variables/Recursion, ,Communicating 3856 Variables to a Sub-@code{make}}), forcing it to be passed in the 3857 environment to commands. 3858 3859 @vindex @code{MAKESHELL} @r{(MS-DOS alternative to @code{SHELL})} 3860 However, on MS-DOS and MS-Windows the value of @code{SHELL} in the 3861 environment @strong{is} used, since on those systems most users do not 3862 set this variable, and therefore it is most likely set specifically to 3863 be used by @code{make}. On MS-DOS, if the setting of @code{SHELL} is 3864 not suitable for @code{make}, you can set the variable 3865 @code{MAKESHELL} to the shell that @code{make} should use; if set it 3866 will be used as the shell instead of the value of @code{SHELL}. 3867 3868 @subsubheading Choosing a Shell in DOS and Windows 3869 @cindex shell, in DOS and Windows 3870 @cindex DOS, choosing a shell in 3871 @cindex Windows, choosing a shell in 3872 3873 Choosing a shell in MS-DOS and MS-Windows is much more complex than on 3874 other systems. 3577 3875 3578 3876 @vindex COMSPEC … … 3628 3926 3629 3927 The effect of the above DOS-specific processing is that a Makefile that 3630 says @samp{SHELL = /bin/sh} (as many Unix makefiles do), will work3631 on MS-DOS unaltered if you have e.g. @file{sh.exe} installed in some3928 contains @samp{SHELL = /bin/sh} (as many Unix makefiles do), will work 3929 on MS-DOS unaltered if you have e.g.@: @file{sh.exe} installed in some 3632 3930 directory along your @code{PATH}. 3633 3634 @cindex environment, @code{SHELL} in3635 @vindex MAKESHELL @r{(MS-DOS alternative to @code{SHELL})}3636 Unlike most variables, the variable @code{SHELL} is never set from the3637 environment. This is because the @code{SHELL} environment variable is3638 used to specify your personal choice of shell program for interactive3639 use. It would be very bad for personal choices like this to affect the3640 functioning of makefiles. @xref{Environment, ,Variables from the3641 Environment}. However, on MS-DOS and MS-Windows the value of3642 @code{SHELL} in the environment @strong{is} used, since on those systems3643 most users do not set this variable, and therefore it is most likely set3644 specifically to be used by @code{make}. On MS-DOS, if the setting of3645 @code{SHELL} is not suitable for @code{make}, you can set the variable3646 @code{MAKESHELL} to the shell that @code{make} should use; this will3647 override the value of @code{SHELL}.3648 3931 3649 3932 @node Parallel, Errors, Execution, Commands … … 4015 4298 environment is passed to the sub-@code{make}. You can force 4016 4299 @code{make} to export its value for @code{SHELL} by using the 4017 @code{export} directive, described below. 4300 @code{export} directive, described below. @xref{Choosing the Shell}. 4018 4301 4019 4302 The special variable @code{MAKEFLAGS} is always exported (unless you … … 4712 4995 @group 4713 4996 ifeq (0,$@{MAKELEVEL@}) 4714 cur-dir := $(shell pwd)4715 4997 whoami := $(shell whoami) 4716 4998 host-type := $(shell arch) … … 4727 5009 @group 4728 5010 $@{subdirs@}: 4729 $@{MAKE@} cur-dir=$@{cur-dir@}/$@@-C $@@ all5011 $@{MAKE@} -C $@@ all 4730 5012 @end group 4731 5013 @end example … … 5197 5479 simply-expanded definition, and expands the new text before appending it 5198 5480 to the old value just as @samp{:=} does 5199 ( @pxref{Setting, ,Setting Variables}, for a full explanation of @samp{:=}).5481 (see @ref{Setting, ,Setting Variables}, for a full explanation of @samp{:=}). 5200 5482 In fact, 5201 5483 … … 5438 5720 When @code{make} runs a command script, variables defined in the 5439 5721 makefile are placed into the environment of that command. This allows 5440 you to pass values to sub-@code{make} invocations .(@pxref{Recursion,5722 you to pass values to sub-@code{make} invocations (@pxref{Recursion, 5441 5723 ,Recursive Use of @code{make}}). By default, only variables that came 5442 5724 from the environment or the command line are passed to recursive … … 5452 5734 5453 5735 @cindex SHELL, import from environment 5454 Such problems would be especially likely with the variable @code{SHELL}, 5455 which is normally present in the environment to specify the user's choice 5456 of interactive shell. It would be very undesirable for this choice to 5457 affect @code{make}. So @code{make} ignores the environment value of 5458 @code{SHELL} (except on MS-DOS and MS-Windows, where @code{SHELL} is 5459 usually not set. @xref{Execution, ,Special handling of SHELL on 5460 MS-DOS}.)@refill 5461 5462 @cindex SHELL, export to environment 5463 The @code{SHELL} variable is special in another way: just as the value 5464 of the @code{make} variable @code{SHELL} is not taken from the 5465 environment, so also it is not placed into the environment of commands 5466 that @code{make} invokes. Instead, the value of @code{SHELL} from the 5467 invoking environment is provided to the command. You can use 5468 @code{export SHELL} to force the value of the @code{make} variable 5469 @code{SHELL} to be placed in the environment of commands. 5736 Such problems would be especially likely with the variable 5737 @code{SHELL}, which is normally present in the environment to specify 5738 the user's choice of interactive shell. It would be very undesirable 5739 for this choice to affect @code{make}; so, @code{make} handles the 5740 @code{SHELL} environment variable in a special way; see @ref{Choosing 5741 the Shell}.@refill 5470 5742 5471 5743 @node Target-specific, Pattern-specific, Environment, Using Variables … … 5515 5787 will be in effect. Note that this variable is actually distinct from 5516 5788 any ``global'' value: the two variables do not have to have the same 5517 flavor (recursive vs. static).5789 flavor (recursive vs.@: static). 5518 5790 5519 5791 Target-specific variables have the same priority as any other makefile … … 5526 5798 you define a target-specific variable that variable value is also in 5527 5799 effect for all prerequisites of this target, and all their 5528 prerequisites, etc. (unless those prerequisites override that variable5800 prerequisites, etc.@: (unless those prerequisites override that variable 5529 5801 with their own target-specific variable value). So, for example, a 5530 5802 statement like this: … … 5925 6197 * Text Functions:: General-purpose text manipulation functions. 5926 6198 * File Name Functions:: Functions for manipulating file names. 6199 * Conditional Functions:: Functions that implement conditions. 5927 6200 * Foreach Function:: Repeat some text with controlled variation. 5928 * If Function:: Conditionally expand a value.5929 6201 * Call Function:: Expand a user-defined function. 5930 6202 * Value Function:: Return the un-expanded value of a variable. 5931 6203 * Eval Function:: Evaluate the arguments as makefile syntax. 5932 6204 * Origin Function:: Find where a variable got its value. 6205 * Flavor Function:: Find out the flavor of a variable. 5933 6206 * Shell Function:: Substitute the output of a shell command. 5934 6207 * Make Control Functions:: Functions that control how make runs. … … 6345 6618 Directive, , The @code{override} Directive}). 6346 6619 6347 @node File Name Functions, Foreach Function, Text Functions, Functions6620 @node File Name Functions, Conditional Functions, Text Functions, Functions 6348 6621 @section Functions for File Names 6349 6622 @cindex functions, for file names … … 6505 6778 For each file name in @var{names} return the canonical absolute name. 6506 6779 A canonical name does not contain any @code{.} or @code{..} components, 6507 nor any repeated path separators (@code{/}) or symlinks. In case of a6508 failure the empty string is returned. Consult the @code{realpath(3)}6780 nor any repeated path separators (@code{/}) or symlinks. In case of a 6781 failure the empty string is returned. Consult the @code{realpath(3)} 6509 6782 documentation for a list of possible failure causes. 6510 6783 … … 6515 6788 For each file name in @var{names} return an absolute name that does 6516 6789 not contain any @code{.} or @code{..} components, nor any repeated path 6517 separators (@code{/}). Note thatin contrast to @code{realpath}6790 separators (@code{/}). Note that, in contrast to @code{realpath} 6518 6791 function, @code{abspath} does not resolve symlinks and does not require 6519 the file names to refer to an existing file or directory. Use the6792 the file names to refer to an existing file or directory. Use the 6520 6793 @code{wildcard} function to test for existence. 6521 6794 @end table 6522 6795 6523 @node Foreach Function, If Function, File Name Functions, Functions 6796 @node Conditional Functions, Foreach Function, File Name Functions, Functions 6797 @section Functions for Conditionals 6798 @findex if 6799 @cindex conditional expansion 6800 There are three functions that provide conditional expansion. A key 6801 aspect of these functions is that not all of the arguments are 6802 expanded initially. Only those arguments which need to be expanded, 6803 will be expanded. 6804 6805 @table @code 6806 @item $(if @var{condition},@var{then-part}[,@var{else-part}]) 6807 @findex if 6808 The @code{if} function provides support for conditional expansion in a 6809 functional context (as opposed to the GNU @code{make} makefile 6810 conditionals such as @code{ifeq} (@pxref{Conditional Syntax, ,Syntax of 6811 Conditionals}). 6812 6813 The first argument, @var{condition}, first has all preceding and 6814 trailing whitespace stripped, then is expanded. If it expands to any 6815 non-empty string, then the condition is considered to be true. If it 6816 expands to an empty string, the condition is considered to be false. 6817 6818 If the condition is true then the second argument, @var{then-part}, is 6819 evaluated and this is used as the result of the evaluation of the entire 6820 @code{if} function. 6821 6822 If the condition is false then the third argument, @var{else-part}, is 6823 evaluated and this is the result of the @code{if} function. If there is 6824 no third argument, the @code{if} function evaluates to nothing (the 6825 empty string). 6826 6827 Note that only one of the @var{then-part} or the @var{else-part} will be 6828 evaluated, never both. Thus, either can contain side-effects (such as 6829 @code{shell} function calls, etc.) 6830 6831 @item $(or @var{condition1}[,@var{condition2}[,@var{condition3}@dots{}]]) 6832 @findex or 6833 The @code{or} function provides a ``short-circuiting'' OR operation. 6834 Each argument is expanded, in order. If an argument expands to a 6835 non-empty string the processing stops and the result of the expansion 6836 is that string. If, after all arguments are expanded, all of them are 6837 false (empty), then the result of the expansion is the empty string. 6838 6839 @item $(and @var{condition1}[,@var{condition2}[,@var{condition3}@dots{}]]) 6840 @findex and 6841 The @code{and} function provides a ``short-circuiting'' AND operation. 6842 Each argument is expanded, in order. If an argument expands to an 6843 empty string the processing stops and the result of the expansion is 6844 the empty string. If all arguments expand to a non-empty string then 6845 the result of the expansion is the expansion of the last argument. 6846 6847 @end table 6848 6849 @node Foreach Function, Call Function, Conditional Functions, Functions 6524 6850 @section The @code{foreach} Function 6525 6851 @findex foreach … … 6609 6935 no?), but it is more likely to be a mistake. 6610 6936 6611 @node If Function, Call Function, Foreach Function, Functions 6612 @section The @code{if} Function 6613 @findex if 6614 @cindex conditional expansion 6615 6616 The @code{if} function provides support for conditional expansion in a 6617 functional context (as opposed to the GNU @code{make} makefile 6618 conditionals such as @code{ifeq} (@pxref{Conditional Syntax, ,Syntax of 6619 Conditionals}). 6620 6621 An @code{if} function call can contain either two or three arguments: 6622 6623 @example 6624 $(if @var{condition},@var{then-part}[,@var{else-part}]) 6625 @end example 6626 6627 The first argument, @var{condition}, first has all preceding and 6628 trailing whitespace stripped, then is expanded. If it expands to any 6629 non-empty string, then the condition is considered to be true. If it 6630 expands to an empty string, the condition is considered to be false. 6631 6632 If the condition is true then the second argument, @var{then-part}, is 6633 evaluated and this is used as the result of the evaluation of the entire 6634 @code{if} function. 6635 6636 If the condition is false then the third argument, @var{else-part}, is 6637 evaluated and this is the result of the @code{if} function. If there is 6638 no third argument, the @code{if} function evaluates to nothing (the 6639 empty string). 6640 6641 Note that only one of the @var{then-part} or the @var{else-part} will be 6642 evaluated, never both. Thus, either can contain side-effects (such as 6643 @code{shell} function calls, etc.) 6644 6645 @node Call Function, Value Function, If Function, Functions 6937 @node Call Function, Value Function, Foreach Function, Functions 6646 6938 @section The @code{call} Function 6647 6939 @findex call … … 6713 7005 6714 7006 The @code{call} function can be nested. Each recursive invocation gets 6715 its own local values for @code{$(1)}, etc. that mask the values of7007 its own local values for @code{$(1)}, etc.@: that mask the values of 6716 7008 higher-level @code{call}. For example, here is an implementation of a 6717 7009 @dfn{map} function: … … 6850 7142 @end example 6851 7143 6852 @node Origin Function, ShellFunction, Eval Function, Functions7144 @node Origin Function, Flavor Function, Eval Function, Functions 6853 7145 @section The @code{origin} Function 6854 7146 @findex origin … … 6959 7251 @xref{Text Functions, , Functions for String Substitution and Analysis}. 6960 7252 6961 @node Shell Function, Make Control Functions, Origin Function, Functions 7253 @node Flavor Function, Shell Function, Origin Function, Functions 7254 @section The @code{flavor} Function 7255 @findex flavor 7256 @cindex variables, flavor of 7257 @cindex flavor of variable 7258 7259 The @code{flavor} function is unlike most other functions (and like 7260 @code{origin} function) in that it does not operate on the values of 7261 variables; it tells you something @emph{about} a variable. 7262 Specifically, it tells you the flavor of a variable (@pxref{Flavors, 7263 ,The Two Flavors of Variables}). 7264 7265 The syntax of the @code{flavor} function is: 7266 7267 @example 7268 $(flavor @var{variable}) 7269 @end example 7270 7271 Note that @var{variable} is the @emph{name} of a variable to inquire about; 7272 not a @emph{reference} to that variable. Therefore you would not normally 7273 use a @samp{$} or parentheses when writing it. (You can, however, use a 7274 variable reference in the name if you want the name not to be a constant.) 7275 7276 The result of this function is a string that identifies the flavor of the 7277 variable @var{variable}: 7278 7279 @table @samp 7280 @item undefined 7281 7282 if @var{variable} was never defined. 7283 7284 @item recursive 7285 7286 if @var{variable} is a recursively expanded variable. 7287 7288 @item simple 7289 7290 if @var{variable} is a simply expanded variable. 7291 7292 @end table 7293 7294 7295 @node Shell Function, Make Control Functions, Flavor Function, Functions 6962 7296 @section The @code{shell} Function 6963 7297 @findex shell … … 6984 7318 spawning a new shell, you should carefully consider the performance 6985 7319 implications of using the @code{shell} function within recursively 6986 expanded variables vs. simply expanded variables (@pxref{Flavors, ,The7320 expanded variables vs.@: simply expanded variables (@pxref{Flavors, ,The 6987 7321 Two Flavors of Variables}). 6988 7322 … … 7084 7418 things and many others. 7085 7419 7420 @cindex exit status of make 7086 7421 The exit status of @code{make} is always one of three values: 7087 7422 @table @code … … 7550 7885 Consider all targets out-of-date. GNU @code{make} proceeds to 7551 7886 consider targets and their prerequisites using the normal algorithms; 7552 however, all these targets are remade, regardless of the status of 7553 their prerequisites. 7887 however, all targets so considered are always remade regardless of the 7888 status of their prerequisites. To avoid infinite recursion, if 7889 @code{MAKE_RESTARTS} (@pxref{Special Variables, , Other Special 7890 Variables}) is set to a number greater than 0 this option is disabled 7891 when considering whether to remake makefiles (@pxref{Remaking 7892 Makefiles, , How Makefiles Are Remade}). 7554 7893 7555 7894 @item -C @var{dir} … … 7907 8246 * Pattern Rules:: How to define new implicit rules. 7908 8247 * Last Resort:: How to define commands for rules which 7909 cannot find any.8248 cannot find any. 7910 8249 * Suffix Rules:: The old-fashioned style of implicit rule. 7911 8250 * Implicit Rule Search:: The precise algorithm for applying … … 8002 8341 @samp{--no-builtin-rules} option cancels all predefined rules. 8003 8342 8343 This manual only documents the default rules available on POSIX-based 8344 operating systems. Other operating systems, such as VMS, Windows, 8345 OS/2, etc. may have different sets of default rules. To see the full 8346 list of default rules and variables available in your version of GNU 8347 @code{make}, run @samp{make -p} in a directory with no makefile. 8348 8004 8349 Not all of these rules will always be defined, even when the @samp{-r} 8005 8350 option is not given. Many of the predefined implicit rules are … … 8008 8353 the special target @code{.SUFFIXES}). The default suffix list is: 8009 8354 @code{.out}, @code{.a}, @code{.ln}, @code{.o}, @code{.c}, @code{.cc}, 8010 @code{.C}, @code{. p}, @code{.f}, @code{.F}, @code{.r}, @code{.y},8355 @code{.C}, @code{.cpp}, @code{.p}, @code{.f}, @code{.F}, @code{.r}, @code{.y}, 8011 8356 @code{.l}, @code{.s}, @code{.S}, @code{.mod}, @code{.sym}, @code{.def}, 8012 8357 @code{.h}, @code{.info}, @code{.dvi}, @code{.tex}, @code{.texinfo}, … … 8033 8378 @cindex C++, rule to compile 8034 8379 @pindex g++ 8380 @pindex .cc 8381 @pindex .cpp 8035 8382 @pindex .C 8036 @pindex .cc 8037 @file{@var{n}.o} is made automatically from @file{@var{n}.cc} or 8038 @file{@var{n}.C} with a command of the form @samp{$(CXX) -c $(CPPFLAGS) 8039 $(CXXFLAGS)}. We encourage you to use the suffix @samp{.cc} for C++ 8040 source files instead of @samp{.C}.@refill 8383 @file{@var{n}.o} is made automatically from @file{@var{n}.cc}, 8384 @file{@var{n}.cpp}, or @file{@var{n}.C} with a command of the form 8385 @samp{$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)}. We encourage you to use the 8386 suffix @samp{.cc} for C++ source files instead of @samp{.C}.@refill 8041 8387 8042 8388 @item Compiling Pascal programs … … 8299 8645 8300 8646 The commands in built-in implicit rules make liberal use of certain 8301 predefined variables. You can alter the se variables in the makefile,8302 with arguments to @code{make}, or in the environment to alter how the 8303 implicit rules work without redefining the rules themselves. You can 8304 cancel all variables used by implicit rules with the @samp{-R} or 8305 @samp{--no-builtin-variables} option.8647 predefined variables. You can alter the values of these variables in 8648 the makefile, with arguments to @code{make}, or in the environment to 8649 alter how the implicit rules work without redefining the rules 8650 themselves. You can cancel all variables used by implicit rules with 8651 the @samp{-R} or @samp{--no-builtin-variables} option. 8306 8652 8307 8653 For example, the command used to compile a C source file actually says … … 8322 8668 with spaces. 8323 8669 8324 Here is a table of variables used as names of programs in built-in rules: 8670 The following tables describe of some of the more commonly-used predefined 8671 variables. This list is not exhaustive, and the default values shown here may 8672 not be what are selected by @code{make} for your environment. To see the 8673 complete list of predefined variables for your instance of GNU @code{make} you 8674 can run @samp{make -p} in a directory with no makefiles. 8675 8676 Here is a table of some of the more common variables used as names of 8677 programs in built-in rules: 8678 makefiles. 8325 8679 8326 8680 @table @code … … 8332 8686 @item AS 8333 8687 @vindex AS 8334 Program for doing assembly; default @samp{as}.8688 Program for compiling assembly files; default @samp{as}. 8335 8689 @pindex as 8336 8690 … … 8338 8692 @vindex CC 8339 8693 Program for compiling C programs; default @samp{cc}. 8694 @pindex cc 8695 8696 @item CO 8697 @vindex CO 8698 Program for checking out files from RCS; default @samp{co}. 8340 8699 @pindex cc 8341 8700 … … 8368 8727 @item LEX 8369 8728 @vindex LEX 8370 Program to use to turn Lex grammars into C programs or Ratfor programs; 8371 default @samp{lex}. 8729 Program to use to turn Lex grammars into source code; default @samp{lex}. 8372 8730 @pindex lex 8731 8732 @item YACC 8733 @vindex YACC 8734 Program to use to turn Yacc grammars into source code; default @samp{yacc}. 8735 @pindex yacc 8736 8737 @item LINT 8738 @vindex LINT 8739 Program to use to run lint on source code; default @samp{lint}. 8740 @pindex lint 8741 8742 @item M2C 8743 @vindex M2C 8744 Program to use to compile Modula-2 source code; default @samp{m2c}. 8745 @pindex m2c 8373 8746 8374 8747 @item PC … … 8376 8749 Program for compiling Pascal programs; default @samp{pc}. 8377 8750 @pindex pc 8378 8379 @item YACC8380 @vindex YACC8381 Program to use to turn Yacc grammars into C programs; default @samp{yacc}.8382 @pindex yacc8383 8384 @item YACCR8385 @vindex YACCR8386 Program to use to turn Yacc grammars into Ratfor8387 programs; default @samp{yacc -r}.8388 8751 8389 8752 @item MAKEINFO … … 8472 8835 @item LDFLAGS 8473 8836 @vindex LDFLAGS 8474 Extra flags to give to compilers when they are 8475 supposed to invoke the linker,@samp{ld}.8837 Extra flags to give to compilers when they are supposed to invoke the linker, 8838 @samp{ld}. 8476 8839 8477 8840 @item LFLAGS … … 8479 8842 Extra flags to give to Lex. 8480 8843 8844 @item YFLAGS 8845 @vindex YFLAGS 8846 Extra flags to give to Yacc. 8847 8481 8848 @item PFLAGS 8482 8849 @vindex PFLAGS … … 8487 8854 Extra flags to give to the Fortran compiler for Ratfor programs. 8488 8855 8489 @item YFLAGS8490 @vindex YFLAGS8491 Extra flags to give to Yacc.8856 @item LINTFLAGS 8857 @vindex LINTFLAGS 8858 Extra flags to give to lint. 8492 8859 @end table 8493 8860 … … 8629 8996 8630 8997 @samp{%} in a prerequisite of a pattern rule stands for the same stem 8631 that was matched by the @samp{%} in the target. In order for 8632 the pattern rule to apply, its target pattern must match the file name 8633 under consideration, and its prerequisite patterns must name files that 8634 exist or can be made. These files become prerequisites of the target. 8998 that was matched by the @samp{%} in the target. In order for the 8999 pattern rule to apply, its target pattern must match the file name 9000 under consideration and all of its prerequisites (after pattern 9001 substitution) must name files that exist or can be made. These files 9002 become prerequisites of the target. 8635 9003 @cindex prerequisite pattern, implicit 8636 9004 … … 8982 9350 names, along with the slash that ends them, are added on to the 8983 9351 prerequisite file names generated from the pattern rule's prerequisite 8984 patterns and the file name. The directories are ignored only for the9352 patterns and the file name. The directories are ignored only for the 8985 9353 purpose of finding an implicit rule to use, not in the application of 8986 9354 that rule. Thus, @samp{e%t} matches the file name @file{src/eat}, … … 9386 9754 9387 9755 In fact, nearly all archive member targets are updated in just this way 9388 and there is an implicit rule to do it for you. @strong{ Note:} The9756 and there is an implicit rule to do it for you. @strong{Please note:} The 9389 9757 @samp{c} flag to @code{ar} is required if the archive file does not 9390 9758 already exist. … … 10124 10492 @xref{Origin Function, , The @code{origin} Function}. 10125 10493 10494 @item $(flavor @var{variable}) 10495 10496 Return a string describing the flavor of the @code{make} variable 10497 @var{variable}.@* 10498 @xref{Flavor Function, , The @code{flavor} Function}. 10499 10126 10500 @item $(foreach @var{var},@var{words},@var{text}) 10127 10501 … … 10133 10507 10134 10508 Evaluate the variable @var{var} replacing any references to @code{$(1)}, 10135 @code{$(2)} with the first, second, etc. @var{param} values.@*10509 @code{$(2)} with the first, second, etc.@: @var{param} values.@* 10136 10510 @xref{Call Function, ,The @code{call} Function}. 10137 10511 … … 10228 10602 commands. @xref{Execution, ,Command Execution}. The @code{SHELL} 10229 10603 variable is handled specially when importing from and exporting to the 10230 environment. @xref{ Environment, ,Using Variable from the Environment}.10604 environment. @xref{Choosing the Shell}. 10231 10605 10232 10606 @item MAKESHELL 10233 10607 10234 10608 On MS-DOS only, the name of the command interpreter that is to be used 10235 by @code{make}. This value takes precedence over the value of10609 by @code{make}. This value takes precedence over the value of 10236 10610 @code{SHELL}. @xref{Execution, ,MAKESHELL variable}. 10237 10611 … … 10728 11102 @printindex fn 10729 11103 10730 @summarycontents10731 @contents10732 11104 @bye
Note:
See TracChangeset
for help on using the changeset viewer.