Changeset 501 for vendor/gnumake/current/doc
- Timestamp:
- Sep 15, 2006, 4:30:32 AM (19 years ago)
- Location:
- vendor/gnumake/current/doc
- Files:
-
- 2 added
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/doc/Makefile.am
r53 r501 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 -
vendor/gnumake/current/doc/Makefile.in
r152 r501 1 # Makefile.in generated by automake 1. 8.2from 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 60 am__aclocal_m4_deps = $(top_srcdir)/config/dospaths.m4 \ … … 68 85 AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) 69 86 DVIPS = dvips 70 am__installdirs = $(DESTDIR)$(infodir)87 am__installdirs = "$(DESTDIR)$(infodir)" 71 88 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 72 89 ACLOCAL = @ACLOCAL@ … … 139 156 USE_NLS = @USE_NLS@ 140 157 VERSION = @VERSION@ 158 WINDOWSENV_FALSE = @WINDOWSENV_FALSE@ 159 WINDOWSENV_TRUE = @WINDOWSENV_TRUE@ 141 160 XGETTEXT = @XGETTEXT@ 142 161 ac_ct_CC = @ac_ct_CC@ … … 148 167 am__leading_dot = @am__leading_dot@ 149 168 am__quote = @am__quote@ 169 am__tar = @am__tar@ 170 am__untar = @am__untar@ 150 171 bindir = @bindir@ 151 172 build = @build@ … … 216 237 217 238 .texi.info: 218 restore=: && \ 219 backupdir="$(am__leading_dot)am$$$$" && \ 239 restore=: && backupdir="$(am__leading_dot)am$$$$" && \ 220 240 am__cwd=`pwd` && cd $(srcdir) && \ 221 241 rm -rf $$backupdir && mkdir $$backupdir && \ 222 for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ 223 if test -f $$f; then \ 224 mv $$f $$backupdir; \ 225 restore=mv; \ 226 fi; \ 227 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 && \ 228 247 cd "$$am__cwd"; \ 229 248 if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ … … 237 256 $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ 238 257 fi; \ 239 rm -rf $$backupdir; \ 240 exit $$rc 258 rm -rf $$backupdir; exit $$rc 241 259 242 260 .texi.dvi: … … 251 269 252 270 .texi.html: 253 $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ 254 -o $@ $< 255 if test ! -d $@ && test -d $(@:.html=); then \ 256 mv $(@:.html=) $@; else :; fi 257 $(srcdir)/make.info: make.texi $(make_TEXINFOS) 258 make.dvi: make.texi $(make_TEXINFOS) 259 make.pdf: make.texi $(make_TEXINFOS) 260 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 261 306 .dvi.ps: 307 TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ 262 308 $(DVIPS) -o $@ $< 263 309 264 310 uninstall-info-am: 265 $(PRE_UNINSTALL)311 @$(PRE_UNINSTALL) 266 312 @if (install-info --version && \ 267 313 install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ … … 269 315 for file in $$list; do \ 270 316 relfile=`echo "$$file" | sed 's|^.*/||'`; \ 271 echo " install-info --info-dir= $(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile"; \272 install-info --info-dir= $(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \317 echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ 318 install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ 273 319 done; \ 274 320 else :; fi … … 278 324 relfile=`echo "$$file" | sed 's|^.*/||'`; \ 279 325 relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ 280 (if cd $(DESTDIR)$(infodir); then \281 echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \326 (if cd "$(DESTDIR)$(infodir)"; then \ 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]"; \ 282 328 rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ 283 329 else :; fi); \ … … 351 397 all-am: Makefile $(INFO_DEPS) 352 398 installdirs: 353 $(mkdir_p) $(DESTDIR)$(infodir) 399 for dir in "$(DESTDIR)$(infodir)"; do \ 400 test -z "$$dir" || $(mkdir_p) "$$dir"; \ 401 done 354 402 install: install-am 355 403 install-exec: install-exec-am … … 372 420 373 421 distclean-generic: 374 - rm -f $(CONFIG_CLEAN_FILES)422 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 375 423 376 424 maintainer-clean-generic: … … 403 451 install-info-am: $(INFO_DEPS) 404 452 @$(NORMAL_INSTALL) 405 $(mkdir_p) $(DESTDIR)$(infodir)453 test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)" 406 454 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ 407 455 list='$(INFO_DEPS)'; \ … … 416 464 if test -f $$ifile; then \ 417 465 relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ 418 echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \419 $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \466 echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ 467 $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ 420 468 else : ; fi; \ 421 469 done; \ … … 427 475 for file in $$list; do \ 428 476 relfile=`echo "$$file" | sed 's|^.*/||'`; \ 429 echo " install-info --info-dir= $(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile";\430 install-info --info-dir= $(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile|| :;\477 echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ 478 install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ 431 479 done; \ 432 480 else : ; fi … … 438 486 -rm -f Makefile 439 487 maintainer-clean-am: distclean-am maintainer-clean-aminfo \ 440 maintainer-clean-generic 488 maintainer-clean-generic maintainer-clean-vti 441 489 442 490 mostlyclean: mostlyclean-am 443 491 444 mostlyclean-am: mostlyclean-aminfo mostlyclean-generic 492 mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti 445 493 446 494 pdf: pdf-am … … 460 508 install-man install-strip installcheck installcheck-am \ 461 509 installdirs maintainer-clean maintainer-clean-aminfo \ 462 maintainer-clean-generic m ostlyclean mostlyclean-aminfo\463 mostlyclean- generic pdf pdf-am ps ps-am uninstall uninstall-am\464 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 465 513 466 514 -
vendor/gnumake/current/doc/fdl.texi
r152 r501 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 -
vendor/gnumake/current/doc/make-stds.texi
r152 r501 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 -
vendor/gnumake/current/doc/make.info
r152 r501 1 This is make.info, produced by makeinfo version 4.6 from 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." 2 25 3 26 INFO-DIR-SECTION GNU Packages … … 6 29 END-INFO-DIR-ENTRY 7 30 8 This file documents the GNU Make utility, which determines9 automatically which pieces of a large program need to be recompiled,10 and issues the commands to recompile them.11 12 This is Edition 0.61, last updated 02 May 2003, of `The GNU Make13 Manual', for `make', Version 3.81.14 15 Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,16 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.17 18 Permission is granted to copy, distribute and/or modify this document19 under the terms of the GNU Free Documentation License, Version 1.1 or20 any later version published by the Free Software Foundation; with no21 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover22 Texts. A copy of the license is included in the section entitled "GNU23 Free Documentation License".24 25 31 26 32 Indirect: 27 make.info-1: 99728 make.info-2: 30 050033 make.info-1: 1297 34 make.info-2: 301265 29 35 30 36 Tag Table: 31 37 (Indirect) 32 Node: Top997 33 Node: Overview13531 34 Node: Preparing14535 35 Node: Reading15507 36 Node: Bugs16426 37 Node: Introduction18248 38 Node: Rule Introduction19832 39 Node: Simple Makefile21568 40 Node: How Make Works25189 41 Node: Variables Simplify27677 42 Node: make Deduces29880 43 Node: Combine By Prerequisite31627 44 Node: Cleanup32658 45 Node: Makefiles34069 46 Node: Makefile Contents34952 47 Node: Makefile Names37899 48 Node: Include39498 49 Ref: Include-Footnote-143049 50 Node: MAKEFILES Variable43183 51 Node: MAKEFILE_LIST Variable44685 52 Node: Special Variables46004 53 Node: Remaking Makefiles46739 54 Node: Overriding Makefiles50981 55 Node: Reading Makefiles53031 56 Node: Rules55558 57 Node: Rule Example58226 58 Node: Rule Syntax59075 59 Node: Prerequisite Types61296 60 Node: Wildcards63064 61 Node: Wildcard Examples64747 62 Node: Wildcard Pitfall65991 63 Node: Wildcard Function67773 64 Node: Directory Search69550 65 Node: General Search70684 66 Node: Selective Search72387 67 Node: Search Algorithm75363 68 Node: Commands/Search77870 69 Node: Implicit/Search79205 70 Node: Libraries/Search80137 71 Node: Phony Targets82219 72 Node: Force Targets87195 73 Node: Empty Targets88232 74 Node: Special Targets89519 75 Node: Multiple Targets96215 76 Node: Multiple Rules98075 77 Node: Static Pattern100301 78 Node: Static Usage100943 79 Node: Static versus Implicit104664 80 Node: Double-Colon106394 81 Node: Automatic Prerequisites108041 82 Node: Commands112295 83 Node: Echoing113984 84 Node: Execution115262 85 Ref: Execution-Footnote-1119688 86 Node: Parallel119834 87 Node: Errors123417 88 Node: Interrupts127053 89 Node: Recursion128632 90 Node: MAKE Variable130715 91 Node: Variables/Recursion132966 92 Node: Options/Recursion138111 93 Node: -w Option143264 94 Node: Sequences144247 95 Node: Empty Commands147248 96 Node: Using Variables148414 97 Node: Reference151521 98 Node: Flavors153077 99 Node: Advanced158861 100 Node: Substitution Refs159358 101 Node: Computed Names160904 102 Node: Values165471 103 Node: Setting166376 104 Node: Appending168404 105 Node: Override Directive172319 106 Node: Defining173695 107 Node: Environment176151 108 Node: Target-specific178423 109 Node: Pattern-specific181380 110 Node: Conditionals182772 111 Node: Conditional Example183478 112 Node: Conditional Syntax186062 113 Node: Testing Flags190930 114 Node: Functions192024 115 Node: Syntax of Functions193366 116 Node: Text Functions195557 117 Node: File Name Functions203707 118 Node: Foreach Function208146 119 Node: If Function211346 120 Node: Call Function212614 121 Node: Value Function215496 122 Node: Eval Function216930 123 Node: Origin Function219236 124 Node: Shell Function222445 125 Node: Make Control Functions224026 126 Node: Running225456 127 Node: Makefile Arguments227441 128 Node: Goals228149 129 Node: Instead of Execution232704 130 Node: Avoiding Compilation235982 131 Node: Overriding237949 132 Node: Testing240239 133 Node: Options Summary242116 134 Node: Implicit Rules251547 135 Node: Using Implicit253691 136 Node: Catalogue of Rules257220 137 Node: Implicit Variables266203 138 Node: Chained Rules270429 139 Node: Pattern Rules274428 140 Node: Pattern Intro275954 141 Node: Pattern Examples278802 142 Node: Automatic Variables280597 143 Node: Pattern Match288760 144 Node: Match-Anything Rules290381 145 Node: Canceling Rules294242 146 Node: Last Resort294944 147 Node: Suffix Rules296781 148 Node: Implicit Rule Search300500 149 Node: Archives304009 150 Node: Archive Members304701 151 Node: Archive Update306297 152 Node: Archive Symbols308201 153 Node: Archive Pitfalls309421 154 Node: Archive Suffix Rules310134 155 Node: Features311671 156 Node: Missing320218 157 Node: Makefile Conventions323948 158 Node: Makefile Basics324728 159 Node: Utilities in Makefiles327885 160 Node: Command Variables330013 161 Node: Directory Variables333573 162 Node: Standard Targets344450 163 Ref: Standard Targets-Footnote-1355704 164 Node: Install Command Categories355804 165 Node: Quick Reference360369 166 Node: Error Messages370113 167 Node: Complex Makefile377782 168 Node: GNU Free Documentation License386462 169 Node: Concept Index406354 170 Node: Name Index451260 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 171 183 172 184 End Tag Table -
vendor/gnumake/current/doc/make.info-1
r152 r501 1 This is make.info, produced by makeinfo version 4.6 from 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." 2 25 3 26 INFO-DIR-SECTION GNU Packages … … 6 29 END-INFO-DIR-ENTRY 7 30 8 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 9 38 automatically which pieces of a large program need to be recompiled, 10 39 and issues the commands to recompile them. 11 40 12 This is Edition 0.61, last updated 02 May 2003, of `The GNU Make 13 Manual', for `make', Version 3.81. 14 15 Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 16 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. 17 18 Permission is granted to copy, distribute and/or modify this document 19 under the terms of the GNU Free Documentation License, Version 1.1 or 20 any later version published by the Free Software Foundation; with no 21 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover 22 Texts. A copy of the license is included in the section entitled "GNU 23 Free Documentation License". 24 25 26 File: make.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) 27 28 Make 29 **** 30 31 The GNU `make' utility automatically determines which pieces of a large 32 program need to be recompiled, and issues the commands to recompile 33 them. 34 35 This edition of the `GNU Make Manual', last updated 02 May 2003, 36 documents GNU `make' Version 3.81. 37 38 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." 39 59 40 60 * Menu: … … 96 116 with another makefile. 97 117 * Reading Makefiles:: How makefiles are parsed. 118 * Secondary Expansion:: How and when secondary expansion is performed. 98 119 99 120 Writing Rules … … 106 127 * Phony Targets:: Using a target that is not a real file's name. 107 128 * Force Targets:: You can use a target without commands 108 or prerequisites to mark other 109 targetsas phony.129 or prerequisites to mark other targets 130 as phony. 110 131 * Empty Targets:: When only the date matters and the 111 132 files are empty. … … 147 168 Writing the Commands in Rules 148 169 170 * Command Syntax:: Command syntax features and pitfalls. 149 171 * Echoing:: How to control when commands are echoed. 150 172 * Execution:: How commands are executed. … … 155 177 * Sequences:: Defining canned sequences of commands. 156 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. 157 189 158 190 Recursive Use of `make' … … 200 232 * Text Functions:: General-purpose text manipulation functions. 201 233 * File Name Functions:: Functions for manipulating file names. 234 * Conditional Functions:: Functions that implement conditions. 202 235 * Foreach Function:: Repeat some text with controlled variation. 203 * If Function:: Conditionally expand a value.204 236 * Call Function:: Expand a user-defined function. 205 237 * Value Function:: Return the un-expanded value of a variable. 206 238 * Eval Function:: Evaluate the arguments as makefile syntax. 207 239 * Origin Function:: Find where a variable got its value. 240 * Flavor Function:: Find out the flavor of a variable. 208 241 * Shell Function:: Substitute the output of a shell command. 209 242 * Make Control Functions:: Functions that control how make runs. … … 233 266 * Chained Rules:: How to use a chain of implicit rules. 234 267 * Pattern Rules:: How to define new implicit rules. 235 * Last Resort:: How to defin ing commands for rules236 whichcannot find any.268 * Last Resort:: How to define commands for rules which 269 cannot find any. 237 270 * Suffix Rules:: The old-fashioned style of implicit rule. 238 271 * Implicit Rule Search:: The precise algorithm for applying … … 263 296 * Archive Symbols:: How to update archive symbol directories. 264 297 265 Makefile Conventions266 267 * Makefile Basics:: General Conventions for Makefiles268 * Utilities in Makefiles:: Utilities in Makefiles269 * Command Variables:: Variables for Specifying Commands270 * Directory Variables:: Variables for Installation Directories271 * Standard Targets:: Standard Targets for Users272 * Install Command Categories:: Three categories of commands in the `install'273 274 Copying This Manual275 276 298 277 299 File: make.info, Node: Overview, Next: Introduction, Prev: Top, Up: Top 278 300 279 Overview of `make'280 ****************** 301 1 Overview of `make' 302 ******************** 281 303 282 304 The `make' utility automatically determines which pieces of a large … … 287 309 288 310 GNU `make' conforms to section 6.2 of `IEEE Standard 1003.2-1992' 289 (POSIX.2). 311 (POSIX.2). 290 312 291 313 Our examples show C programs, since they are most common, but you … … 329 351 File: make.info, Node: Reading, Next: Bugs, Prev: Preparing, Up: Overview 330 352 331 How to Read This Manual332 ======================= 353 1.1 How to Read This Manual 354 =========================== 333 355 334 356 If you are new to `make', or are looking for a general introduction, … … 350 372 File: make.info, Node: Bugs, Prev: Reading, Up: Overview 351 373 352 Problems and Bugs353 ================= 374 1.2 Problems and Bugs 375 ===================== 354 376 355 377 If you have problems with GNU `make' or think you've found a bug, … … 393 415 File: make.info, Node: Introduction, Next: Makefiles, Prev: Overview, Up: Top 394 416 395 An Introduction to Makefiles396 **************************** 417 2 An Introduction to Makefiles 418 ****************************** 397 419 398 420 You need a file called a "makefile" to tell `make' what to do. Most 399 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. 400 422 401 423 In this chapter, we will discuss a simple makefile that describes … … 412 434 Finally, if any source file has been recompiled, all the object files, 413 435 whether newly made or saved from previous compilations, must be linked 414 together to produce the new executable editor. 436 together to produce the new executable editor. 415 437 416 438 * Menu: … … 427 449 File: make.info, Node: Rule Introduction, Next: Simple Makefile, Prev: Introduction, Up: Introduction 428 450 429 What a Rule Looks Like430 ====================== 451 2.1 What a Rule Looks Like 452 ========================== 431 453 432 454 A simple makefile consists of "rules" with the following shape: … … 470 492 File: make.info, Node: Simple Makefile, Next: How Make Works, Prev: Rule Introduction, Up: Introduction 471 493 472 A Simple Makefile473 ================= 494 2.2 A Simple Makefile 495 ===================== 474 496 475 497 Here is a straightforward makefile that describes the way an executable … … 485 507 cc -o edit main.o kbd.o command.o display.o \ 486 508 insert.o search.o files.o utils.o 487 509 488 510 main.o : main.c defs.h 489 511 cc -c main.c … … 507 529 508 530 We split each long line into two lines using backslash-newline; this is 509 like using one long line, but is easier to read. 531 like using one long line, but is easier to read. 510 532 511 533 To use this makefile to create the executable file called `edit', … … 535 557 prerequisites. These shell commands say how to update the target file. 536 558 A tab character must come at the beginning of every command line to 537 distinguish command slines from other lines in the makefile. (Bear in559 distinguish command lines from other lines in the makefile. (Bear in 538 560 mind that `make' does not know anything about how the commands work. 539 561 It is up to you to supply commands that will update the target file 540 562 properly. All `make' does is execute the commands in the rule you have 541 specified when the target file needs to be updated.) 563 specified when the target file needs to be updated.) 542 564 543 565 The target `clean' is not a file, but merely the name of an action. … … 550 572 called "phony targets". *Note Phony Targets::, for information about 551 573 this kind of target. *Note Errors in Commands: Errors, to see how to 552 cause `make' to ignore errors from `rm' or any other command. 574 cause `make' to ignore errors from `rm' or any other command. 553 575 554 576 555 577 File: make.info, Node: How Make Works, Next: Variables Simplify, Prev: Simple Makefile, Up: Introduction 556 578 557 How `make' Processes a Makefile558 =============================== 579 2.3 How `make' Processes a Makefile 580 =================================== 559 581 560 582 By default, `make' starts with the first target (not targets whose 561 583 names start with `.'). This is called the "default goal". ("Goals" 562 are the targets that `make' strives ultimately to update. *Note 563 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.). 564 588 565 589 In the simple example of the previous section, the default goal is to … … 596 620 not exist, or if any of the object files are newer than it. If an 597 621 object file was just recompiled, it is now newer than `edit', so `edit' 598 is relinked. 622 is relinked. 599 623 600 624 Thus, if we change the file `insert.c' and run `make', `make' will … … 607 631 File: make.info, Node: Variables Simplify, Next: make Deduces, Prev: How Make Works, Up: Introduction 608 632 609 Variables Make Makefiles Simpler610 ================================ 633 2.4 Variables Make Makefiles Simpler 634 ==================================== 611 635 612 636 In our example, we had to list all the object files twice in the rule … … 641 665 objects = main.o kbd.o command.o display.o \ 642 666 insert.o search.o files.o utils.o 643 667 644 668 edit : $(objects) 645 669 cc -o edit $(objects) … … 666 690 File: make.info, Node: make Deduces, Next: Combine By Prerequisite, Prev: Variables Simplify, Up: Introduction 667 691 668 Letting `make' Deduce the Commands669 ================================== 692 2.5 Letting `make' Deduce the Commands 693 ====================================== 670 694 671 695 It is not necessary to spell out the commands for compiling the … … 686 710 objects = main.o kbd.o command.o display.o \ 687 711 insert.o search.o files.o utils.o 688 712 689 713 edit : $(objects) 690 714 cc -o edit $(objects) 691 715 692 716 main.o : defs.h 693 717 kbd.o : defs.h command.h … … 698 722 files.o : defs.h buffer.h command.h 699 723 utils.o : defs.h 700 724 701 725 .PHONY : clean 702 726 clean : … … 713 737 File: make.info, Node: Combine By Prerequisite, Next: Cleanup, Prev: make Deduces, Up: Introduction 714 738 715 Another Style of Makefile716 ========================= 739 2.6 Another Style of Makefile 740 ============================= 717 741 718 742 When the objects of a makefile are created only by implicit rules, an … … 723 747 objects = main.o kbd.o command.o display.o \ 724 748 insert.o search.o files.o utils.o 725 749 726 750 edit : $(objects) 727 751 cc -o edit $(objects) 728 752 729 753 $(objects) : defs.h 730 754 kbd.o command.o files.o : command.h … … 742 766 File: make.info, Node: Cleanup, Prev: Combine By Prerequisite, Up: Introduction 743 767 744 Rules for Cleaning the Directory745 ================================ 768 2.7 Rules for Cleaning the Directory 769 ==================================== 746 770 747 771 Compiling a program is not the only thing you might want to write rules … … 781 805 File: make.info, Node: Makefiles, Next: Rules, Prev: Introduction, Up: Top 782 806 783 Writing Makefiles784 ***************** 807 3 Writing Makefiles 808 ******************* 785 809 786 810 The information that tells `make' how to recompile a system comes from … … 799 823 with another makefile. 800 824 * Reading Makefiles:: How makefiles are parsed. 825 * Secondary Expansion:: How and when secondary expansion is performed. 801 826 802 827 803 828 File: make.info, Node: Makefile Contents, Next: Makefile Names, Prev: Makefiles, Up: Makefiles 804 829 805 What Makefiles Contain806 ====================== 830 3.1 What Makefiles Contain 831 ========================== 807 832 808 833 Makefiles contain five kinds of things: "explicit rules", "implicit … … 864 889 File: make.info, Node: Makefile Names, Next: Include, Prev: Makefile Contents, Up: Makefiles 865 890 866 What Name to Give Your Makefile867 =============================== 891 3.2 What Name to Give Your Makefile 892 =================================== 868 893 869 894 By default, when `make' looks for the makefile, it tries the following 870 names, in order: `GNUmakefile', `makefile' and `Makefile'. 895 names, in order: `GNUmakefile', `makefile' and `Makefile'. 871 896 872 897 Normally you should call your makefile either `makefile' or … … 891 916 concatenated in the order specified. The default makefile names 892 917 `GNUmakefile', `makefile' and `Makefile' are not checked automatically 893 if you specify `-f' or `--file'. 918 if you specify `-f' or `--file'. 894 919 895 920 896 921 File: make.info, Node: Include, Next: MAKEFILES Variable, Prev: Makefile Names, Up: Makefiles 897 922 898 Including Other Makefiles899 ========================= 923 3.3 Including Other Makefiles 924 ============================= 900 925 901 926 The `include' directive tells `make' to suspend reading the current … … 905 930 include FILENAMES... 906 931 907 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. 908 934 909 935 Extra spaces are allowed and ignored at the beginning of the line, … … 942 968 than that of somehow appending the prerequisites to the end of the main 943 969 makefile as has been traditionally done with other versions of `make'. 944 *Note Automatic Prerequisites::. 970 *Note Automatic Prerequisites::. 945 971 946 972 If the specified name does not start with a slash, and the file is … … 980 1006 File: make.info, Node: MAKEFILES Variable, Next: MAKEFILE_LIST Variable, Prev: Include, Up: Makefiles 981 1007 982 The Variable `MAKEFILES'983 ======================== 1008 3.4 The Variable `MAKEFILES' 1009 ============================ 984 1010 985 1011 If the environment variable `MAKEFILES' is defined, `make' considers … … 1009 1035 File: make.info, Node: MAKEFILE_LIST Variable, Next: Special Variables, Prev: MAKEFILES Variable, Up: Makefiles 1010 1036 1011 The Variable `MAKEFILE_LIST'1012 ============================ 1037 3.5 The Variable `MAKEFILE_LIST' 1038 ================================ 1013 1039 1014 1040 As `make' reads various makefiles, including any obtained from the … … 1025 1051 If a makefile named `Makefile' has this content: 1026 1052 1027 name1 := $( word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))1028 1053 name1 := $(lastword $(MAKEFILE_LIST)) 1054 1029 1055 include inc.mk 1030 1031 name2 := $( word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))1032 1056 1057 name2 := $(lastword $(MAKEFILE_LIST)) 1058 1033 1059 all: 1034 1060 @echo name1 = $(name1) … … 1048 1074 File: make.info, Node: Special Variables, Next: Remaking Makefiles, Prev: MAKEFILE_LIST Variable, Up: Makefiles 1049 1075 1050 Other Special Variables 1051 ======================= 1052 1053 GNU `make' also supports a special variable. Note that any value you 1054 assign to this variable will be ignored; it will always return its 1055 special value. 1056 1057 The first special variable is `.VARIABLES'. When expanded, the 1058 value consists of a list of the _names_ of all global variables defined 1059 in all makefiles read up until that point. This includes variables 1060 which have empty values, as well as built-in variables (*note Variables 1061 Used by Implicit Rules: Implicit Variables.), but does not include any 1062 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 1063 1175 1064 1176 1065 1177 File: make.info, Node: Remaking Makefiles, Next: Overriding Makefiles, Prev: Special Variables, Up: Makefiles 1066 1178 1067 How Makefiles Are Remade1068 ======================== 1179 3.7 How Makefiles Are Remade 1180 ============================ 1069 1181 1070 1182 Sometimes makefiles can be remade from other files, such as RCS or SCCS … … 1103 1215 If you do not specify any makefiles to be read with `-f' or `--file' 1104 1216 options, `make' will try the default makefile names; *note What Name to 1105 Give Your Makefile: Makefile Names. .Unlike makefiles explicitly1217 Give Your Makefile: Makefile Names. Unlike makefiles explicitly 1106 1218 requested with `-f' or `--file' options, `make' is not certain that 1107 1219 these makefiles should exist. However, if a default makefile does not … … 1143 1255 File: make.info, Node: Overriding Makefiles, Next: Reading Makefiles, Prev: Remaking Makefiles, Up: Makefiles 1144 1256 1145 Overriding Part of Another Makefile1146 =================================== 1257 3.8 Overriding Part of Another Makefile 1258 ======================================= 1147 1259 1148 1260 Sometimes it is useful to have a makefile that is mostly just like … … 1164 1276 foo: 1165 1277 frobnicate > foo 1166 1278 1167 1279 %: force 1168 1280 @$(MAKE) -f Makefile $@ … … 1186 1298 1187 1299 1188 File: make.info, Node: Reading Makefiles, Prev: Overriding Makefiles, Up: Makefiles1189 1190 How `make' Reads a Makefile1191 =========================== 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 =============================== 1192 1304 1193 1305 GNU `make' does its work in two distinct phases. During the first … … 1224 1336 IMMEDIATE := IMMEDIATE 1225 1337 IMMEDIATE += DEFERRED or IMMEDIATE 1226 1338 1227 1339 define IMMEDIATE 1228 1340 DEFERRED … … 1238 1350 All instances of conditional syntax are parsed immediately, in their 1239 1351 entirety; this includes the `ifdef', `ifeq', `ifndef', and `ifneq' 1240 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. 1241 1357 1242 1358 Rule Definition … … 1254 1370 1255 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 1256 1551 File: make.info, Node: Rules, Next: Commands, Prev: Makefiles, Up: Top 1257 1552 1258 Writing Rules1259 ************* 1553 4 Writing Rules 1554 *************** 1260 1555 1261 1556 A "rule" appears in the makefile and says when and how to remake … … 1288 1583 * Phony Targets:: Using a target that is not a real file's name. 1289 1584 * Force Targets:: You can use a target without commands 1290 or prerequisites to mark other 1291 targetsas phony.1585 or prerequisites to mark other targets 1586 as phony. 1292 1587 * Empty Targets:: When only the date matters and the 1293 1588 files are empty. … … 1306 1601 File: make.info, Node: Rule Example, Next: Rule Syntax, Prev: Rules, Up: Rules 1307 1602 1308 Rule Example1309 ============ 1603 4.1 Rule Example 1604 ================ 1310 1605 1311 1606 Here is an example of a rule: … … 1332 1627 File: make.info, Node: Rule Syntax, Next: Prerequisite Types, Prev: Rule Example, Up: Rules 1333 1628 1334 Rule Syntax1335 =========== 1629 4.2 Rule Syntax 1630 =============== 1336 1631 1337 1632 In general, a rule looks like this: … … 1358 1653 appear on the line after the prerequisites, with a tab character, or may 1359 1654 appear on the same line, with a semicolon. Either way, the effect is 1360 the same. *Note Writing the Commands in Rules: Commands. 1361 1362 Because dollar signs are used to start variable references, if you 1363 really want a dollar sign in a rule you must write two of them, `$$' 1364 (*note How to Use Variables: Using Variables.). You may split a long 1365 line by inserting a backslash followed by a newline, but this is not 1366 required, as `make' places no limit on the length of a line in a 1367 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. 1368 1668 1369 1669 A rule tells `make' two things: when the targets are out of date, … … 1387 1687 File: make.info, Node: Prerequisite Types, Next: Wildcards, Prev: Rule Syntax, Up: Rules 1388 1688 1389 Types of Prerequisites1390 ====================== 1689 4.3 Types of Prerequisites 1690 ========================== 1391 1691 1392 1692 There are actually two different types of prerequisites understood by … … 1423 1723 File: make.info, Node: Wildcards, Next: Directory Search, Prev: Prerequisite Types, Up: Rules 1424 1724 1425 Using Wildcard Characters in File Names1426 ======================================= 1725 4.4 Using Wildcard Characters in File Names 1726 =========================================== 1427 1727 1428 1728 A single file name can specify many files using "wildcard characters". … … 1440 1740 simulated by setting the environment variable HOME. 1441 1741 1442 Wildcard expansion happens automatically in targets, in1443 prerequisites, and in commands (where the shell does the expansion). 1444 In other contexts, wildcard expansion happens only if you request it 1445 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. 1446 1746 1447 1747 The special significance of a wildcard character can be turned off by … … 1459 1759 File: make.info, Node: Wildcard Examples, Next: Wildcard Pitfall, Prev: Wildcards, Up: Wildcards 1460 1760 1461 Wildcard Examples1462 ----------------- 1761 4.4.1 Wildcard Examples 1762 ----------------------- 1463 1763 1464 1764 Wildcards can be used in the commands of a rule, where they are expanded … … 1499 1799 File: make.info, Node: Wildcard Pitfall, Next: Wildcard Function, Prev: Wildcard Examples, Up: Wildcards 1500 1800 1501 Pitfalls of Using Wildcards1502 --------------------------- 1801 4.4.2 Pitfalls of Using Wildcards 1802 --------------------------------- 1503 1803 1504 1804 Now here is an example of a naive way of using wildcard expansion, that … … 1508 1808 1509 1809 objects = *.o 1510 1810 1511 1811 foo : $(objects) 1512 1812 cc -o foo $(CFLAGS) $(objects) … … 1542 1842 File: make.info, Node: Wildcard Function, Prev: Wildcard Pitfall, Up: Wildcards 1543 1843 1544 The Function `wildcard'1545 ----------------------- 1844 4.4.3 The Function `wildcard' 1845 ----------------------------- 1546 1846 1547 1847 Wildcard expansion happens automatically in rules. But wildcard … … 1578 1878 1579 1879 objects := $(patsubst %.c,%.o,$(wildcard *.c)) 1580 1880 1581 1881 foo : $(objects) 1582 1882 cc -o foo $(objects) … … 1590 1890 File: make.info, Node: Directory Search, Next: Phony Targets, Prev: Wildcards, Up: Rules 1591 1891 1592 Searching Directories for Prerequisites1593 ======================================= 1892 4.5 Searching Directories for Prerequisites 1893 =========================================== 1594 1894 1595 1895 For large systems, it is often desirable to put sources in a separate … … 1614 1914 File: make.info, Node: General Search, Next: Selective Search, Prev: Directory Search, Up: Directory Search 1615 1915 1616 `VPATH': Search Path for All Prerequisites1617 ------------------------------------------ 1916 4.5.1 `VPATH': Search Path for All Prerequisites 1917 ------------------------------------------------ 1618 1918 1619 1919 The value of the `make' variable `VPATH' specifies a list of … … 1658 1958 File: make.info, Node: Selective Search, Next: Search Algorithm, Prev: General Search, Up: Directory Search 1659 1959 1660 The `vpath' Directive1661 --------------------- 1960 4.5.2 The `vpath' Directive 1961 --------------------------- 1662 1962 1663 1963 Similar to the `VPATH' variable, but more selective, is the `vpath' … … 1737 2037 File: make.info, Node: Search Algorithm, Next: Commands/Search, Prev: Selective Search, Up: Directory Search 1738 2038 1739 How Directory Searches are Performed1740 ------------------------------------ 2039 4.5.3 How Directory Searches are Performed 2040 ------------------------------------------ 1741 2041 1742 2042 When a prerequisite is found through directory search, regardless of … … 1795 2095 File: make.info, Node: Commands/Search, Next: Implicit/Search, Prev: Search Algorithm, Up: Directory Search 1796 2096 1797 Writing Shell Commands with Directory Search1798 -------------------------------------------- 2097 4.5.4 Writing Shell Commands with Directory Search 2098 -------------------------------------------------- 1799 2099 1800 2100 When a prerequisite is found in another directory through directory … … 1816 2116 compilation by implicit rules; we use it here for consistency so it will 1817 2117 affect all C compilations uniformly; *note Variables Used by Implicit 1818 Rules: Implicit Variables. .)2118 Rules: Implicit Variables.) 1819 2119 1820 2120 Often the prerequisites include header files as well, which you do … … 1829 2129 File: make.info, Node: Implicit/Search, Next: Libraries/Search, Prev: Commands/Search, Up: Directory Search 1830 2130 1831 Directory Search and Implicit Rules1832 ----------------------------------- 2131 4.5.5 Directory Search and Implicit Rules 2132 ----------------------------------------- 1833 2133 1834 2134 The search through the directories specified in `VPATH' or with `vpath' … … 1850 2150 File: make.info, Node: Libraries/Search, Prev: Implicit/Search, Up: Directory Search 1851 2151 1852 Directory Search for Link Libraries1853 ----------------------------------- 2152 4.5.6 Directory Search for Link Libraries 2153 ----------------------------------------- 1854 2154 1855 2155 Directory search applies in a special way to libraries used with the … … 1889 2189 word in the list will be used. 1890 2190 1891 The default value for `.LIBPATTERNS' is "`lib%.so lib%.a'", which2191 The default value for `.LIBPATTERNS' is `lib%.so lib%.a', which 1892 2192 provides the default behavior described above. 1893 2193 … … 1898 2198 File: make.info, Node: Phony Targets, Next: Force Targets, Prev: Directory Search, Up: Rules 1899 2199 1900 Phony Targets1901 ============= 2200 4.6 Phony Targets 2201 ================= 1902 2202 1903 2203 A phony target is one that is not really the name of a file. It is … … 1915 2215 Because the `rm' command does not create a file named `clean', probably 1916 2216 no such file will ever exist. Therefore, the `rm' command will be 1917 executed every time you say `make clean'. 2217 executed every time you say `make clean'. 1918 2218 1919 2219 The phony target will cease to work if anything ever does create a … … 1945 2245 Another example of the usefulness of phony targets is in conjunction 1946 2246 with recursive invocations of `make' (for more information, see *Note 1947 Recursive Use of `make': Recursion ). In this case the makefile will2247 Recursive Use of `make': Recursion.). In this case the makefile will 1948 2248 often contain a variable which lists a number of subdirectories to be 1949 2249 built. One way to handle this is with one rule whose command is a … … 1951 2251 1952 2252 SUBDIRS = foo bar baz 1953 2253 1954 2254 subdirs: 1955 2255 for dir in $(SUBDIRS); do \ … … 1963 2263 it will do so even if `make' is invoked with the `-k' option, which is 1964 2264 unfortunate. Second, and perhaps more importantly, you cannot take 1965 advantage of the parallel build capabilities of make using this method,1966 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. 1967 2267 1968 2268 By declaring the subdirectories as phony targets (you must do this as … … 1971 2271 1972 2272 SUBDIRS = foo bar baz 1973 2273 1974 2274 .PHONY: subdirs $(SUBDIRS) 1975 2275 1976 2276 subdirs: $(SUBDIRS) 1977 2277 1978 2278 $(SUBDIRS): 1979 2279 $(MAKE) -C $@ 1980 2280 1981 2281 foo: baz 1982 2282 … … 2002 2302 all : prog1 prog2 prog3 2003 2303 .PHONY : all 2004 2304 2005 2305 prog1 : prog1.o utils.o 2006 2306 cc -o prog1 prog1.o utils.o 2007 2307 2008 2308 prog2 : prog2.o 2009 2309 cc -o prog2 prog2.o 2010 2310 2011 2311 prog3 : prog3.o sort.o utils.o 2012 2312 cc -o prog3 prog3.o sort.o utils.o 2013 2313 2014 2314 Now you can say just `make' to remake all three programs, or specify as 2015 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. 2016 2318 2017 2319 When one phony target is a prerequisite of another, it serves as a … … 2020 2322 2021 2323 .PHONY: cleanall cleanobj cleandiff 2022 2324 2023 2325 cleanall : cleanobj cleandiff 2024 2326 rm program 2025 2327 2026 2328 cleanobj : 2027 2329 rm *.o 2028 2330 2029 2331 cleandiff : 2030 2332 rm *.diff … … 2033 2335 File: make.info, Node: Force Targets, Next: Empty Targets, Prev: Phony Targets, Up: Rules 2034 2336 2035 Rules without Commands or Prerequisites2036 ======================================= 2337 4.7 Rules without Commands or Prerequisites 2338 =========================================== 2037 2339 2038 2340 If a rule has no prerequisites or commands, and the target of the rule … … 2062 2364 File: make.info, Node: Empty Targets, Next: Special Targets, Prev: Force Targets, Up: Rules 2063 2365 2064 Empty Target Files to Record Events2065 =================================== 2366 4.8 Empty Target Files to Record Events 2367 ======================================= 2066 2368 2067 2369 The "empty target" is a variant of the phony target; it is used to hold … … 2084 2386 lpr -p $? 2085 2387 touch print 2086 2388 2087 2389 With this rule, `make print' will execute the `lpr' command if either 2088 2390 source file has changed since the last `make print'. The automatic … … 2093 2395 File: make.info, Node: Special Targets, Next: Multiple Targets, Prev: Empty Targets, Up: Rules 2094 2396 2095 Special Built-in Target Names2096 ============================= 2397 4.9 Special Built-in Target Names 2398 ================================= 2097 2399 2098 2400 Certain names have special meanings if they appear as targets. … … 2147 2449 intermediate). 2148 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 2149 2461 `.DELETE_ON_ERROR' 2150 2462 If `.DELETE_ON_ERROR' is mentioned as a target anywhere in the … … 2233 2545 File: make.info, Node: Multiple Targets, Next: Multiple Rules, Prev: Special Targets, Up: Rules 2234 2546 2235 Multiple Targets in a Rule2236 ========================== 2547 4.10 Multiple Targets in a Rule 2548 =============================== 2237 2549 2238 2550 A rule with multiple targets is equivalent to writing many rules, each … … 2258 2570 bigoutput littleoutput : text.g 2259 2571 generate text.g -$(subst output,,$@) > $@ 2260 2572 2261 2573 is equivalent to 2262 2574 … … 2280 2592 File: make.info, Node: Multiple Rules, Next: Static Pattern, Prev: Multiple Targets, Up: Rules 2281 2593 2282 Multiple Rules for One Target2283 ============================= 2594 4.11 Multiple Rules for One Target 2595 ================================== 2284 2596 2285 2597 One file can be the target of several rules. All the prerequisites … … 2331 2643 File: make.info, Node: Static Pattern, Next: Double-Colon, Prev: Multiple Rules, Up: Rules 2332 2644 2333 Static Pattern Rules2334 ==================== 2645 4.12 Static Pattern Rules 2646 ========================= 2335 2647 2336 2648 "Static pattern rules" are rules which specify multiple targets and … … 2348 2660 File: make.info, Node: Static Usage, Next: Static versus Implicit, Prev: Static Pattern, Up: Static Pattern 2349 2661 2350 Syntax of Static Pattern Rules2351 ------------------------------ 2662 4.12.1 Syntax of Static Pattern Rules 2663 ------------------------------------- 2352 2664 2353 2665 Here is the syntax of a static pattern rule: … … 2397 2709 2398 2710 objects = foo.o bar.o 2399 2711 2400 2712 all: $(objects) 2401 2713 2402 2714 $(objects): %.o: %.c 2403 2715 $(CC) -c $(CFLAGS) $< -o $@ … … 2414 2726 2415 2727 files = foo.elc bar.o lose.o 2416 2728 2417 2729 $(filter %.o,$(files)): %.o: %.c 2418 2730 $(CC) -c $(CFLAGS) $< -o $@ … … 2426 2738 from `foo.el'. 2427 2739 2428 Another example shows how to use `$*' in static pattern rules: 2740 Another example shows how to use `$*' in static pattern rules: 2429 2741 2430 2742 bigoutput littleoutput : %output : text.g … … 2437 2749 File: make.info, Node: Static versus Implicit, Prev: Static Usage, Up: Static Pattern 2438 2750 2439 Static Pattern Rules versus Implicit Rules2440 ------------------------------------------ 2751 4.12.2 Static Pattern Rules versus Implicit Rules 2752 ------------------------------------------------- 2441 2753 2442 2754 A static pattern rule has much in common with an implicit rule defined … … 2474 2786 File: make.info, Node: Double-Colon, Next: Automatic Prerequisites, Prev: Static Pattern, Up: Rules 2475 2787 2476 Double-Colon Rules2477 ================== 2788 4.13 Double-Colon Rules 2789 ======================= 2478 2790 2479 2791 "Double-colon" rules are rules written with `::' instead of `:' after … … 2511 2823 File: make.info, Node: Automatic Prerequisites, Prev: Double-Colon, Up: Rules 2512 2824 2513 Generating Prerequisites Automatically2514 ====================================== 2825 4.14 Generating Prerequisites Automatically 2826 =========================================== 2515 2827 2516 2828 In the makefile for a program, many of the rules you need to write often … … 2524 2836 would have to write dozens of such rules in your makefile. And, you 2525 2837 must always be very careful to update the makefile every time you add 2526 or remove an `#include'. 2838 or remove an `#include'. 2527 2839 2528 2840 To avoid this hassle, most modern C compilers can write these rules … … 2543 2855 makefile, so it can never be considered an intermediate file by implicit 2544 2856 rule search. This means that `make' won't ever remove the file after 2545 using it; *note Chains of Implicit Rules: Chained Rules. .2857 using it; *note Chains of Implicit Rules: Chained Rules. 2546 2858 2547 2859 With old `make' programs, it was traditional practice to use this … … 2567 2879 2568 2880 %.d: %.c 2569 2881 @set -e; rm -f $@; \ 2570 2882 $(CC) -M $(CPPFLAGS) $< > $@.$$$$; \ 2571 2883 sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ … … 2574 2886 *Note Pattern Rules::, for information on defining pattern rules. The 2575 2887 `-e' flag to the shell causes it to exit immediately if the `$(CC)' 2576 command (or any other command) fails (exits with a nonzero status). 2888 command (or any other command) fails (exits with a nonzero status). 2577 2889 2578 2890 With the GNU C compiler, you may wish to use the `-MM' flag instead … … 2599 2911 2600 2912 sources = foo.c bar.c 2601 2913 2602 2914 include $(sources:.c=.d) 2603 2915 … … 2610 2922 2611 2923 Note that the `.d' files contain target definitions; you should be 2612 sure to place the `include' directive _after_ the first, default target2924 sure to place the `include' directive _after_ the first, default goal 2613 2925 in your makefiles or run the risk of having a random object file become 2614 the default target. *Note How Make Works::.2926 the default goal. *Note How Make Works::. 2615 2927 2616 2928 2617 2929 File: make.info, Node: Commands, Next: Using Variables, Prev: Rules, Up: Top 2618 2930 2619 Writing the Commands in Rules 2620 ***************************** 2621 2622 The commands of a rule consist of shell command lines to be executed one 2623 by one. Each command line must start with a tab, except that the first 2624 command line may be attached to the target-and-prerequisites line with a 2625 semicolon in between. Blank lines and lines of just comments may appear 2626 among the command lines; they are ignored. (But beware, an apparently 2627 "blank" line that begins with a tab is _not_ blank! It is an empty 2628 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. 2629 2938 2630 2939 Users use many different shell programs, but commands in makefiles … … 2632 2941 otherwise. *Note Command Execution: Execution. 2633 2942 2634 The shell that is in use determines whether comments can be written2635 on command lines, and what syntax they use. When the shell is2636 `/bin/sh', a `#' starts a comment that extends to the end of the line.2637 The `#' does not have to be at the beginning of a line. Text on a line2638 before a `#' is not part of the comment.2639 2640 2943 * Menu: 2641 2944 2945 * Command Syntax:: Command syntax features and pitfalls. 2642 2946 * Echoing:: How to control when commands are echoed. 2643 2947 * Execution:: How commands are executed. … … 2650 2954 2651 2955 2652 File: make.info, Node: Echoing, Next: Execution, Prev: Commands, Up: Commands 2653 2654 Command Echoing 2655 =============== 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 =================== 2656 3134 2657 3135 Normally `make' prints each command line before it is executed. We … … 2682 3160 File: make.info, Node: Execution, Next: Parallel, Prev: Echoing, Up: Commands 2683 3161 2684 Command Execution2685 ================= 3162 5.3 Command Execution 3163 ===================== 2686 3164 2687 3165 When it is time to execute commands to update a target, they are 2688 executed by making a new subshell for each line. (In practice, `make' 2689 may take shortcuts that do not affect the results.) 2690 2691 *Please note:* this implies that shell commands such as `cd' that 2692 set variables local to each process will not affect the following 2693 command lines. (1) If you want to use `cd' to affect the next command, 2694 put the two on a single line with a semicolon between them. Then 2695 `make' will consider them a single command and pass them, together, to 2696 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: 2697 3176 2698 3177 foo : bar/lose 2699 cd bar; gobble lose > ../foo 2700 2701 If you would like to split a single shell command into multiple 2702 lines of text, you must use a backslash at the end of all but the last 2703 subline. Such a sequence of lines is combined into a single line, by 2704 deleting the backslash-newline sequences, before passing it to the 2705 shell. Thus, the following is equivalent to the preceding example: 2706 2707 foo : bar/lose 2708 cd bar; \ 2709 gobble lose > ../foo 2710 2711 The program used as the shell is taken from the variable `SHELL'. 2712 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. 2713 3233 2714 3234 On MS-DOS, if `SHELL' is not set, the value of the variable … … 2756 3276 2757 3277 The effect of the above DOS-specific processing is that a Makefile 2758 that says `SHELL = /bin/sh' (as many Unix makefiles do), will work on 2759 MS-DOS unaltered if you have e.g. `sh.exe' installed in some directory 2760 along your `PATH'. 2761 2762 Unlike most variables, the variable `SHELL' is never set from the 2763 environment. This is because the `SHELL' environment variable is used 2764 to specify your personal choice of shell program for interactive use. 2765 It would be very bad for personal choices like this to affect the 2766 functioning of makefiles. *Note Variables from the Environment: 2767 Environment. However, on MS-DOS and MS-Windows the value of `SHELL' in 2768 the environment *is* used, since on those systems most users do not set 2769 this variable, and therefore it is most likely set specifically to be 2770 used by `make'. On MS-DOS, if the setting of `SHELL' is not suitable 2771 for `make', you can set the variable `MAKESHELL' to the shell that 2772 `make' should use; this will override the value of `SHELL'. 2773 2774 ---------- Footnotes ---------- 2775 2776 (1) On MS-DOS, the value of current working directory is *global*, 2777 so changing it _will_ affect the following command lines on those 2778 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'. 2779 3281 2780 3282 2781 3283 File: make.info, Node: Parallel, Next: Errors, Prev: Execution, Up: Commands 2782 3284 2783 Parallel Execution2784 ================== 3285 5.4 Parallel Execution 3286 ====================== 2785 3287 2786 3288 GNU `make' knows how to execute several commands at once. Normally, … … 2808 3310 streams of all but one running command. This means that attempting to 2809 3311 read from standard input will usually be a fatal error (a `Broken pipe' 2810 signal) for most child processes if there are several. 3312 signal) for most child processes if there are several. 2811 3313 2812 3314 It is unpredictable which command will have a valid standard input … … 2857 3359 File: make.info, Node: Errors, Next: Interrupts, Prev: Parallel, Up: Commands 2858 3360 2859 Errors in Commands2860 ================== 3361 5.5 Errors in Commands 3362 ====================== 2861 3363 2862 3364 After each shell command returns, `make' looks at its exit status. If … … 2916 3418 program as possible, perhaps to find several independent problems so 2917 3419 that you can correct them all before the next attempt to compile. This 2918 is why Emacs' `compile' command passes the `-k' flag by default. 3420 is why Emacs' `compile' command passes the `-k' flag by default. 2919 3421 2920 3422 Usually when a command fails, if it has changed the target file at … … 2933 3435 File: make.info, Node: Interrupts, Next: Recursion, Prev: Errors, Up: Commands 2934 3436 2935 Interrupting or Killing `make'2936 ============================== 3437 5.6 Interrupting or Killing `make' 3438 ================================== 2937 3439 2938 3440 If `make' gets a fatal signal while a command is executing, it may … … 2964 3466 File: make.info, Node: Recursion, Next: Sequences, Prev: Interrupts, Up: Commands 2965 3467 2966 Recursive Use of `make'2967 ======================= 3468 5.7 Recursive Use of `make' 3469 =========================== 2968 3470 2969 3471 Recursive use of `make' means using `make' as a command in a makefile. … … 2981 3483 subsystem: 2982 3484 $(MAKE) -C subdir 2983 3485 2984 3486 You can write recursive `make' commands just by copying this example, 2985 3487 but there are many things to know about how they work and why, and about … … 3011 3513 File: make.info, Node: MAKE Variable, Next: Variables/Recursion, Prev: Recursion, Up: Recursion 3012 3514 3013 How the `MAKE' Variable Works3014 ----------------------------- 3515 5.7.1 How the `MAKE' Variable Works 3516 ----------------------------------- 3015 3517 3016 3518 Recursive `make' commands should always use the variable `MAKE', not … … 3024 3526 is `cd subdir && /bin/make'. If you use a special version of `make' to 3025 3527 run the top-level makefile, the same special version will be executed 3026 for recursive invocations. 3528 for recursive invocations. 3027 3529 3028 3530 As a special feature, using the variable `MAKE' in the commands of a … … 3042 3544 file named `subsystem' and do nothing else. What you really want it to 3043 3545 do is run `cd subdir && make -t'; but that would require executing the 3044 command, and `-t' says not to execute commands. 3546 command, and `-t' says not to execute commands. 3045 3547 3046 3548 The special feature makes this do what you want: whenever a command … … 3056 3558 File: make.info, Node: Variables/Recursion, Next: Options/Recursion, Prev: MAKE Variable, Up: Recursion 3057 3559 3058 Communicating Variables to a Sub-`make'3059 --------------------------------------- 3560 5.7.2 Communicating Variables to a Sub-`make' 3561 --------------------------------------------- 3060 3562 3061 3563 Variable values of the top-level `make' can be passed to the sub-`make' … … 3076 3578 characters other than letters, numbers, and underscores. 3077 3579 3078 The special variables `SHELL' and `MAKEFLAGS' are always exported 3079 (unless you unexport them). `MAKEFILES' is exported if you set it to 3080 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. 3081 3588 3082 3589 `make' automatically passes down variable values that were defined … … 3153 3660 `.EXPORT_ALL_VARIABLES' instead of using the `export' directive. This 3154 3661 will be ignored by old `make's, while the `export' directive will cause 3155 a syntax error. 3662 a syntax error. 3156 3663 3157 3664 Likewise, you can use `unexport' by itself to tell `make' _not_ to … … 3186 3693 File: make.info, Node: Options/Recursion, Next: -w Option, Prev: Variables/Recursion, Up: Recursion 3187 3694 3188 Communicating Options to a Sub-`make'3189 ------------------------------------- 3695 5.7.3 Communicating Options to a Sub-`make' 3696 ------------------------------------------- 3190 3697 3191 3698 Flags such as `-s' and `-k' are passed automatically to the sub-`make' … … 3291 3798 File: make.info, Node: -w Option, Prev: Options/Recursion, Up: Recursion 3292 3799 3293 The `--print-directory' Option3294 ------------------------------ 3800 5.7.4 The `--print-directory' Option 3801 ------------------------------------ 3295 3802 3296 3803 If you use several levels of recursive `make' invocations, the `-w' or … … 3317 3824 File: make.info, Node: Sequences, Next: Empty Commands, Prev: Recursion, Up: Commands 3318 3825 3319 Defining Canned Command Sequences3320 ================================= 3826 5.8 Defining Canned Command Sequences 3827 ===================================== 3321 3828 3322 3829 When the same sequence of commands is useful in making various targets, … … 3332 3839 mv y.tab.c $@ 3333 3840 endef 3334 3841 3335 3842 Here `run-yacc' is the name of the variable being defined; `endef' 3336 3843 marks the end of the definition; the lines in between are the commands. … … 3392 3899 File: make.info, Node: Empty Commands, Prev: Sequences, Up: Commands 3393 3900 3394 Using Empty Commands3395 ==================== 3901 5.9 Using Empty Commands 3902 ======================== 3396 3903 3397 3904 It is sometimes useful to define commands which do nothing. This is … … 3421 3928 File: make.info, Node: Using Variables, Next: Conditionals, Prev: Commands, Up: Top 3422 3929 3423 How to Use Variables3424 ******************** 3930 6 How to Use Variables 3931 ********************** 3425 3932 3426 3933 A "variable" is a name defined in a makefile to represent a string of … … 3428 3935 explicit request into targets, prerequisites, commands, and other parts 3429 3936 of the makefile. (In some other versions of `make', variables are 3430 called "macros".) 3937 called "macros".) 3431 3938 3432 3939 Variables and functions in all parts of a makefile are expanded when … … 3483 3990 File: make.info, Node: Reference, Next: Flavors, Prev: Using Variables, Up: Using Variables 3484 3991 3485 Basics of Variable References3486 ============================= 3992 6.1 Basics of Variable References 3993 ================================= 3487 3994 3488 3995 To substitute a variable's value, write a dollar sign followed by the … … 3500 4007 program : $(objects) 3501 4008 cc -o program $(objects) 3502 4009 3503 4010 $(objects) : defs.h 3504 4011 … … 3523 4030 File: make.info, Node: Flavors, Next: Advanced, Prev: Reference, Up: Using Variables 3524 4031 3525 The Two Flavors of Variables3526 ============================ 4032 6.2 The Two Flavors of Variables 4033 ================================ 3527 4034 3528 4035 There are two ways that a variable in GNU `make' can have a value; we … … 3544 4051 bar = $(ugh) 3545 4052 ugh = Huh? 3546 4053 3547 4054 all:;echo $(foo) 3548 4055 … … 3564 4071 3565 4072 because it will cause an infinite loop in the variable expansion. 3566 (Actually `make' detects the infinite loop and reports an error.) 4073 (Actually `make' detects the infinite loop and reports an error.) 3567 4074 3568 4075 Another disadvantage is that any functions (*note Functions for … … 3605 4112 3606 4113 ifeq (0,${MAKELEVEL}) 3607 cur-dir := $(shell pwd)3608 4114 whoami := $(shell whoami) 3609 4115 host-type := $(shell arch) … … 3615 4121 3616 4122 ${subdirs}: 3617 ${MAKE} cur-dir=${cur-dir}/$@-C $@ all4123 ${MAKE} -C $@ all 3618 4124 3619 4125 Simply expanded variables generally make complicated makefile … … 3669 4175 File: make.info, Node: Advanced, Next: Values, Prev: Flavors, Up: Using Variables 3670 4176 3671 Advanced Features for Reference to Variables3672 ============================================ 4177 6.3 Advanced Features for Reference to Variables 4178 ================================================ 3673 4179 3674 4180 This section describes some advanced features you can use to reference … … 3684 4190 File: make.info, Node: Substitution Refs, Next: Computed Names, Prev: Advanced, Up: Advanced 3685 4191 3686 Substitution References3687 ----------------------- 4192 6.3.1 Substitution References 4193 ----------------------------- 3688 4194 3689 4195 A "substitution reference" substitutes the value of a variable with … … 3717 4223 3718 4224 For example: 3719 4225 3720 4226 foo := a.o b.o c.o 3721 4227 bar := $(foo:%.o=%.c) … … 3726 4232 File: make.info, Node: Computed Names, Prev: Substitution Refs, Up: Advanced 3727 4233 3728 Computed Variable Names3729 ----------------------- 4234 6.3.2 Computed Variable Names 4235 ----------------------------- 3730 4236 3731 4237 Computed variable names are a complicated concept needed only for … … 3798 4304 a_dirs := dira dirb 3799 4305 1_dirs := dir1 dir2 3800 4306 3801 4307 a_files := filea fileb 3802 4308 1_files := file1 file2 3803 4309 3804 4310 ifeq "$(use_a)" "yes" 3805 4311 a1 := a … … 3807 4313 a1 := 1 3808 4314 endif 3809 4315 3810 4316 ifeq "$(use_dirs)" "yes" 3811 4317 df := dirs … … 3813 4319 df := files 3814 4320 endif 3815 4321 3816 4322 dirs := $($(a1)_$(df)) 3817 4323 … … 3823 4329 a_objects := a.o b.o c.o 3824 4330 1_objects := 1.o 2.o 3.o 3825 4331 3826 4332 sources := $($(a1)_objects:.o=.c) 3827 4333 … … 3839 4345 func := strip 3840 4346 endif 3841 4347 3842 4348 bar := a d b g q c 3843 4349 3844 4350 foo := $($(func) $(bar)) 3845 4351 … … 3869 4375 File: make.info, Node: Values, Next: Setting, Prev: Advanced, Up: Using Variables 3870 4376 3871 How Variables Get Their Values3872 ============================== 4377 6.4 How Variables Get Their Values 4378 ================================== 3873 4379 3874 4380 Variables can get values in several different ways: … … 3894 4400 File: make.info, Node: Setting, Next: Appending, Prev: Values, Up: Using Variables 3895 4401 3896 Setting Variables3897 ================= 4402 6.5 Setting Variables 4403 ===================== 3898 4404 3899 4405 To set a variable from the makefile, write a line starting with the … … 3947 4453 File: make.info, Node: Appending, Next: Override Directive, Prev: Setting, Up: Using Variables 3948 4454 3949 Appending More Text to Variables3950 ================================ 4455 6.6 Appending More Text to Variables 4456 ==================================== 3951 4457 3952 4458 Often it is useful to add more text to the value of a variable already … … 3983 4489 it a simply-expanded variable, `+=' adds to that simply-expanded 3984 4490 definition, and expands the new text before appending it to the old 3985 value just as `:=' does ( *note Setting Variables: Setting., for a full3986 explanation of `:='). In fact,4491 value just as `:=' does (see *Note Setting Variables: Setting, for a 4492 full explanation of `:='). In fact, 3987 4493 3988 4494 variable := value … … 3990 4496 3991 4497 is exactly equivalent to: 4498 3992 4499 3993 4500 variable := value … … 4022 4529 The first line defines the `CFLAGS' variable with a reference to another 4023 4530 variable, `includes'. (`CFLAGS' is used by the rules for C 4024 compilation; *note Catalogue of Implicit Rules: Catalogue of Rules. .)4531 compilation; *note Catalogue of Implicit Rules: Catalogue of Rules.) 4025 4532 Using `=' for the definition makes `CFLAGS' a recursively-expanded 4026 4533 variable, meaning `$(includes) -O' is _not_ expanded when `make' … … 4044 4551 File: make.info, Node: Override Directive, Next: Defining, Prev: Appending, Up: Using Variables 4045 4552 4046 The `override' Directive4047 ======================== 4553 6.7 The `override' Directive 4554 ============================ 4048 4555 4049 4556 If a variable has been set with a command argument (*note Overriding … … 4088 4595 File: make.info, Node: Defining, Next: Environment, Prev: Override Directive, Up: Using Variables 4089 4596 4090 Defining Variables Verbatim4091 =========================== 4597 6.8 Defining Variables Verbatim 4598 =============================== 4092 4599 4093 4600 Another way to set the value of a variable is to use the `define' … … 4147 4654 File: make.info, Node: Environment, Next: Target-specific, Prev: Defining, Up: Using Variables 4148 4655 4149 Variables from the Environment4150 ============================== 4656 6.9 Variables from the Environment 4657 ================================== 4151 4658 4152 4659 Variables in `make' can come from the environment in which `make' is 4153 4660 run. Every environment variable that `make' sees when it starts up is 4154 transformed into a `make' variable with the same name and value. But4155 an explicit assignment in the makefile, or with a command argument, 4156 overrides the environment. (If the `-e' flag is specified, then values 4157 from the environment override assignments in the makefile. *Note 4158 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 4159 4666 practice.) 4160 4667 … … 4163 4670 you prefer. This is safe for variables with standard or conventional 4164 4671 meanings because you know that no makefile will use them for other 4165 things. ( But this is not totally reliable; some makefiles set `CFLAGS'4166 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 4167 4674 environment.) 4168 4675 4169 When `make' is invoked recursively, variables defined in the outer4170 invocation can be passed to inner invocations through the environment 4171 (*note Recursive Use of `make': Recursion.). By default, only 4172 variables that came from the environment or the command line are passed 4173 to recursive invocations. You can use the `export' directive to pass 4174 other variables. *Note Communicating Variables to a Sub-`make': 4175 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. 4176 4683 4177 4684 Other use of variables from the environment is not recommended. It … … 4184 4691 which is normally present in the environment to specify the user's 4185 4692 choice of interactive shell. It would be very undesirable for this 4186 choice to affect `make'. So `make' ignores the environment value of 4187 `SHELL' (except on MS-DOS and MS-Windows, where `SHELL' is usually not 4188 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::. 4189 4695 4190 4696 4191 4697 File: make.info, Node: Target-specific, Next: Pattern-specific, Prev: Environment, Up: Using Variables 4192 4698 4193 Target-specific Variable Values4194 =============================== 4699 6.10 Target-specific Variable Values 4700 ==================================== 4195 4701 4196 4702 Variable values in `make' are usually global; that is, they are the … … 4261 4767 File: make.info, Node: Pattern-specific, Prev: Target-specific, Up: Using Variables 4262 4768 4263 Pattern-specific Variable Values4264 ================================ 4769 6.11 Pattern-specific Variable Values 4770 ===================================== 4265 4771 4266 4772 In addition to target-specific variable values (*note Target-specific … … 4299 4805 File: make.info, Node: Conditionals, Next: Functions, Prev: Using Variables, Up: Top 4300 4806 4301 Conditional Parts of Makefiles4302 ****************************** 4807 7 Conditional Parts of Makefiles 4808 ******************************** 4303 4809 4304 4810 A "conditional" causes part of a makefile to be obeyed or ignored … … 4318 4824 File: make.info, Node: Conditional Example, Next: Conditional Syntax, Prev: Conditionals, Up: Conditionals 4319 4825 4320 Example of a Conditional4321 ======================== 4826 7.1 Example of a Conditional 4827 ============================ 4322 4828 4323 4829 The following example of a conditional tells `make' to use one set of … … 4330 4836 libs_for_gcc = -lgnu 4331 4837 normal_libs = 4332 4838 4333 4839 foo: $(objects) 4334 4840 ifeq ($(CC),gcc) … … 4380 4886 libs_for_gcc = -lgnu 4381 4887 normal_libs = 4382 4888 4383 4889 ifeq ($(CC),gcc) 4384 4890 libs=$(libs_for_gcc) … … 4386 4892 libs=$(normal_libs) 4387 4893 endif 4388 4894 4389 4895 foo: $(objects) 4390 4896 $(CC) -o foo $(objects) $(libs) … … 4393 4899 File: make.info, Node: Conditional Syntax, Next: Testing Flags, Prev: Conditional Example, Up: Conditionals 4394 4900 4395 Syntax of Conditionals4396 ====================== 4901 7.2 Syntax of Conditionals 4902 ========================== 4397 4903 4398 4904 The syntax of a simple conditional with no `else' is as follows: … … 4414 4920 endif 4415 4921 4416 If the condition is true, TEXT-IF-TRUE is used; otherwise, 4417 TEXT-IF-FALSE is used instead. The TEXT-IF-FALSE can be any number of 4418 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. 4419 4937 4420 4938 The syntax of the CONDITIONAL-DIRECTIVE is the same whether the 4421 conditional is simple or complex. There are four different directives 4422 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: 4423 4942 4424 4943 `ifeq (ARG1, ARG2)' … … 4456 4975 4457 4976 `ifdef VARIABLE-NAME' 4458 If the variable VARIABLE-NAME has a non-empty value, the 4459 TEXT-IF-TRUE is effective; otherwise, the TEXT-IF-FALSE, if any, 4460 is effective. Variables that have never been defined have an 4461 empty value. The variable VARIABLE-NAME is itself expanded, so it 4462 could be a variable or function that expands to the name of a 4463 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. 4464 4995 4465 4996 Note that `ifdef' only tests whether a variable has a value. It … … 4491 5022 If the variable VARIABLE-NAME has an empty value, the TEXT-IF-TRUE 4492 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. 4493 5026 4494 5027 Extra spaces are allowed and ignored at the beginning of the … … 4525 5058 File: make.info, Node: Testing Flags, Prev: Conditional Syntax, Up: Conditionals 4526 5059 4527 Conditionals that Test Flags4528 ============================ 5060 7.3 Conditionals that Test Flags 5061 ================================ 4529 5062 4530 5063 You can write a conditional that tests `make' command flags such as … … 4556 5089 File: make.info, Node: Functions, Next: Running, Prev: Conditionals, Up: Top 4557 5090 4558 Functions for Transforming Text4559 ******************************* 5091 8 Functions for Transforming Text 5092 ********************************* 4560 5093 4561 5094 "Functions" allow you to do text processing in the makefile to compute … … 4571 5104 * Text Functions:: General-purpose text manipulation functions. 4572 5105 * File Name Functions:: Functions for manipulating file names. 5106 * Conditional Functions:: Functions that implement conditions. 4573 5107 * Foreach Function:: Repeat some text with controlled variation. 4574 * If Function:: Conditionally expand a value.4575 5108 * Call Function:: Expand a user-defined function. 4576 5109 * Value Function:: Return the un-expanded value of a variable. 4577 5110 * Eval Function:: Evaluate the arguments as makefile syntax. 4578 5111 * Origin Function:: Find where a variable got its value. 5112 * Flavor Function:: Find out the flavor of a variable. 4579 5113 * Shell Function:: Substitute the output of a shell command. 4580 5114 * Make Control Functions:: Functions that control how make runs. … … 4583 5117 File: make.info, Node: Syntax of Functions, Next: Text Functions, Prev: Functions, Up: Functions 4584 5118 4585 Function Call Syntax4586 ==================== 5119 8.1 Function Call Syntax 5120 ======================== 4587 5121 4588 5122 A function call resembles a variable reference. It looks like this: … … 4637 5171 File: make.info, Node: Text Functions, Next: File Name Functions, Prev: Syntax of Functions, Up: Functions 4638 5172 4639 Functions for String Substitution and Analysis4640 ============================================== 5173 8.2 Functions for String Substitution and Analysis 5174 ================================================== 4641 5175 4642 5176 Here are some functions that operate on strings: … … 4803 5337 `$(wordlist S,E,TEXT)' 4804 5338 Returns the list of words in TEXT starting with word S and ending 4805 with word E (inclusive). The legitimate values of S and E start4806 from 1. If S is bigger than the number of words in TEXT, the4807 value is empty. If E is bigger than the number of words in TEXT,4808 words up to the end of TEXT are returned. If S is greater than E,4809 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, 4810 5344 4811 5345 $(wordlist 2, 3, foo bar baz) … … 4829 5363 same as `$(word 1,TEXT)', the `firstword' function is retained for 4830 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. 4831 5377 4832 5378 Here is a realistic example of the use of `subst' and `patsubst'. … … 4857 5403 4858 5404 4859 File: make.info, Node: File Name Functions, Next: Foreach Function, Prev: Text Functions, Up: Functions4860 4861 Functions for File Names4862 ======================== 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 ============================ 4863 5409 4864 5410 Several of the built-in expansion functions relate specifically to … … 4969 5515 File Names: Wildcards. 4970 5516 4971 4972 File: make.info, Node: Foreach Function, Next: If Function, Prev: File Name Functions, Up: Functions 4973 4974 The `foreach' Function 4975 ====================== 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 ========================== 4976 5590 4977 5591 The `foreach' function is very different from other functions. It … … 5045 5659 5046 5660 5047 File: make.info, Node: If Function, Next: Call Function, Prev: Foreach Function, Up: Functions 5048 5049 The `if' Function 5050 ================= 5051 5052 The `if' function provides support for conditional expansion in a 5053 functional context (as opposed to the GNU `make' makefile conditionals 5054 such as `ifeq' (*note Syntax of Conditionals: Conditional Syntax.). 5055 5056 An `if' function call can contain either two or three arguments: 5057 5058 $(if CONDITION,THEN-PART[,ELSE-PART]) 5059 5060 The first argument, CONDITION, first has all preceding and trailing 5061 whitespace stripped, then is expanded. If it expands to any non-empty 5062 string, then the condition is considered to be true. If it expands to 5063 an empty string, the condition is considered to be false. 5064 5065 If the condition is true then the second argument, THEN-PART, is 5066 evaluated and this is used as the result of the evaluation of the entire 5067 `if' function. 5068 5069 If the condition is false then the third argument, ELSE-PART, is 5070 evaluated and this is the result of the `if' function. If there is no 5071 third argument, the `if' function evaluates to nothing (the empty 5072 string). 5073 5074 Note that only one of the THEN-PART or the ELSE-PART will be 5075 evaluated, never both. Thus, either can contain side-effects (such as 5076 `shell' function calls, etc.) 5077 5078 5079 File: make.info, Node: Call Function, Next: Value Function, Prev: If Function, Up: Functions 5080 5081 The `call' Function 5082 =================== 5661 File: make.info, Node: Call Function, Next: Value Function, Prev: Foreach Function, Up: Functions 5662 5663 8.6 The `call' Function 5664 ======================= 5083 5665 5084 5666 The `call' function is unique in that it can be used to create new … … 5119 5701 5120 5702 reverse = $(2) $(1) 5121 5703 5122 5704 foo = $(call reverse,a,b) 5123 5705 … … 5128 5710 5129 5711 pathsearch = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,$(PATH))))) 5130 5712 5131 5713 LS := $(call pathsearch,ls) 5132 5714 … … 5156 5738 File: make.info, Node: Value Function, Next: Eval Function, Prev: Call Function, Up: Functions 5157 5739 5158 The `value' Function5159 ==================== 5740 8.7 The `value' Function 5741 ======================== 5160 5742 5161 5743 The `value' function provides a way for you to use the value of a … … 5180 5762 5181 5763 FOO = $PATH 5182 5764 5183 5765 all: 5184 5766 @echo $(FOO) … … 5196 5778 File: make.info, Node: Eval Function, Next: Origin Function, Prev: Value Function, Up: Functions 5197 5779 5198 The `eval' Function5199 =================== 5780 8.8 The `eval' Function 5781 ======================= 5200 5782 5201 5783 The `eval' function is very special: it allows you to define new … … 5228 5810 5229 5811 PROGRAMS = server client 5230 5812 5231 5813 server_OBJS = server.o server_priv.o server_access.o 5232 5814 server_LIBS = priv protocol 5233 5815 5234 5816 client_OBJS = client.o client_api.o client_mem.o 5235 5817 client_LIBS = protocol 5236 5818 5237 5819 # Everything after this is generic 5238 5820 5239 5821 .PHONY: all 5240 5822 all: $(PROGRAMS) 5241 5823 5242 5824 define PROGRAM_template 5243 5825 $(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%) 5244 5826 ALL_OBJS += $$($(1)_OBJS) 5245 5827 endef 5246 5828 5247 5829 $(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog)))) 5248 5830 5249 5831 $(PROGRAMS): 5250 5832 $(LINK.o) $^ $(LDLIBS) -o $@ 5251 5833 5252 5834 clean: 5253 5835 rm -f $(ALL_OBJS) $(PROGRAMS) 5254 5836 5255 5837 5256 File: make.info, Node: Origin Function, Next: ShellFunction, Prev: Eval Function, Up: Functions5257 5258 The `origin' Function5259 ===================== 5838 File: make.info, Node: Origin Function, Next: Flavor Function, Prev: Eval Function, Up: Functions 5839 5840 8.9 The `origin' Function 5841 ========================= 5260 5842 5261 5843 The `origin' function is unlike most other functions in that it does … … 5340 5922 5341 5923 5342 File: make.info, Node: Shell Function, Next: Make Control Functions, Prev: Origin Function, Up: Functions 5343 5344 The `shell' Function 5345 ==================== 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 ========================= 5346 5961 5347 5962 The `shell' function is unlike any other function other than the … … 5374 5989 5375 5990 sets `files' to the expansion of `*.c'. Unless `make' is using a very 5376 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). 5377 5993 5378 5994 5379 5995 File: make.info, Node: Make Control Functions, Prev: Shell Function, Up: Functions 5380 5996 5381 Functions That Control Make5382 =========================== 5997 8.12 Functions That Control Make 5998 ================================ 5383 5999 5384 6000 These functions control the way make runs. Generally, they are used to … … 5403 6019 5404 6020 ERR = $(error found an error!) 5405 6021 5406 6022 .PHONY: err 5407 6023 err: ; $(ERR) … … 5418 6034 The result of the expansion of this function is the empty string. 5419 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 5420 6042 5421 6043 File: make.info, Node: Running, Next: Implicit Rules, Prev: Functions, Up: Top 5422 6044 5423 How to Run `make'5424 ***************** 6045 9 How to Run `make' 6046 ******************* 5425 6047 5426 6048 A makefile that says how to recompile a program can be used in more … … 5468 6090 File: make.info, Node: Makefile Arguments, Next: Goals, Prev: Running, Up: Running 5469 6091 5470 Arguments to Specify the Makefile5471 ================================= 6092 9.1 Arguments to Specify the Makefile 6093 ===================================== 5472 6094 5473 6095 The way to specify the name of the makefile is with the `-f' or … … 5486 6108 File: make.info, Node: Goals, Next: Instead of Execution, Prev: Makefile Arguments, Up: Running 5487 6109 5488 Arguments to Specify the Goals5489 ============================== 6110 9.2 Arguments to Specify the Goals 6111 ================================== 5490 6112 5491 6113 The "goals" are the targets that `make' should strive ultimately to … … 5498 6120 program or programs they describe. If the first rule in the makefile 5499 6121 has several targets, only the first target in the rule becomes the 5500 default goal, not the whole list. 5501 5502 You can specify a different goal or goals with arguments to `make'. 5503 Use the name of the goal as an argument. If you specify several goals, 5504 `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. 5505 6130 5506 6131 Any target in the makefile may be specified as a goal (unless it … … 5520 6145 5521 6146 sources = foo.c bar.c 5522 6147 5523 6148 ifneq ($(MAKECMDGOALS),clean) 5524 6149 include $(sources:.c=.d) … … 5600 6225 File: make.info, Node: Instead of Execution, Next: Avoiding Compilation, Prev: Goals, Up: Running 5601 6226 5602 Instead of Executing the Commands5603 ================================= 6227 9.3 Instead of Executing the Commands 6228 ===================================== 5604 6229 5605 6230 The makefile tells `make' how to tell whether a target is up to date, … … 5679 6304 File: make.info, Node: Avoiding Compilation, Next: Overriding, Prev: Instead of Execution, Up: Running 5680 6305 5681 Avoiding Recompilation of Some Files5682 ==================================== 6306 9.4 Avoiding Recompilation of Some Files 6307 ======================================== 5683 6308 5684 6309 Sometimes you may have changed a source file but you do not want to … … 5722 6347 File: make.info, Node: Overriding, Next: Testing, Prev: Avoiding Compilation, Up: Running 5723 6348 5724 Overriding Variables5725 ==================== 6349 9.5 Overriding Variables 6350 ======================== 5726 6351 5727 6352 An argument that contains `=' specifies the value of a variable: `V=X' … … 5774 6399 File: make.info, Node: Testing, Next: Options Summary, Prev: Overriding, Up: Running 5775 6400 5776 Testing the Compilation of a Program5777 ==================================== 6401 9.6 Testing the Compilation of a Program 6402 ======================================== 5778 6403 5779 6404 Normally, when an error happens in executing a shell command, `make' … … 5810 6435 File: make.info, Node: Options Summary, Prev: Testing, Up: Running 5811 6436 5812 Summary of Options5813 ================== 6437 9.7 Summary of Options 6438 ====================== 5814 6439 5815 6440 Here is a table of all the options `make' understands: … … 5824 6449 Consider all targets out-of-date. GNU `make' proceeds to consider 5825 6450 targets and their prerequisites using the normal algorithms; 5826 however, all these targets are remade, regardless of the status of 5827 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.). 5828 6457 5829 6458 `-C DIR' … … 5930 6559 floating-point number). With no argument, removes a previous load 5931 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. 5932 6570 5933 6571 `-n' … … 6052 6690 File: make.info, Node: Implicit Rules, Next: Archives, Prev: Running, Up: Top 6053 6691 6054 Using Implicit Rules6055 ******************** 6692 10 Using Implicit Rules 6693 *********************** 6056 6694 6057 6695 Certain standard ways of remaking target files are used very often. For … … 6090 6728 * Chained Rules:: How to use a chain of implicit rules. 6091 6729 * Pattern Rules:: How to define new implicit rules. 6092 * Last Resort:: How to defin ing commands for rules6093 whichcannot find any.6730 * Last Resort:: How to define commands for rules which 6731 cannot find any. 6094 6732 * Suffix Rules:: The old-fashioned style of implicit rule. 6095 6733 * Implicit Rule Search:: The precise algorithm for applying … … 6099 6737 File: make.info, Node: Using Implicit, Next: Catalogue of Rules, Prev: Implicit Rules, Up: Implicit Rules 6100 6738 6101 Using Implicit Rules6102 ==================== 6739 10.1 Using Implicit Rules 6740 ========================= 6103 6741 6104 6742 To allow `make' to find a customary method for updating a target file, … … 6173 6811 File: make.info, Node: Catalogue of Rules, Next: Implicit Variables, Prev: Using Implicit, Up: Implicit Rules 6174 6812 6175 Catalogue of Implicit Rules6176 =========================== 6813 10.2 Catalogue of Implicit Rules 6814 ================================ 6177 6815 6178 6816 Here is a catalogue of predefined implicit rules which are always … … 6182 6820 `--no-builtin-rules' option cancels all predefined rules. 6183 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 6184 6828 Not all of these rules will always be defined, even when the `-r' 6185 6829 option is not given. Many of the predefined implicit rules are … … 6187 6831 depends on the "suffix list" (the list of prerequisites of the special 6188 6832 target `.SUFFIXES'). The default suffix list is: `.out', `.a', `.ln', 6189 `.o', `.c', `.cc', `.C', `. p', `.f', `.F', `.r', `.y', `.l', `.s',6190 `. S', `.mod', `.sym', `.def', `.h', `.info', `.dvi', `.tex', `.texinfo',6191 `.texi ', `.txinfo', `.w', `.ch' `.web', `.sh', `.elc', `.el'. All of6192 the implicit rules described below whose prerequisites have one of 6193 these suffixes are actually suffix rules. If you modify the suffix 6194 list, the only predefined suffix rules in effect will be those named by 6195 one or two of the suffixes that are on the list you specify; rules 6196 whose suffixes fail to be on the list are disabled. *Note 6197 Old-Fashioned Suffix Rules: Suffix Rules, for full details on suffix 6198 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. 6199 6843 6200 6844 Compiling C programs … … 6203 6847 6204 6848 Compiling C++ programs 6205 `N.o' is made automatically from `N.cc' or `N.C' with a command of 6206 the form `$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)'. We encourage you to 6207 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'. 6208 6853 6209 6854 Compiling Pascal programs … … 6379 7024 File: make.info, Node: Implicit Variables, Next: Chained Rules, Prev: Catalogue of Rules, Up: Implicit Rules 6380 7025 6381 Variables Used by Implicit Rules6382 ================================ 7026 10.3 Variables Used by Implicit Rules 7027 ===================================== 6383 7028 6384 7029 The commands in built-in implicit rules make liberal use of certain 6385 predefined variables. You can alter the se variables in the makefile,6386 with arguments to `make', or in the environment to alter how the 6387 implicit rules work without redefining the rules themselves. You can 6388 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 6389 7034 `--no-builtin-variables' option. 6390 7035 … … 6406 7051 argument, separate them with spaces. 6407 7052 6408 Here is a table of variables used as names of programs in built-in 6409 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. 6410 7062 6411 7063 `AR' 6412 Archive-maintaining program; default `ar'. 7064 Archive-maintaining program; default `ar'. 6413 7065 6414 7066 `AS' 6415 Program for doing assembly; default `as'.7067 Program for compiling assembly files; default `as'. 6416 7068 6417 7069 `CC' 6418 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'. 6419 7074 6420 7075 `CXX' 6421 Program for compiling C++ programs; default `g++'. 7076 Program for compiling C++ programs; default `g++'. 6422 7077 6423 7078 `CO' 6424 Program for extracting a file from RCS; default `co'. 7079 Program for extracting a file from RCS; default `co'. 6425 7080 6426 7081 `CPP' … … 6430 7085 `FC' 6431 7086 Program for compiling or preprocessing Fortran and Ratfor programs; 6432 default `f77'. 7087 default `f77'. 6433 7088 6434 7089 `GET' 6435 Program for extracting a file from SCCS; default `get'. 7090 Program for extracting a file from SCCS; default `get'. 6436 7091 6437 7092 `LEX' 6438 Program to use to turn Lex grammars into C programs or Ratfor 6439 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'. 6440 7105 6441 7106 `PC' 6442 Program for compiling Pascal programs; default `pc'. 6443 6444 `YACC' 6445 Program to use to turn Yacc grammars into C programs; default 6446 `yacc'. 6447 6448 `YACCR' 6449 Program to use to turn Yacc grammars into Ratfor programs; default 6450 `yacc -r'. 7107 Program for compiling Pascal programs; default `pc'. 6451 7108 6452 7109 `MAKEINFO' 6453 7110 Program to convert a Texinfo source file into an Info file; default 6454 `makeinfo'. 7111 `makeinfo'. 6455 7112 6456 7113 `TEX' 6457 Program to make TeX DVI files from TeX source; default `tex'. 7114 Program to make TeX DVI files from TeX source; default `tex'. 6458 7115 6459 7116 `TEXI2DVI' 6460 7117 Program to make TeX DVI files from Texinfo source; default 6461 `texi2dvi'. 7118 `texi2dvi'. 6462 7119 6463 7120 `WEAVE' 6464 Program to translate Web into TeX; default `weave'. 7121 Program to translate Web into TeX; default `weave'. 6465 7122 6466 7123 `CWEAVE' 6467 Program to translate C Web into TeX; default `cweave'. 7124 Program to translate C Web into TeX; default `cweave'. 6468 7125 6469 7126 `TANGLE' 6470 Program to translate Web into Pascal; default `tangle'. 7127 Program to translate Web into Pascal; default `tangle'. 6471 7128 6472 7129 `CTANGLE' 6473 Program to translate C Web into C; default `ctangle'. 7130 Program to translate C Web into C; default `ctangle'. 6474 7131 6475 7132 `RM' 6476 Command to remove a file; default `rm -f'. 7133 Command to remove a file; default `rm -f'. 6477 7134 6478 7135 Here is a table of variables whose values are additional arguments … … 6513 7170 Extra flags to give to Lex. 6514 7171 7172 `YFLAGS' 7173 Extra flags to give to Yacc. 7174 6515 7175 `PFLAGS' 6516 7176 Extra flags to give to the Pascal compiler. … … 6519 7179 Extra flags to give to the Fortran compiler for Ratfor programs. 6520 7180 6521 ` YFLAGS'6522 Extra flags to give to Yacc.7181 `LINTFLAGS' 7182 Extra flags to give to lint. 6523 7183 6524 7184 6525 7185 File: make.info, Node: Chained Rules, Next: Pattern Rules, Prev: Implicit Variables, Up: Implicit Rules 6526 7186 6527 Chains of Implicit Rules6528 ======================== 7187 10.4 Chains of Implicit Rules 7188 ============================= 6529 7189 6530 7190 Sometimes a file can be made by a sequence of implicit rules. For … … 6578 7238 as a prerequisite of the special target `.PRECIOUS' to preserve 6579 7239 intermediate files made by implicit rules whose target patterns match 6580 that file's name; see *Note Interrupts::. 7240 that file's name; see *Note Interrupts::. 6581 7241 6582 7242 A chain can involve more than two implicit rules. For example, it is … … 6600 7260 earlier in the ordering of rules. 6601 7261 6602 6603 File: make.info, Node: Pattern Rules, Next: Last Resort, Prev: Chained Rules, Up: Implicit Rules6604 6605 Defining and Redefining Pattern Rules6606 =====================================6607 6608 You define an implicit rule by writing a "pattern rule". A pattern6609 rule looks like an ordinary rule, except that its target contains the6610 character `%' (exactly one of them). The target is considered a6611 pattern for matching file names; the `%' can match any nonempty6612 substring, while other characters match only themselves. The6613 prerequisites likewise use `%' to show how their names relate to the6614 target name.6615 6616 Thus, a pattern rule `%.o : %.c' says how to make any file `STEM.o'6617 from another file `STEM.c'.6618 6619 Note that expansion using `%' in pattern rules occurs *after* any6620 variable or function expansions, which take place when the makefile is6621 read. *Note How to Use Variables: Using Variables, and *Note Functions6622 for Transforming Text: Functions.6623 6624 * Menu:6625 6626 * Pattern Intro:: An introduction to pattern rules.6627 * Pattern Examples:: Examples of pattern rules.6628 * Automatic Variables:: How to use automatic variables in the6629 commands of implicit rules.6630 * Pattern Match:: How patterns match.6631 * Match-Anything Rules:: Precautions you should take prior to6632 defining rules that can match any6633 target file whatever.6634 * Canceling Rules:: How to override or cancel built-in rules.6635 6636 6637 File: make.info, Node: Pattern Intro, Next: Pattern Examples, Prev: Pattern Rules, Up: Pattern Rules6638 6639 Introduction to Pattern Rules6640 -----------------------------6641 6642 A pattern rule contains the character `%' (exactly one of them) in the6643 target; otherwise, it looks exactly like an ordinary rule. The target6644 is a pattern for matching file names; the `%' matches any nonempty6645 substring, while other characters match only themselves.6646 6647 For example, `%.c' as a pattern matches any file name that ends in6648 `.c'. `s.%.c' as a pattern matches any file name that starts with6649 `s.', ends in `.c' and is at least five characters long. (There must6650 be at least one character to match the `%'.) The substring that the6651 `%' matches is called the "stem".6652 6653 `%' in a prerequisite of a pattern rule stands for the same stem6654 that was matched by the `%' in the target. In order for the pattern6655 rule to apply, its target pattern must match the file name under6656 consideration, and its prerequisite patterns must name files that exist6657 or can be made. These files become prerequisites of the target.6658 6659 Thus, a rule of the form6660 6661 %.o : %.c ; COMMAND...6662 6663 specifies how to make a file `N.o', with another file `N.c' as its6664 prerequisite, provided that `N.c' exists or can be made.6665 6666 There may also be prerequisites that do not use `%'; such a6667 prerequisite attaches to every file made by this pattern rule. These6668 unvarying prerequisites are useful occasionally.6669 6670 A pattern rule need not have any prerequisites that contain `%', or6671 in fact any prerequisites at all. Such a rule is effectively a general6672 wildcard. It provides a way to make any file that matches the target6673 pattern. *Note Last Resort::.6674 6675 Pattern rules may have more than one target. Unlike normal rules,6676 this does not act as many different rules with the same prerequisites6677 and commands. If a pattern rule has multiple targets, `make' knows that6678 the rule's commands are responsible for making all of the targets. The6679 commands are executed only once to make all the targets. When searching6680 for a pattern rule to match a target, the target patterns of a rule6681 other than the one that matches the target in need of a rule are6682 incidental: `make' worries only about giving commands and prerequisites6683 to the file presently in question. However, when this file's commands6684 are run, the other targets are marked as having been updated themselves.6685 6686 The order in which pattern rules appear in the makefile is important6687 since this is the order in which they are considered. Of equally6688 applicable rules, only the first one found is used. The rules you6689 write take precedence over those that are built in. Note however, that6690 a rule whose prerequisites actually exist or are mentioned always takes6691 priority over a rule with prerequisites that must be made by chaining6692 other implicit rules.6693 6694 6695 File: make.info, Node: Pattern Examples, Next: Automatic Variables, Prev: Pattern Intro, Up: Pattern Rules6696 6697 Pattern Rule Examples6698 ---------------------6699 6700 Here are some examples of pattern rules actually predefined in `make'.6701 First, the rule that compiles `.c' files into `.o' files:6702 6703 %.o : %.c6704 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@6705 6706 defines a rule that can make any file `X.o' from `X.c'. The command6707 uses the automatic variables `$@' and `$<' to substitute the names of6708 the target file and the source file in each case where the rule applies6709 (*note Automatic Variables::).6710 6711 Here is a second built-in rule:6712 6713 % :: RCS/%,v6714 $(CO) $(COFLAGS) $<6715 6716 defines a rule that can make any file `X' whatsoever from a6717 corresponding file `X,v' in the subdirectory `RCS'. Since the target6718 is `%', this rule will apply to any file whatever, provided the6719 appropriate prerequisite file exists. The double colon makes the rule6720 "terminal", which means that its prerequisite may not be an intermediate6721 file (*note Match-Anything Pattern Rules: Match-Anything Rules.).6722 6723 This pattern rule has two targets:6724 6725 %.tab.c %.tab.h: %.y6726 bison -d $<6727 6728 This tells `make' that the command `bison -d X.y' will make both6729 `X.tab.c' and `X.tab.h'. If the file `foo' depends on the files6730 `parse.tab.o' and `scan.o' and the file `scan.o' depends on the file6731 `parse.tab.h', when `parse.y' is changed, the command `bison -d parse.y'6732 will be executed only once, and the prerequisites of both `parse.tab.o'6733 and `scan.o' will be satisfied. (Presumably the file `parse.tab.o'6734 will be recompiled from `parse.tab.c' and the file `scan.o' from6735 `scan.c', while `foo' is linked from `parse.tab.o', `scan.o', and its6736 other prerequisites, and it will execute happily ever after.)6737 6738 6739 File: make.info, Node: Automatic Variables, Next: Pattern Match, Prev: Pattern Examples, Up: Pattern Rules6740 6741 Automatic Variables6742 -------------------6743 6744 Suppose you are writing a pattern rule to compile a `.c' file into a6745 `.o' file: how do you write the `cc' command so that it operates on the6746 right source file name? You cannot write the name in the command,6747 because the name is different each time the implicit rule is applied.6748 6749 What you do is use a special feature of `make', the "automatic6750 variables". These variables have values computed afresh for each rule6751 that is executed, based on the target and prerequisites of the rule.6752 In this example, you would use `$@' for the object file name and `$<'6753 for the source file name.6754 6755 It's very important that you recognize the limited scope in which6756 automatic variable values are available: they only have values within6757 the command script. In particular, you cannot use them anywhere within6758 the target or prerequisite lists of a rule; they have no value there6759 and will expand to the empty string. A common mistake is attempting to6760 use `$@' within the prerequisites list in a rule; this will not work.6761 However, see below for information on the SysV-style `$$@' variables.6762 6763 Here is a table of automatic variables:6764 6765 `$@'6766 The file name of the target of the rule. If the target is an6767 archive member, then `$@' is the name of the archive file. In a6768 pattern rule that has multiple targets (*note Introduction to6769 Pattern Rules: Pattern Intro.), `$@' is the name of whichever6770 target caused the rule's commands to be run.6771 6772 `$%'6773 The target member name, when the target is an archive member.6774 *Note Archives::. For example, if the target is `foo.a(bar.o)'6775 then `$%' is `bar.o' and `$@' is `foo.a'. `$%' is empty when the6776 target is not an archive member.6777 6778 `$<'6779 The name of the first prerequisite. If the target got its6780 commands from an implicit rule, this will be the first6781 prerequisite added by the implicit rule (*note Implicit Rules::).6782 6783 `$?'6784 The names of all the prerequisites that are newer than the target,6785 with spaces between them. For prerequisites which are archive6786 members, only the member named is used (*note Archives::).6787 6788 `$^'6789 The names of all the prerequisites, with spaces between them. For6790 prerequisites which are archive members, only the member named is6791 used (*note Archives::). A target has only one prerequisite on6792 each other file it depends on, no matter how many times each file6793 is listed as a prerequisite. So if you list a prerequisite more6794 than once for a target, the value of `$^' contains just one copy6795 of the name.6796 6797 `$+'6798 This is like `$^', but prerequisites listed more than once are6799 duplicated in the order they were listed in the makefile. This is6800 primarily useful for use in linking commands where it is6801 meaningful to repeat library file names in a particular order.6802 6803 `$*'6804 The stem with which an implicit rule matches (*note How Patterns6805 Match: Pattern Match.). If the target is `dir/a.foo.b' and the6806 target pattern is `a.%.b' then the stem is `dir/foo'. The stem is6807 useful for constructing names of related files.6808 6809 In a static pattern rule, the stem is part of the file name that6810 matched the `%' in the target pattern.6811 6812 In an explicit rule, there is no stem; so `$*' cannot be determined6813 in that way. Instead, if the target name ends with a recognized6814 suffix (*note Old-Fashioned Suffix Rules: Suffix Rules.), `$*' is6815 set to the target name minus the suffix. For example, if the6816 target name is `foo.c', then `$*' is set to `foo', since `.c' is a6817 suffix. GNU `make' does this bizarre thing only for compatibility6818 with other implementations of `make'. You should generally avoid6819 using `$*' except in implicit rules or static pattern rules.6820 6821 If the target name in an explicit rule does not end with a6822 recognized suffix, `$*' is set to the empty string for that rule.6823 6824 `$?' is useful even in explicit rules when you wish to operate on6825 only the prerequisites that have changed. For example, suppose that an6826 archive named `lib' is supposed to contain copies of several object6827 files. This rule copies just the changed object files into the archive:6828 6829 lib: foo.o bar.o lose.o win.o6830 ar r lib $?6831 6832 Of the variables listed above, four have values that are single file6833 names, and three have values that are lists of file names. These seven6834 have variants that get just the file's directory name or just the file6835 name within the directory. The variant variables' names are formed by6836 appending `D' or `F', respectively. These variants are semi-obsolete6837 in GNU `make' since the functions `dir' and `notdir' can be used to get6838 a similar effect (*note Functions for File Names: File Name6839 Functions.). Note, however, that the `D' variants all omit the6840 trailing slash which always appears in the output of the `dir'6841 function. Here is a table of the variants:6842 6843 `$(@D)'6844 The directory part of the file name of the target, with the6845 trailing slash removed. If the value of `$@' is `dir/foo.o' then6846 `$(@D)' is `dir'. This value is `.' if `$@' does not contain a6847 slash.6848 6849 `$(@F)'6850 The file-within-directory part of the file name of the target. If6851 the value of `$@' is `dir/foo.o' then `$(@F)' is `foo.o'. `$(@F)'6852 is equivalent to `$(notdir $@)'.6853 6854 `$(*D)'6855 `$(*F)'6856 The directory part and the file-within-directory part of the stem;6857 `dir' and `foo' in this example.6858 6859 `$(%D)'6860 `$(%F)'6861 The directory part and the file-within-directory part of the target6862 archive member name. This makes sense only for archive member6863 targets of the form `ARCHIVE(MEMBER)' and is useful only when6864 MEMBER may contain a directory name. (*Note Archive Members as6865 Targets: Archive Members.)6866 6867 `$(<D)'6868 `$(<F)'6869 The directory part and the file-within-directory part of the first6870 prerequisite.6871 6872 `$(^D)'6873 `$(^F)'6874 Lists of the directory parts and the file-within-directory parts6875 of all prerequisites.6876 6877 `$(+D)'6878 `$(+F)'6879 Lists of the directory parts and the file-within-directory parts6880 of all prerequisites, including multiple instances of duplicated6881 prerequisites.6882 6883 `$(?D)'6884 `$(?F)'6885 Lists of the directory parts and the file-within-directory parts of6886 all prerequisites that are newer than the target.6887 6888 Note that we use a special stylistic convention when we talk about6889 these automatic variables; we write "the value of `$<'", rather than6890 "the variable `<'" as we would write for ordinary variables such as6891 `objects' and `CFLAGS'. We think this convention looks more natural in6892 this special case. Please do not assume it has a deep significance;6893 `$<' refers to the variable named `<' just as `$(CFLAGS)' refers to the6894 variable named `CFLAGS'. You could just as well use `$(<)' in place of6895 `$<'.6896 6897 GNU `make' provides support for the SysV `make' feature that allows6898 special variable references `$$@', `$$(@D)', and `$$(@F)' (note the6899 required double-"$"!) to appear with the _prerequisites list_ (normal6900 automatic variables are available only within a command script). When6901 appearing in a prerequisites list, these variables are expanded to the6902 name of the target, the directory component of the target, and the file6903 component of the target, respectively.6904 6905 Note that these variables are available only within explicit and6906 static pattern (*note Static Pattern Rules: Static Pattern.) rules;6907 they have no special significance within implicit (suffix or pattern)6908 rules. Also note that while SysV `make' actually expands its entire6909 prerequisite list _twice_, GNU `make' does not behave this way: instead6910 it simply expands these special variables without re-expanding any6911 other part of the prerequisites list.6912 6913 This somewhat bizarre feature is included only to provide some6914 compatibility with SysV makefiles. In a native GNU `make' file there6915 are other ways to accomplish the same results. This feature is6916 disabled if the special pseudo target `.POSIX' is defined.6917 6918 6919 File: make.info, Node: Pattern Match, Next: Match-Anything Rules, Prev: Automatic Variables, Up: Pattern Rules6920 6921 How Patterns Match6922 ------------------6923 6924 A target pattern is composed of a `%' between a prefix and a suffix,6925 either or both of which may be empty. The pattern matches a file name6926 only if the file name starts with the prefix and ends with the suffix,6927 without overlap. The text between the prefix and the suffix is called6928 the "stem". Thus, when the pattern `%.o' matches the file name6929 `test.o', the stem is `test'. The pattern rule prerequisites are6930 turned into actual file names by substituting the stem for the character6931 `%'. Thus, if in the same example one of the prerequisites is written6932 as `%.c', it expands to `test.c'.6933 6934 When the target pattern does not contain a slash (and it usually does6935 not), directory names in the file names are removed from the file name6936 before it is compared with the target prefix and suffix. After the6937 comparison of the file name to the target pattern, the directory names,6938 along with the slash that ends them, are added on to the prerequisite6939 file names generated from the pattern rule's prerequisite patterns and6940 the file name. The directories are ignored only for the purpose of6941 finding an implicit rule to use, not in the application of that rule.6942 Thus, `e%t' matches the file name `src/eat', with `src/a' as the stem.6943 When prerequisites are turned into file names, the directories from the6944 stem are added at the front, while the rest of the stem is substituted6945 for the `%'. The stem `src/a' with a prerequisite pattern `c%r' gives6946 the file name `src/car'.6947 6948 6949 File: make.info, Node: Match-Anything Rules, Next: Canceling Rules, Prev: Pattern Match, Up: Pattern Rules6950 6951 Match-Anything Pattern Rules6952 ----------------------------6953 6954 When a pattern rule's target is just `%', it matches any file name6955 whatever. We call these rules "match-anything" rules. They are very6956 useful, but it can take a lot of time for `make' to think about them,6957 because it must consider every such rule for each file name listed6958 either as a target or as a prerequisite.6959 6960 Suppose the makefile mentions `foo.c'. For this target, `make'6961 would have to consider making it by linking an object file `foo.c.o',6962 or by C compilation-and-linking in one step from `foo.c.c', or by6963 Pascal compilation-and-linking from `foo.c.p', and many other6964 possibilities.6965 6966 We know these possibilities are ridiculous since `foo.c' is a C6967 source file, not an executable. If `make' did consider these6968 possibilities, it would ultimately reject them, because files such as6969 `foo.c.o' and `foo.c.p' would not exist. But these possibilities are so6970 numerous that `make' would run very slowly if it had to consider them.6971 6972 To gain speed, we have put various constraints on the way `make'6973 considers match-anything rules. There are two different constraints6974 that can be applied, and each time you define a match-anything rule you6975 must choose one or the other for that rule.6976 6977 One choice is to mark the match-anything rule as "terminal" by6978 defining it with a double colon. When a rule is terminal, it does not6979 apply unless its prerequisites actually exist. Prerequisites that6980 could be made with other implicit rules are not good enough. In other6981 words, no further chaining is allowed beyond a terminal rule.6982 6983 For example, the built-in implicit rules for extracting sources from6984 RCS and SCCS files are terminal; as a result, if the file `foo.c,v' does6985 not exist, `make' will not even consider trying to make it as an6986 intermediate file from `foo.c,v.o' or from `RCS/SCCS/s.foo.c,v'. RCS6987 and SCCS files are generally ultimate source files, which should not be6988 remade from any other files; therefore, `make' can save time by not6989 looking for ways to remake them.6990 6991 If you do not mark the match-anything rule as terminal, then it is6992 nonterminal. A nonterminal match-anything rule cannot apply to a file6993 name that indicates a specific type of data. A file name indicates a6994 specific type of data if some non-match-anything implicit rule target6995 matches it.6996 6997 For example, the file name `foo.c' matches the target for the pattern6998 rule `%.c : %.y' (the rule to run Yacc). Regardless of whether this6999 rule is actually applicable (which happens only if there is a file7000 `foo.y'), the fact that its target matches is enough to prevent7001 consideration of any nonterminal match-anything rules for the file7002 `foo.c'. Thus, `make' will not even consider trying to make `foo.c' as7003 an executable file from `foo.c.o', `foo.c.c', `foo.c.p', etc.7004 7005 The motivation for this constraint is that nonterminal match-anything7006 rules are used for making files containing specific types of data (such7007 as executable files) and a file name with a recognized suffix indicates7008 some other specific type of data (such as a C source file).7009 7010 Special built-in dummy pattern rules are provided solely to recognize7011 certain file names so that nonterminal match-anything rules will not be7012 considered. These dummy rules have no prerequisites and no commands,7013 and they are ignored for all other purposes. For example, the built-in7014 implicit rule7015 7016 %.p :7017 7018 exists to make sure that Pascal source files such as `foo.p' match a7019 specific target pattern and thereby prevent time from being wasted7020 looking for `foo.p.o' or `foo.p.c'.7021 7022 Dummy pattern rules such as the one for `%.p' are made for every7023 suffix listed as valid for use in suffix rules (*note Old-Fashioned7024 Suffix Rules: Suffix Rules.).7025 7026 7027 File: make.info, Node: Canceling Rules, Prev: Match-Anything Rules, Up: Pattern Rules7028 7029 Canceling Implicit Rules7030 ------------------------7031 7032 You can override a built-in implicit rule (or one you have defined7033 yourself) by defining a new pattern rule with the same target and7034 prerequisites, but different commands. When the new rule is defined,7035 the built-in one is replaced. The new rule's position in the sequence7036 of implicit rules is determined by where you write the new rule.7037 7038 You can cancel a built-in implicit rule by defining a pattern rule7039 with the same target and prerequisites, but no commands. For example,7040 the following would cancel the rule that runs the assembler:7041 7042 %.o : %.s7043 7044 7045 File: make.info, Node: Last Resort, Next: Suffix Rules, Prev: Pattern Rules, Up: Implicit Rules7046 7047 Defining Last-Resort Default Rules7048 ==================================7049 7050 You can define a last-resort implicit rule by writing a terminal7051 match-anything pattern rule with no prerequisites (*note Match-Anything7052 Rules::). This is just like any other pattern rule; the only thing7053 special about it is that it will match any target. So such a rule's7054 commands are used for all targets and prerequisites that have no7055 commands of their own and for which no other implicit rule applies.7056 7057 For example, when testing a makefile, you might not care if the7058 source files contain real data, only that they exist. Then you might7059 do this:7060 7061 %::7062 touch $@7063 7064 to cause all the source files needed (as prerequisites) to be created7065 automatically.7066 7067 You can instead define commands to be used for targets for which7068 there are no rules at all, even ones which don't specify commands. You7069 do this by writing a rule for the target `.DEFAULT'. Such a rule's7070 commands are used for all prerequisites which do not appear as targets7071 in any explicit rule, and for which no implicit rule applies.7072 Naturally, there is no `.DEFAULT' rule unless you write one.7073 7074 If you use `.DEFAULT' with no commands or prerequisites:7075 7076 .DEFAULT:7077 7078 the commands previously stored for `.DEFAULT' are cleared. Then `make'7079 acts as if you had never defined `.DEFAULT' at all.7080 7081 If you do not want a target to get the commands from a match-anything7082 pattern rule or `.DEFAULT', but you also do not want any commands to be7083 run for the target, you can give it empty commands (*note Defining7084 Empty Commands: Empty Commands.).7085 7086 You can use a last-resort rule to override part of another makefile.7087 *Note Overriding Part of Another Makefile: Overriding Makefiles.7088 7089 7090 File: make.info, Node: Suffix Rules, Next: Implicit Rule Search, Prev: Last Resort, Up: Implicit Rules7091 7092 Old-Fashioned Suffix Rules7093 ==========================7094 7095 "Suffix rules" are the old-fashioned way of defining implicit rules for7096 `make'. Suffix rules are obsolete because pattern rules are more7097 general and clearer. They are supported in GNU `make' for7098 compatibility with old makefiles. They come in two kinds:7099 "double-suffix" and "single-suffix".7100 7101 A double-suffix rule is defined by a pair of suffixes: the target7102 suffix and the source suffix. It matches any file whose name ends with7103 the target suffix. The corresponding implicit prerequisite is made by7104 replacing the target suffix with the source suffix in the file name. A7105 two-suffix rule whose target and source suffixes are `.o' and `.c' is7106 equivalent to the pattern rule `%.o : %.c'.7107 7108 A single-suffix rule is defined by a single suffix, which is the7109 source suffix. It matches any file name, and the corresponding implicit7110 prerequisite name is made by appending the source suffix. A7111 single-suffix rule whose source suffix is `.c' is equivalent to the7112 pattern rule `% : %.c'.7113 7114 Suffix rule definitions are recognized by comparing each rule's7115 target against a defined list of known suffixes. When `make' sees a7116 rule whose target is a known suffix, this rule is considered a7117 single-suffix rule. When `make' sees a rule whose target is two known7118 suffixes concatenated, this rule is taken as a double-suffix rule.7119 7120 For example, `.c' and `.o' are both on the default list of known7121 suffixes. Therefore, if you define a rule whose target is `.c.o',7122 `make' takes it to be a double-suffix rule with source suffix `.c' and7123 target suffix `.o'. Here is the old-fashioned way to define the rule7124 for compiling a C source file:7125 7126 .c.o:7127 $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<7128 7129 Suffix rules cannot have any prerequisites of their own. If they7130 have any, they are treated as normal files with funny names, not as7131 suffix rules. Thus, the rule:7132 7133 .c.o: foo.h7134 $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<7135 7136 tells how to make the file `.c.o' from the prerequisite file `foo.h',7137 and is not at all like the pattern rule:7138 7139 %.o: %.c foo.h7140 $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<7141 7142 which tells how to make `.o' files from `.c' files, and makes all `.o'7143 files using this pattern rule also depend on `foo.h'.7144 7145 Suffix rules with no commands are also meaningless. They do not7146 remove previous rules as do pattern rules with no commands (*note7147 Canceling Implicit Rules: Canceling Rules.). They simply enter the7148 suffix or pair of suffixes concatenated as a target in the data base.7149 7150 The known suffixes are simply the names of the prerequisites of the7151 special target `.SUFFIXES'. You can add your own suffixes by writing a7152 rule for `.SUFFIXES' that adds more prerequisites, as in:7153 7154 .SUFFIXES: .hack .win7155 7156 which adds `.hack' and `.win' to the end of the list of suffixes.7157 7158 If you wish to eliminate the default known suffixes instead of just7159 adding to them, write a rule for `.SUFFIXES' with no prerequisites. By7160 special dispensation, this eliminates all existing prerequisites of7161 `.SUFFIXES'. You can then write another rule to add the suffixes you7162 want. For example,7163 7164 .SUFFIXES: # Delete the default suffixes7165 .SUFFIXES: .c .o .h # Define our suffix list7166 7167 The `-r' or `--no-builtin-rules' flag causes the default list of7168 suffixes to be empty.7169 7170 The variable `SUFFIXES' is defined to the default list of suffixes7171 before `make' reads any makefiles. You can change the list of suffixes7172 with a rule for the special target `.SUFFIXES', but that does not alter7173 this variable.7174 -
vendor/gnumake/current/doc/make.info-2
r152 r501 1 This is make.info, produced by makeinfo version 4.6 from 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." 2 25 3 26 INFO-DIR-SECTION GNU Packages … … 6 29 END-INFO-DIR-ENTRY 7 30 8 This file documents the GNU Make utility, which determines 9 automatically which pieces of a large program need to be recompiled, 10 and issues the commands to recompile them. 11 12 This is Edition 0.61, last updated 02 May 2003, of `The GNU Make 13 Manual', for `make', Version 3.81. 14 15 Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 16 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. 17 18 Permission is granted to copy, distribute and/or modify this document 19 under the terms of the GNU Free Documentation License, Version 1.1 or 20 any later version published by the Free Software Foundation; with no 21 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover 22 Texts. A copy of the license is included in the section entitled "GNU 23 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. 24 591 25 592 26 593 File: make.info, Node: Implicit Rule Search, Prev: Suffix Rules, Up: Implicit Rules 27 594 28 Implicit Rule Search Algorithm29 ============================== 595 10.8 Implicit Rule Search Algorithm 596 =================================== 30 597 31 598 Here is the procedure `make' uses for searching for an implicit rule … … 109 676 File: make.info, Node: Archives, Next: Features, Prev: Implicit Rules, Up: Top 110 677 111 Using `make' to Update Archive Files112 ************************************ 678 11 Using `make' to Update Archive Files 679 *************************************** 113 680 114 681 "Archive files" are files containing named subfiles called "members"; … … 127 694 File: make.info, Node: Archive Members, Next: Archive Update, Prev: Archives, Up: Archives 128 695 129 Archive Members as Targets130 ========================== 696 11.1 Archive Members as Targets 697 =============================== 131 698 132 699 An individual member of an archive file can be used as a target or … … 148 715 149 716 In fact, nearly all archive member targets are updated in just this 150 way and there is an implicit rule to do it for you. * Note:* The `c'151 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. 152 719 153 720 To specify several members in the same archive, you can write all the … … 169 736 File: make.info, Node: Archive Update, Next: Archive Pitfalls, Prev: Archive Members, Up: Archives 170 737 171 Implicit Rule for Archive Member Targets172 ======================================== 738 11.2 Implicit Rule for Archive Member Targets 739 ============================================= 173 740 174 741 Recall that a target that looks like `A(M)' stands for the member named … … 219 786 File: make.info, Node: Archive Symbols, Prev: Archive Update, Up: Archive Update 220 787 221 Updating Archive Symbol Directories222 ----------------------------------- 788 11.2.1 Updating Archive Symbol Directories 789 ------------------------------------------ 223 790 224 791 An archive file that is used as a library usually contains a special … … 250 817 File: make.info, Node: Archive Pitfalls, Next: Archive Suffix Rules, Prev: Archive Update, Up: Archives 251 818 252 Dangers When Using Archives253 =========================== 819 11.3 Dangers When Using Archives 820 ================================ 254 821 255 822 It is important to be careful when using parallel execution (the `-j' … … 266 833 File: make.info, Node: Archive Suffix Rules, Prev: Archive Pitfalls, Up: Archives 267 834 268 Suffix Rules for Archive Files269 ============================== 835 11.4 Suffix Rules for Archive Files 836 =================================== 270 837 271 838 You can write a special kind of suffix rule for dealing with archive … … 305 872 File: make.info, Node: Features, Next: Missing, Prev: Archives, Up: Top 306 873 307 Features of GNU `make'308 ********************** 874 12 Features of GNU `make' 875 ************************* 309 876 310 877 Here is a summary of the features of GNU `make', for comparison with … … 499 1066 500 1067 * The built-in variable `MAKE_VERSION' gives the version number of 501 `make'. 1068 `make'. 502 1069 503 1070 504 1071 File: make.info, Node: Missing, Next: Makefile Conventions, Prev: Features, Up: Top 505 1072 506 Incompatibilities and Missing Features507 ************************************** 1073 13 Incompatibilities and Missing Features 1074 ***************************************** 508 1075 509 1076 The `make' programs in various other systems support a few features … … 545 1112 imagine what went on in the minds of Unix `make' developers to do 546 1113 this; it is utterly inconsistent with the normal definition of 547 `$*'. 1114 `$*'. 548 1115 549 1116 * In some Unix `make's, implicit rule search (*note Using Implicit … … 589 1156 File: make.info, Node: Makefile Conventions, Next: Quick Reference, Prev: Missing, Up: Top 590 1157 591 Makefile Conventions592 ******************** 1158 14 Makefile Conventions 1159 *********************** 593 1160 594 1161 This node describes conventions for writing the Makefiles for GNU … … 609 1176 File: make.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions 610 1177 611 General Conventions for Makefiles612 ================================= 1178 14.1 General Conventions for Makefiles 1179 ====================================== 613 1180 614 1181 Every Makefile should contain this line: … … 689 1256 File: make.info, Node: Utilities in Makefiles, Next: Command Variables, Prev: Makefile Basics, Up: Makefile Conventions 690 1257 691 Utilities in Makefiles692 ====================== 1258 14.2 Utilities in Makefiles 1259 =========================== 693 1260 694 1261 Write the Makefile commands (and any shell scripts, such as … … 744 1311 File: make.info, Node: Command Variables, Next: Directory Variables, Prev: Utilities in Makefiles, Up: Makefile Conventions 745 1312 746 Variables for Specifying Commands747 ================================= 1313 14.3 Variables for Specifying Commands 1314 ====================================== 748 1315 749 1316 Makefiles should provide variables for overriding certain commands, … … 824 1391 File: make.info, Node: Directory Variables, Next: Standard Targets, Prev: Command Variables, Up: Makefile Conventions 825 1392 826 Variables for Installation Directories827 ====================================== 1393 14.4 Variables for Installation Directories 1394 =========================================== 828 1395 829 1396 Installation directories should always be named by variables, so it is 830 1397 easy to install in a nonstandard place. The standard names for these 831 variables are described below. They are based on a standard filesystem 832 layout; variants of it are used in SVR4, 4.4BSD, GNU/Linux, Ultrix v4, 833 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. 834 1409 835 1410 These two variables set the root for the installation. All the other … … 884 1459 (If you are using Autoconf, write it as `@libexecdir@'.) 885 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 886 1467 Data files used by the program during its execution are divided into 887 1468 categories in two ways. … … 900 1481 architecture-independent, and it is generally not hard. 901 1482 902 Therefore, here are the variables Makefiles should use to specify 903 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. 904 1493 905 1494 `datadir' 906 The directory for installing read-only architecture independent 907 data files. This should normally be `/usr/local/share', but write 908 it as `$(prefix)/share'. (If you are using Autoconf, write it as 909 `@datadir@'.) As a special exception, see `$(infodir)' and 910 `$(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/'. 911 1508 912 1509 `sysconfdir' … … 941 1538 `@localstatedir@'.) 942 1539 943 `libdir' 944 The directory for object files and libraries of object code. Do 945 not install executables here, they probably ought to go in 946 `$(libexecdir)' instead. The value of `libdir' should normally be 947 `/usr/local/lib', but write it as `$(exec_prefix)/lib'. (If you 948 are using Autoconf, write it as `@libdir@'.) 949 950 `infodir' 951 The directory for installing the Info files for this package. By 952 default, it should be `/usr/local/info', but it should be written 953 as `$(prefix)/info'. (If you are using Autoconf, write it as 954 `@infodir@'.) 955 956 `lispdir' 957 The directory for installing any Emacs Lisp files in this package. 958 By default, it should be `/usr/local/share/emacs/site-lisp', but 959 it should be written as `$(prefix)/share/emacs/site-lisp'. 960 961 If you are using Autoconf, write the default as `@lispdir@'. In 962 order to make `@lispdir@' work, you need the following lines in 963 your `configure.in' file: 964 965 lispdir='${datadir}/emacs/site-lisp' 966 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'. 967 1544 968 1545 `includedir' … … 1000 1577 string in the file--part of a comment--and `grep' for that string. 1001 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 1002 1634 Unix-style man pages are installed in one of the following: 1003 1635 1004 1636 `mandir' 1005 1637 The top-level directory for installing the man pages (if any) for 1006 this package. It will normally be `/usr/local/ man', but you should1007 write it as `$(prefix)/man'. (If you are using Autoconf, write it1008 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@'.) 1009 1641 1010 1642 `man1dir' … … 1049 1681 # NOTE: This directory must exist when you start the install. 1050 1682 prefix = /usr/local 1683 datarootdir = $(prefix)/share 1684 datadir = $(datarootdir) 1051 1685 exec_prefix = $(prefix) 1052 1686 # Where to put the executable for the command `gcc'. … … 1055 1689 libexecdir = $(exec_prefix)/libexec 1056 1690 # Where to put the Info files. 1057 infodir = $( prefix)/info1691 infodir = $(datarootdir)/info 1058 1692 1059 1693 If your program installs a large number of files into one of the … … 1072 1706 File: make.info, Node: Standard Targets, Next: Install Command Categories, Prev: Directory Variables, Up: Makefile Conventions 1073 1707 1074 Standard Targets for Users1075 ========================== 1708 14.5 Standard Targets for Users 1709 =============================== 1076 1710 1077 1711 All GNU programs should have the following targets in their Makefiles: … … 1142 1776 Categories::. 1143 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 1144 1797 `uninstall' 1145 Delete all the installed files--the copies that the `install' 1146 target creates.1798 Delete all the installed files--the copies that the `install' and 1799 `install-*' targets create. 1147 1800 1148 1801 This rule should not modify the directories where compilation is … … 1176 1829 1177 1830 `clean' 1178 Delete all files from the current directory that are normally 1179 created by building the program. Don't delete the files that 1180 record the configuration. Also preserve files that could be made 1181 by building, but normally aren't because the distribution comes 1182 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. 1183 1839 1184 1840 Delete `.dvi' files here if they are not part of the distribution. 1185 1841 1186 1842 `distclean' 1187 Delete all files from the current directory that are created by 1188 configuring or building the program. If you have unpacked the 1189 source and built the program without creating any other files, 1190 `make distclean' should leave only the files that were in the 1191 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. 1192 1850 1193 1851 `mostlyclean' … … 1198 1856 1199 1857 `maintainer-clean' 1200 Delete almost everything from the current directory that can be1201 reconstructed with this Makefile. This typically includes1202 everything deleted by `distclean', plus more: C source files1203 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. 1204 1862 1205 1863 The reason we say "almost everything" is that running the command … … 1208 1866 generally, `make maintainer-clean' should not delete anything that 1209 1867 needs to exist in order to run `configure' and then begin to build 1210 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 1211 1871 delete everything else that can be rebuilt. 1212 1872 … … 1233 1893 1234 1894 info: foo.info 1235 1895 1236 1896 foo.info: foo.texi chap1.texi chap2.texi 1237 1897 $(MAKEINFO) $(srcdir)/foo.texi … … 1248 1908 1249 1909 `dvi' 1250 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: 1251 1915 1252 1916 dvi: foo.dvi 1253 1917 1254 1918 foo.dvi: foo.texi chap1.texi chap2.texi 1255 1919 $(TEXI2DVI) $(srcdir)/foo.texi … … 1259 1923 distribution.(1) Alternatively, write just the dependencies, and 1260 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). 1261 1936 1262 1937 `dist' … … 1329 2004 File: make.info, Node: Install Command Categories, Prev: Standard Targets, Up: Makefile Conventions 1330 2005 1331 Install Command Categories1332 ========================== 2006 14.6 Install Command Categories 2007 =============================== 1333 2008 1334 2009 When writing the `install' target, you must classify all the commands … … 1415 2090 Programs to build binary packages work by extracting the 1416 2091 pre-installation and post-installation commands. Here is one way of 1417 extracting the pre-installation commands: 1418 1419 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 \ 1420 2096 PRE_INSTALL=pre-install \ 1421 2097 POST_INSTALL=post-install \ … … 1425 2101 where the file `pre-install.awk' could contain this: 1426 2102 1427 $0 ~ /^ \t[ \t]*(normal_install|post_install)[ \t]*$/ {on = 0}2103 $0 ~ /^(normal-install|post-install)[ \t]*$/ {on = 0} 1428 2104 on {print $0} 1429 $0 ~ /^\t[ \t]*pre_install[ \t]*$/ {on = 1} 1430 1431 The resulting file of pre-installation commands is executed as a 1432 shell script as part of installing the binary package. 2105 $0 ~ /^pre-install[ \t]*$/ {on = 1} 1433 2106 1434 2107 1435 2108 File: make.info, Node: Quick Reference, Next: Error Messages, Prev: Makefile Conventions, Up: Top 1436 2109 1437 Quick Reference1438 *************** 2110 Appendix A Quick Reference 2111 ************************** 1439 2112 1440 2113 This appendix summarizes the directives, text manipulation functions, … … 1504 2177 directive. 1505 2178 1506 Here is a summary of the text manipulation functions (*note 1507 Functions::): 2179 Here is a summary of the built-in functions (*note Functions::): 1508 2180 1509 2181 `$(subst FROM,TO,TEXT)' … … 1542 2214 Functions. 1543 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 1544 2241 `$(dir NAMES...)' 1545 2242 Extract the directory part of each file name. … … 1571 2268 *Note Functions for File Names: File Name Functions. 1572 2269 1573 `$(word N,TEXT)'1574 Extract the Nth word (one-origin) of TEXT.1575 *Note Functions for File Names: File Name Functions.1576 1577 `$(words TEXT)'1578 Count the number of words in TEXT.1579 *Note Functions for File Names: File Name Functions.1580 1581 `$(wordlist S,E,TEXT)'1582 Returns the list of words in TEXT from S to E.1583 *Note Functions for File Names: File Name Functions.1584 1585 `$(firstword NAMES...)'1586 Extract the first word of NAMES.1587 *Note Functions for File Names: File Name Functions.1588 1589 2270 `$(wildcard PATTERN...)' 1590 2271 Find file names matching a shell file name pattern (_not_ a `%' … … 1592 2273 *Note The Function `wildcard': Wildcard Function. 1593 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 1594 2285 `$(error TEXT...)' 1595 2286 When this function is evaluated, `make' generates a fatal error … … 1610 2301 defined. 1611 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. 1612 2308 1613 2309 `$(foreach VAR,WORDS,TEXT)' … … 1701 2397 `/bin/sh'. You can set `SHELL' in the makefile to change the 1702 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::. 1703 2401 1704 2402 `MAKESHELL' 1705 2403 On MS-DOS only, the name of the command interpreter that is to be 1706 used by `make'. This value takes precedence over the value of2404 used by `make'. This value takes precedence over the value of 1707 2405 `SHELL'. *Note MAKESHELL variable: Execution. 1708 2406 … … 1748 2446 File: make.info, Node: Error Messages, Next: Complex Makefile, Prev: Quick Reference, Up: Top 1749 2447 1750 Errors Generated by Make1751 ************************ 2448 Appendix B Errors Generated by Make 2449 *********************************** 1752 2450 1753 2451 Here is a list of the more common errors you might see generated by … … 1822 2520 on the command line, and `make' couldn't find any makefiles to 1823 2521 read in. The latter means that some makefile was found, but it 1824 didn't contain any default target and none was given on the1825 command line. GNU `make' has nothing to do in these situations.1826 *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. 1827 2525 1828 2526 `Makefile `XXX' was not found.' … … 1901 2599 File: make.info, Node: Complex Makefile, Next: GNU Free Documentation License, Prev: Error Messages, Up: Top 1902 2600 1903 Complex Makefile Example1904 ************************ 2601 Appendix C Complex Makefile Example 2602 *********************************** 1905 2603 1906 2604 Here is the makefile for the GNU `tar' program. This is a moderately … … 1938 2636 # Un*x Makefile for GNU tar program. 1939 2637 # Copyright (C) 1991 Free Software Foundation, Inc. 1940 2638 1941 2639 # This program is free software; you can redistribute 1942 2640 # it and/or modify it under the terms of the GNU … … 1944 2642 ... 1945 2643 ... 1946 2644 1947 2645 SHELL = /bin/sh 1948 2646 1949 2647 #### Start of system configuration section. #### 1950 2648 1951 2649 srcdir = . 1952 2650 1953 2651 # If you use gcc, you should either run the 1954 2652 # fixincludes script that comes with it or else use … … 1959 2657 INSTALL = /usr/local/bin/install -c 1960 2658 INSTALLDATA = /usr/local/bin/install -c -m 644 1961 2659 1962 2660 # Things you might add to DEFS: 1963 2661 # -DSTDC_HEADERS If you have ANSI C headers and … … 2010 2708 # -DXENIX If you have sys/inode.h 2011 2709 # and need it 94 to be included. 2012 2710 2013 2711 DEFS = -DSIGTYPE=int -DDIRENT -DSTRSTR_MISSING \ 2014 2712 -DVPRINTF_MISSING -DBSD42 … … 2019 2717 DEF_AR_FILE = /dev/rmt8 2020 2718 DEFBLOCKING = 20 2021 2719 2022 2720 CDEBUG = -g 2023 2721 CFLAGS = $(CDEBUG) -I. -I$(srcdir) $(DEFS) \ … … 2025 2723 -DDEFBLOCKING=$(DEFBLOCKING) 2026 2724 LDFLAGS = -g 2027 2725 2028 2726 prefix = /usr/local 2029 2727 # Prefix for each installed program, 2030 2728 # normally empty or `g'. 2031 2729 binprefix = 2032 2730 2033 2731 # The directory to install tar in. 2034 2732 bindir = $(prefix)/bin 2035 2733 2036 2734 # The directory to install the info files in. 2037 2735 infodir = $(prefix)/info 2038 2736 2039 2737 #### End of system configuration section. #### 2040 2738 2041 2739 SRC1 = tar.c create.c extract.c buffer.c \ 2042 2740 getoldopt.c update.c gnu.c mangle.c … … 2058 2756 msd_dir.h msd_dir.c tcexparg.c \ 2059 2757 level-0 level-1 backup-specs testpad.c 2060 2758 2759 .PHONY: all 2061 2760 all: tar rmt tar.info 2062 2761 2762 .PHONY: tar 2063 2763 tar: $(OBJS) 2064 2764 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) 2065 2765 2066 2766 rmt: rmt.c 2067 2767 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ rmt.c 2068 2768 2069 2769 tar.info: tar.texinfo 2070 2770 makeinfo tar.texinfo 2071 2771 2772 .PHONY: install 2072 2773 install: all 2073 2774 $(INSTALL) tar $(bindir)/$(binprefix)tar 2074 2775 -test ! -f rmt || $(INSTALL) rmt /etc/rmt 2075 2776 $(INSTALLDATA) $(srcdir)/tar.info* $(infodir) 2076 2777 2077 2778 $(OBJS): tar.h port.h testpad.h 2078 2779 regex.o buffer.o tar.o: regex.h 2079 2780 # getdate.y has 8 shift/reduce conflicts. 2080 2781 2081 2782 testpad.h: testpad 2082 2783 ./testpad 2083 2784 2084 2785 testpad: testpad.o 2085 2786 $(CC) -o $@ testpad.o 2086 2787 2087 2788 TAGS: $(SRCS) 2088 2789 etags $(SRCS) 2089 2790 2791 .PHONY: clean 2090 2792 clean: 2091 2793 rm -f *.o tar rmt testpad testpad.h core 2092 2794 2795 .PHONY: distclean 2093 2796 distclean: clean 2094 2797 rm -f TAGS Makefile config.status 2095 2798 2799 .PHONY: realclean 2096 2800 realclean: distclean 2097 2801 rm -f tar.info* 2098 2802 2803 .PHONY: shar 2099 2804 shar: $(SRCS) $(AUX) 2100 2805 shar $(SRCS) $(AUX) | compress \ … … 2103 2808 -e q 2104 2809 version.c`.shar.Z 2105 2810 2811 .PHONY: dist 2106 2812 dist: $(SRCS) $(AUX) 2107 2813 echo tar-`sed \ … … 2115 2821 tar chZf `cat .fname`.tar.Z `cat .fname` 2116 2822 -rm -rf `cat .fname` .fname 2117 2823 2118 2824 tar.zoo: $(SRCS) $(AUX) 2119 2825 -rm -rf tmp.dir … … 2130 2836 File: make.info, Node: GNU Free Documentation License, Next: Concept Index, Prev: Complex Makefile, Up: Top 2131 2837 2132 GNU Free Documentation License 2133 ****************************** 2134 2135 Version 1.1, March 2000 2136 Copyright (C) 2000 Free Software Foundation, Inc. 2137 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA 2138 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 2139 2846 Everyone is permitted to copy and distribute verbatim copies 2140 2847 of this license document, but changing it is not allowed. … … 2143 2850 2144 2851 The purpose of this License is to make a manual, textbook, or other 2145 written document "free" in the sense of freedom: to assure everyone2146 the effective freedom to copy and redistribute it, with or without2147 modifying it, either commercially or noncommercially. Secondarily,2148 this License preserves for the author and publisher a way to get2149 credit for their work, while not being considered responsible for2150 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. 2151 2858 2152 2859 This License is a kind of "copyleft", which means that derivative … … 2166 2873 1. APPLICABILITY AND DEFINITIONS 2167 2874 2168 This License applies to any manual or other work that contains a 2169 notice placed by the copyright holder saying it can be distributed 2170 under the terms of this License. The "Document", below, refers to 2171 any such manual or work. Any member of the public is a licensee, 2172 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. 2173 2884 2174 2885 A "Modified Version" of the Document means any work containing the … … 2176 2887 modifications and/or translated into another language. 2177 2888 2178 A "Secondary Section" is a named appendix or a front-matter 2179 section of the Document that deals exclusively withthe2180 relationship of the publishers or authors of the Document to the2181 Document's overall subject (or to related matters) and contains2182 nothing that could fall directly within that overall subject.2183 (For example, if the Document is in part a textbook of2184 mathematics, a Secondary Section may not explain any mathematics.)2185 The relationship could be a matter of historical connection with2186 the subject or with related matters, or of legal, commercial,2187 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. 2188 2899 2189 2900 The "Invariant Sections" are certain Secondary Sections whose 2190 2901 titles are designated, as being those of Invariant Sections, in 2191 2902 the notice that says that the Document is released under this 2192 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. 2193 2907 2194 2908 The "Cover Texts" are certain short passages of text that are 2195 2909 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 2196 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. 2197 2913 2198 2914 A "Transparent" copy of the Document means a machine-readable copy, 2199 2915 represented in a format whose specification is available to the 2200 general public, whose contents can be viewed and edited directly2201 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 2202 2918 composed of pixels) generic paint programs or (for drawings) some 2203 2919 widely available drawing editor, and that is suitable for input to 2204 2920 text formatters or for automatic translation to a variety of 2205 2921 formats suitable for input to text formatters. A copy made in an 2206 otherwise Transparent file format whose markup has been designed 2207 to thwart or discourage subsequent modification by readers is not 2208 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". 2209 2927 2210 2928 Examples of suitable formats for Transparent copies include plain 2211 2929 ASCII without markup, Texinfo input format, LaTeX input format, 2212 2930 SGML or XML using a publicly available DTD, and 2213 standard-conforming simple HTML designed for human modification. 2214 Opaque formats include PostScript, PDF, proprietary formats that 2215 can be read and edited only by proprietary word processors, SGML 2216 or XML for which the DTD and/or processing tools are not generally 2217 available, and the machine-generated HTML produced by some word 2218 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. 2219 2938 2220 2939 The "Title Page" means, for a printed book, the title page itself, … … 2224 2943 Page" means the text near the most prominent appearance of the 2225 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. 2226 2961 2227 2962 2. VERBATIM COPYING … … 2243 2978 3. COPYING IN QUANTITY 2244 2979 2245 If you publish printed copies of the Document numbering more than 2246 100, and the Document's license notice requires Cover Texts, you 2247 must enclose the copies in covers that carry, clearly and legibly, 2248 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 2249 2985 Back-Cover Texts on the back cover. Both covers must also clearly 2250 2986 and legibly identify you as the publisher of these copies. The … … 2264 3000 numbering more than 100, you must either include a 2265 3001 machine-readable Transparent copy along with each Opaque copy, or 2266 state in or with each Opaque copy a publicly-accessible 2267 computer-network location containing a complete Transparent copy 2268 of the Document, free of added material, which the general 2269 network-using public has access to download anonymously at no 2270 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 2271 3006 latter option, you must take reasonably prudent steps, when you 2272 3007 begin distribution of Opaque copies in quantity, to ensure that … … 2302 3037 the Modified Version, together with at least five of the 2303 3038 principal authors of the Document (all of its principal 2304 authors, if it has less than five). 3039 authors, if it has fewer than five), unless they release you 3040 from this requirement. 2305 3041 2306 3042 C. State on the Title page the name of the publisher of the … … 2323 3059 H. Include an unaltered copy of this License. 2324 3060 2325 I. Preserve the section entitled "History", and its title, and2326 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 2327 3063 authors, and publisher of the Modified Version as given on 2328 the Title Page. If there is no section entitled "History" in3064 the Title Page. If there is no section Entitled "History" in 2329 3065 the Document, create one stating the title, year, authors, 2330 3066 and publisher of the Document as given on its Title Page, … … 2341 3077 it refers to gives permission. 2342 3078 2343 K. In any section entitled "Acknowledgments" or "Dedications",2344 preserve the section's title, and preserve in the section all2345 the substance and tone of each of the contributor2346 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. 2347 3083 2348 3084 L. Preserve all the Invariant Sections of the Document, … … 2351 3087 titles. 2352 3088 2353 M. Delete any section entitled "Endorsements". Such a section3089 M. Delete any section Entitled "Endorsements". Such a section 2354 3090 may not be included in the Modified Version. 2355 3091 2356 N. Do not retitle any existing section as "Endorsements" or to 2357 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. 2358 3097 2359 3098 If the Modified Version includes new front-matter sections or … … 2365 3104 other section titles. 2366 3105 2367 You may add a section entitled "Endorsements", provided it contains3106 You may add a section Entitled "Endorsements", provided it contains 2368 3107 nothing but endorsements of your Modified Version by various 2369 3108 parties--for example, statements of peer review or that the text … … 2393 3132 all of the Invariant Sections of all of the original documents, 2394 3133 unmodified, and list them all as Invariant Sections of your 2395 combined work in its license notice. 3134 combined work in its license notice, and that you preserve all 3135 their Warranty Disclaimers. 2396 3136 2397 3137 The combined work need only contain one copy of this License, and … … 2405 3145 combined work. 2406 3146 2407 In the combination, you must combine any sections entitled3147 In the combination, you must combine any sections Entitled 2408 3148 "History" in the various original documents, forming one section 2409 entitled "History"; likewise combine any sections entitled2410 "Acknowledg ments", and any sections entitled "Dedications". You2411 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." 2412 3152 2413 3153 6. COLLECTIONS OF DOCUMENTS … … 2430 3170 A compilation of the Document or its derivatives with other 2431 3171 separate and independent documents or works, in or on a volume of 2432 a storage or distribution medium, does not as a whole count as a 2433 Modified Version of the Document, provided no compilation 2434 copyright is claimed for the compilation. Such a compilation is 2435 called an "aggregate", and this License does not apply to the 2436 other self-contained works thus compiled with the Document, on 2437 account of their being thus compiled, if they are not themselves 2438 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. 2439 3178 2440 3179 If the Cover Text requirement of section 3 is applicable to these 2441 copies of the Document, then if the Document is less than one 2442 quarter of the entire aggregate, the Document's Cover Texts may be 2443 placed on covers that surround only the Document within the 2444 aggregate. Otherwise they must appear on covers around the whole 2445 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. 2446 3186 2447 3187 8. TRANSLATION … … 2453 3193 translations of some or all Invariant Sections in addition to the 2454 3194 original versions of these Invariant Sections. You may include a 2455 translation of this License provided that you also include the 2456 original English version of this License. In case of a 2457 disagreement between the translation and the original English 2458 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. 2459 3207 2460 3208 9. TERMINATION … … 2486 3234 Free Software Foundation. 2487 3235 2488 ADDENDUM: How to use this License for your documents2489 ==================================================== 3236 D.1 ADDENDUM: How to use this License for your documents 3237 ======================================================== 2490 3238 2491 3239 To use this License in a document you have written, include a copy of … … 2495 3243 Copyright (C) YEAR YOUR NAME. 2496 3244 Permission is granted to copy, distribute and/or modify this document 2497 under the terms of the GNU Free Documentation License, Version 1. 13245 under the terms of the GNU Free Documentation License, Version 1.2 2498 3246 or any later version published by the Free Software Foundation; 2499 with the Invariant Sections being LIST THEIR TITLES, with the 2500 Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. 2501 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 2502 3249 Free Documentation License''. 2503 3250 2504 If you have no Invariant Sections, write "with no Invariant Sections" 2505 instead of saying which ones are invariant. If you have no Front-Cover 2506 Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being 2507 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. 2508 3261 2509 3262 If your document contains nontrivial examples of program code, we … … 2518 3271 ***************** 2519 3272 3273 [index] 2520 3274 * Menu: 2521 3275 2522 * # (comments), in commands: Command s.2523 * # (comments), in makefile: Makefile Contents. 3276 * # (comments), in commands: Command Syntax. (line 27) 3277 * # (comments), in makefile: Makefile Contents. (line 41) 2524 3278 * #include: Automatic Prerequisites. 2525 * $$@, support for: Automatic Variables. 2526 * $, in function call: Syntax of Functions. 2527 * $, in rules: Rule Syntax. 2528 * $, in variable name: Computed Names. 2529 * $, in variable reference: Reference. 2530 * %, in pattern rules: Pattern Intro. 2531 * %, quoting in patsubst: Text Functions. 2532 * %, quoting in static pattern: Static Usage. 2533 * %, quoting in vpath: Selective Search. 2534 * %, quoting with \ (backslash) <1>: Text Functions. 2535 * %, quoting with \ (backslash) <2>: Static Usage. 2536 * %, quoting with \ (backslash): Selective Search. 2537 * * (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) 2538 3292 * +, and command execution: Instead of Execution. 2539 * +, and commands: MAKE Variable. 2540 * +, and define: Sequences. 2541 * +=: Appending. 2542 * +=, expansion: Reading Makefiles. 2543 * ,v (RCS file extension): Catalogue of Rules. 2544 * - (in commands): Errors. 2545 * -, and define: Sequences. 2546 * --always-make: Options Summary. 2547 * --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) 2548 3303 * --assume-new: Instead of Execution. 2549 * --assume-new, and recursion: Options/Recursion. 2550 * --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) 2551 3307 * --assume-old: Avoiding Compilation. 2552 * --assume-old, and recursion: Options/Recursion. 2553 * --debug: Options Summary. 2554 * --directory <1>: Options Summary. 2555 * --directory: Recursion. 2556 * --directory, and --print-directory: -w Option. 2557 * --directory, and recursion: Options/Recursion. 2558 * --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) 2559 3317 * --dry-run <2>: Instead of Execution. 2560 * --dry-run: Echoing. 2561 * --environment-overrides: Options Summary. 2562 * --file <1>: Options Summary. 2563 * --file <2>: Makefile Arguments. 2564 * --file: Makefile Names. 2565 * --file, and recursion: Options/Recursion. 2566 * --help: Options Summary. 2567 * --ignore-errors <1>: Options Summary. 2568 * --ignore-errors: Errors. 2569 * --include-dir <1>: Options Summary. 2570 * --include-dir: Include. 2571 * --jobs <1>: Options Summary. 2572 * --jobs: Parallel. 2573 * --jobs, and recursion: Options/Recursion. 2574 * --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) 2575 3334 * --just-print <2>: Instead of Execution. 2576 * --just-print: Echoing. 2577 * --keep-going <1>: Options Summary. 2578 * --keep-going <2>: Testing. 2579 * --keep-going: Errors. 2580 * --load-average <1>: Options Summary. 2581 * --load-average: Parallel. 2582 * --makefile <1>: Options Summary. 2583 * --makefile <2>: Makefile Arguments. 2584 * --makefile: Makefile Names. 2585 * --max-load <1>: Options Summary. 2586 * --max-load: Parallel. 2587 * --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) 2588 3348 * --new-file: Instead of Execution. 2589 * --new-file, and recursion: Options/Recursion. 2590 * --no-builtin-rules: Options Summary. 2591 * --no-builtin-variables: Options Summary. 2592 * --no-keep-going: Options Summary. 2593 * --no-print-directory <1>: Options Summary. 2594 * --no-print-directory: -w Option. 2595 * --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) 2596 3357 * --old-file: Avoiding Compilation. 2597 * --old-file, and recursion: Options/Recursion. 2598 * --print-data-base: Options Summary. 2599 * --print-directory: Options Summary. 2600 * --print-directory, and --directory: -w Option. 2601 * --print-directory, and recursion: -w Option. 2602 * --print-directory, disabling: -w Option. 2603 * --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) 2604 3366 * --question: Instead of Execution. 2605 * --quiet <1>: Options Summary. 2606 * --quiet: Echoing. 2607 * --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) 2608 3371 * --recon <2>: Instead of Execution. 2609 * --recon: Echoing. 2610 * --silent <1>: Options Summary. 2611 * --silent: Echoing. 2612 * --stop: Options Summary. 2613 * --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) 2614 3378 * --touch: Instead of Execution. 2615 * --touch, and recursion: MAKE Variable. 2616 * --version: Options Summary. 2617 * --warn-undefined-variables: Options Summary. 2618 * --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) 2619 3384 * --what-if: Instead of Execution. 2620 * -B: Options Summary. 2621 * -b: Options Summary. 2622 * -C <1>: Options Summary. 2623 * -C: Recursion. 2624 * -C, and -w: -w Option. 2625 * -C, and recursion: Options/Recursion. 2626 * -d: Options Summary. 2627 * -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) 2628 3394 * -e (shell flag): Automatic Prerequisites. 2629 * -f <1>: Options Summary. 2630 * -f <2>: Makefile Arguments. 2631 * -f: Makefile Names. 2632 * -f, and recursion: Options/Recursion. 2633 * -h: Options Summary. 2634 * -I: Options Summary. 2635 * -i <1>: Options Summary. 2636 * -i: Errors. 2637 * -I: Include. 2638 * -j <1>: Options Summary. 2639 * -j: Parallel. 2640 * -j, and archive update: Archive Pitfalls. 2641 * -j, and recursion: Options/Recursion. 2642 * -k <1>: Options Summary. 2643 * -k <2>: Testing. 2644 * -k: Errors. 2645 * -l: Options Summary. 2646 * -l (library search): Libraries/Search. 2647 * -l (load average): Parallel. 2648 * -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) 2649 3417 * -M (to compiler): Automatic Prerequisites. 3418 (line 18) 2650 3419 * -MM (to GNU compiler): Automatic Prerequisites. 2651 * -n <1>: Options Summary. 3420 (line 68) 3421 * -n <1>: Options Summary. (line 138) 2652 3422 * -n <2>: Instead of Execution. 2653 * -n: Echoing. 2654 * -o <1>: Options Summary. 3423 (line 14) 3424 * -n: Echoing. (line 18) 3425 * -o <1>: Options Summary. (line 145) 2655 3426 * -o: Avoiding Compilation. 2656 * -o, and recursion: Options/Recursion. 2657 * -p: Options Summary. 2658 * -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) 2659 3431 * -q: Instead of Execution. 2660 * -R: Options Summary. 2661 * -r: Options Summary. 2662 * -S: Options Summary. 2663 * -s <1>: Options Summary. 2664 * -s: Echoing. 2665 * -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) 2666 3439 * -t: Instead of Execution. 2667 * -t, and recursion: MAKE Variable. 2668 * -v: Options Summary. 2669 * -W: Options Summary. 2670 * -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) 2671 3445 * -W: Instead of Execution. 2672 * -w, and -C: -w Option. 2673 * -w, and recursion: -w Option. 2674 * -W, and recursion: Options/Recursion. 2675 * -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) 2676 3451 * .a (archives): Archive Suffix Rules. 2677 * .C: Catalogue of Rules. 2678 * .c: Catalogue of Rules. 2679 * .cc: Catalogue of Rules. 2680 * .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) 2681 3458 * .d: Automatic Prerequisites. 2682 * .def: Catalogue of Rules. 2683 * .dvi: Catalogue of Rules. 2684 * .F: Catalogue of Rules. 2685 * .f: Catalogue of Rules. 2686 * .info: Catalogue of Rules. 2687 * .l: Catalogue of Rules. 2688 * .LIBPATTERNS, and link libraries: Libraries/Search. 2689 * .ln: Catalogue of Rules. 2690 * .mod: Catalogue of Rules. 2691 * .o: Catalogue of Rules. 2692 * .p: Catalogue of Rules. 2693 * .PRECIOUS intermediate files: Chained Rules. 2694 * .r: Catalogue of Rules. 2695 * .S: Catalogue of Rules. 2696 * .s: Catalogue of Rules. 2697 * .sh: Catalogue of Rules. 2698 * .sym: Catalogue of Rules. 2699 * .tex: Catalogue of Rules. 2700 * .texi: Catalogue of Rules. 2701 * .texinfo: Catalogue of Rules. 2702 * .txinfo: Catalogue of Rules. 2703 * .w: Catalogue of Rules. 2704 * .web: Catalogue of Rules. 2705 * .y: Catalogue of Rules. 2706 * :: rules (double-colon): Double-Colon. 2707 * := <1>: Setting. 2708 * :=: Flavors. 2709 * = <1>: Setting. 2710 * =: Flavors. 2711 * =, expansion: Reading Makefiles. 2712 * ? (wildcard character): Wildcards. 2713 * ?= <1>: Setting. 2714 * ?=: Flavors. 2715 * ?=, expansion: Reading Makefiles. 2716 * @ (in commands): Echoing. 2717 * @, and define: Sequences. 2718 * [...] (wildcard characters): Wildcards. 2719 * \ (backslash), for continuation lines: Simple Makefile. 2720 * \ (backslash), in commands: Execution. 2721 * \ (backslash), to quote % <1>: Text Functions. 2722 * \ (backslash), to quote % <2>: Static Usage. 2723 * \ (backslash), to quote %: Selective Search. 2724 * __.SYMDEF: Archive Symbols. 2725 * algorithm for directory search: Search Algorithm. 2726 * all (standard target): Goals. 2727 * appending to variables: Appending. 2728 * ar: Implicit Variables. 2729 * archive: Archives. 2730 * archive member targets: Archive Members. 2731 * archive symbol directory updating: Archive Symbols. 2732 * archive, and -j: Archive Pitfalls. 2733 * 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) 2734 3513 * archive, suffix rule for: Archive Suffix Rules. 2735 * Arg list too long: Options/Recursion. 2736 * arguments of functions: Syntax of Functions. 2737 * as <1>: Implicit Variables. 2738 * as: Catalogue of Rules. 2739 * 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) 2740 3520 * automatic generation of prerequisites <1>: Automatic Prerequisites. 2741 * automatic generation of prerequisites: Include. 2742 * automatic variables: Automatic Variables. 2743 * automatic variables in prerequisites: Automatic Variables. 2744 * backquotes: Shell Function. 2745 * backslash (\), for continuation lines: Simple Makefile. 2746 * backslash (\), in commands: Execution. 2747 * backslash (\), to quote % <1>: Text Functions. 2748 * backslash (\), to quote % <2>: Static Usage. 2749 * 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) 2750 3531 * backslashes in pathnames and wildcard expansion: Wildcard Pitfall. 2751 * basename: File Name Functions. 3532 (line 31) 3533 * basename: File Name Functions. (line 57) 2752 3534 * binary packages: Install Command Categories. 2753 * broken pipe: Parallel. 2754 * bugs, reporting: Bugs. 2755 * built-in special targets: Special Targets. 2756 * C++, rule to compile: Catalogue of Rules. 2757 * C, rule to compile: Catalogue of Rules. 2758 * cc <1>: Implicit Variables. 2759 * cc: Catalogue of Rules. 2760 * cd (shell command) <1>: MAKE Variable. 2761 * cd (shell command): Execution. 2762 * chains of rules: Chained Rules. 2763 * check (standard target): Goals. 2764 * clean (standard target): Goals. 2765 * clean target <1>: Cleanup. 2766 * clean target: Simple Makefile. 2767 * cleaning up: Cleanup. 2768 * clobber (standard target): Goals. 2769 * co <1>: Implicit Variables. 2770 * 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) 2771 3554 * combining rules by prerequisite: Combine By Prerequisite. 3555 (line 6) 2772 3556 * command line variable definitions, and recursion: Options/Recursion. 2773 * command line variables: Overriding. 2774 * commands: Rule Syntax. 2775 * commands, backslash (\) in: Execution. 2776 * commands, comments in: Commands. 2777 * commands, echoing: Echoing. 2778 * commands, empty: Empty Commands. 2779 * commands, errors in: Errors. 2780 * commands, execution: Execution. 2781 * commands, execution in parallel: Parallel. 2782 * commands, expansion: Shell Function. 2783 * 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) 2784 3571 * commands, instead of executing: Instead of Execution. 2785 * commands, introduction to: Rule Introduction. 2786 * commands, quoting newlines in: Execution. 2787 * commands, sequences of: Sequences. 2788 * comments, in commands: Commands. 2789 * comments, in makefile: Makefile Contents. 2790 * compatibility: Features. 2791 * compatibility in exporting: Variables/Recursion. 2792 * compilation, testing: Testing. 2793 * computed variable name: Computed Names. 2794 * conditional expansion: If Function. 2795 * conditional variable assignment: Flavors. 2796 * conditionals: Conditionals. 2797 * 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) 2798 3590 * controlling make: Make Control Functions. 3591 (line 6) 2799 3592 * conventions for makefiles: Makefile Conventions. 2800 * ctangle <1>: Implicit Variables. 2801 * ctangle: Catalogue of Rules. 2802 * cweave <1>: Implicit Variables. 2803 * cweave: Catalogue of Rules. 2804 * data base of make rules: Options Summary. 2805 * deducing commands (implicit rules): make Deduces. 2806 * default directories for included makefiles: Include. 2807 * default goal <1>: Rules. 2808 * default goal: How Make Works. 2809 * default makefile name: Makefile Names. 2810 * default rules, last-resort: Last Resort. 2811 * define, expansion: Reading Makefiles. 2812 * defining variables verbatim: Defining. 2813 * deletion of target files <1>: Interrupts. 2814 * deletion of target files: Errors. 2815 * directive: Makefile Contents. 2816 * directories, printing them: -w Option. 2817 * directories, updating archive symbol: Archive Symbols. 2818 * directory part: File Name Functions. 2819 * 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) 2820 3614 * directory search (VPATH), and implicit rules: Implicit/Search. 3615 (line 6) 2821 3616 * directory search (VPATH), and link libraries: Libraries/Search. 3617 (line 6) 2822 3618 * directory search (VPATH), and shell commands: Commands/Search. 2823 * directory search algorithm: Search Algorithm. 2824 * directory search, traditional (GPATH): Search Algorithm. 2825 * dist (standard target): Goals. 2826 * distclean (standard target): Goals. 2827 * dollar sign ($), in function call: Syntax of Functions. 2828 * dollar sign ($), in rules: Rule Syntax. 2829 * dollar sign ($), in variable name: Computed Names. 2830 * dollar sign ($), in variable reference: Reference. 2831 * double-colon rules: Double-Colon. 2832 * duplicate words, removing: Text Functions. 2833 * E2BIG: Options/Recursion. 2834 * echoing of commands: Echoing. 2835 * editor: Introduction. 2836 * Emacs (M-x compile): Errors. 2837 * empty commands: Empty Commands. 2838 * empty targets: Empty Targets. 2839 * environment: Environment. 2840 * environment, and recursion: Variables/Recursion. 2841 * 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) 2842 3640 * error, stopping on: Make Control Functions. 2843 * errors (in commands): Errors. 2844 * errors with wildcards: Wildcard Pitfall. 2845 * evaluating makefile syntax: Eval Function. 2846 * 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) 2847 3646 * execution, instead of: Instead of Execution. 2848 * execution, of commands: Execution. 2849 * exit status (errors): Errors. 2850 * explicit rule, definition of: Makefile Contents. 2851 * explicit rule, expansion: Reading Makefiles. 2852 * exporting variables: Variables/Recursion. 2853 * f77 <1>: Implicit Variables. 2854 * 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) 2855 3659 * FDL, GNU Free Documentation License: GNU Free Documentation License. 2856 * features of GNU make: Features. 2857 * features, missing: Missing. 2858 * file name functions: File Name Functions. 2859 * file name of makefile: Makefile Names. 2860 * file name of makefile, how to specify: Makefile Names. 2861 * file name prefix, adding: File Name Functions. 2862 * file name suffix: File Name Functions. 2863 * file name suffix, adding: File Name Functions. 2864 * file name with wildcards: Wildcards. 2865 * file name, basename of: File Name Functions. 2866 * file name, directory part: File Name Functions. 2867 * 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) 2868 3675 * files, assuming new: Instead of Execution. 3676 (line 33) 2869 3677 * files, assuming old: Avoiding Compilation. 3678 (line 6) 2870 3679 * files, avoiding recompilation of: Avoiding Compilation. 2871 * files, intermediate: Chained Rules. 2872 * filtering out words: Text Functions. 2873 * filtering words: Text Functions. 2874 * finding strings: Text Functions. 2875 * flags: Options Summary. 2876 * flags for compilers: Implicit Variables. 2877 * flavors of variables: Flavors. 2878 * FORCE: Force Targets. 2879 * force targets: Force Targets. 2880 * Fortran, rule to compile: Catalogue of Rules. 2881 * 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) 2882 3693 * functions, for controlling make: Make Control Functions. 2883 * functions, for file names: File Name Functions. 2884 * functions, for text: Text Functions. 2885 * functions, syntax of: Syntax of Functions. 2886 * functions, user defined: Call Function. 2887 * g++ <1>: Implicit Variables. 2888 * g++: Catalogue of Rules. 2889 * 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) 2890 3702 * generating prerequisites automatically <1>: Automatic Prerequisites. 2891 * generating prerequisites automatically: Include. 2892 * get <1>: Implicit Variables. 2893 * get: Catalogue of Rules. 2894 * globbing (wildcards): Wildcards. 2895 * goal: How Make Works. 2896 * goal, default <1>: Rules. 2897 * goal, default: How Make Works. 2898 * goal, how to specify: Goals. 2899 * home directory: Wildcards. 2900 * IEEE Standard 1003.2: Overview. 2901 * ifdef, expansion: Reading Makefiles. 2902 * ifeq, expansion: Reading Makefiles. 2903 * ifndef, expansion: Reading Makefiles. 2904 * ifneq, expansion: Reading Makefiles. 2905 * implicit rule: Implicit Rules. 2906 * implicit rule, and directory search: Implicit/Search. 2907 * implicit rule, and VPATH: Implicit/Search. 2908 * implicit rule, definition of: Makefile Contents. 2909 * implicit rule, expansion: Reading Makefiles. 2910 * implicit rule, how to use: Using Implicit. 2911 * implicit rule, introduction to: make Deduces. 2912 * 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) 2913 3726 * implicit rule, search algorithm: Implicit Rule Search. 2914 * 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) 2915 3731 * including (MAKEFILE_LIST variable): MAKEFILE_LIST Variable. 2916 * including (MAKEFILES variable): MAKEFILES Variable. 2917 * including other makefiles: Include. 2918 * incompatibilities: Missing. 2919 * Info, rule to format: Catalogue of Rules. 2920 * install (standard target): Goals. 2921 * intermediate files: Chained Rules. 2922 * intermediate files, preserving: Chained Rules. 2923 * intermediate targets, explicit: Special Targets. 2924 * interrupt: Interrupts. 2925 * job slots: Parallel. 2926 * job slots, and recursion: Options/Recursion. 2927 * jobs, limiting based on load: Parallel. 2928 * joining lists of words: File Name Functions. 2929 * killing (interruption): Interrupts. 2930 * last-resort default rules: Last Resort. 2931 * ld: Catalogue of Rules. 2932 * lex <1>: Implicit Variables. 2933 * lex: Catalogue of Rules. 2934 * Lex, rule to run: Catalogue of Rules. 2935 * 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) 2936 3753 * library archive, suffix rule for: Archive Suffix Rules. 2937 * limiting jobs based on load: Parallel. 2938 * link libraries, and directory search: Libraries/Search. 2939 * link libraries, patterns matching: Libraries/Search. 2940 * linking, predefined rule for: Catalogue of Rules. 2941 * lint: Catalogue of Rules. 2942 * lint, rule to run: Catalogue of Rules. 2943 * list of all prerequisites: Automatic Variables. 2944 * list of changed prerequisites: Automatic Variables. 2945 * load average: Parallel. 2946 * loops in variable expansion: Flavors. 2947 * lpr (shell command) <1>: Empty Targets. 2948 * lpr (shell command): Wildcard Examples. 2949 * m2c: Catalogue of Rules. 2950 * 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) 2951 3771 * make depend: Automatic Prerequisites. 2952 * MAKECMDGOALS: Goals. 2953 * makefile: Introduction. 2954 * makefile name: Makefile Names. 2955 * makefile name, how to specify: Makefile Names. 2956 * makefile rule parts: Rule Introduction. 2957 * makefile syntax, evaluating: Eval Function. 2958 * 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) 2959 3779 * makefile, conventions for: Makefile Conventions. 2960 * makefile, how make processes: How Make Works. 2961 * makefile, how to write: Makefiles. 2962 * 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) 2963 3784 * makefile, overriding: Overriding Makefiles. 2964 * makefile, parsing: Reading Makefiles. 2965 * makefile, remaking of: Remaking Makefiles. 2966 * 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) 2967 3789 * makefiles, and MAKEFILE_LIST variable: MAKEFILE_LIST Variable. 2968 * makefiles, and special variables: Special Variables. 2969 * makeinfo <1>: Implicit Variables. 2970 * 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) 2971 3794 * match-anything rule: Match-Anything Rules. 3795 (line 6) 2972 3796 * match-anything rule, used to override: Overriding Makefiles. 2973 * missing features: Missing. 2974 * mistakes with wildcards: Wildcard Pitfall. 2975 * modified variable reference: Substitution Refs. 2976 * Modula-2, rule to compile: Catalogue of Rules. 2977 * mostlyclean (standard target): Goals. 2978 * multiple rules for one target: Multiple Rules. 2979 * multiple rules for one target (::): Double-Colon. 2980 * multiple targets: Multiple Targets. 2981 * multiple targets, in pattern rule: Pattern Intro. 2982 * name of makefile: Makefile Names. 2983 * name of makefile, how to specify: Makefile Names. 2984 * nested variable reference: Computed Names. 2985 * newline, quoting, in commands: Execution. 2986 * newline, quoting, in makefile: Simple Makefile. 2987 * nondirectory part: File Name Functions. 2988 * normal prerequisites: Prerequisite Types. 2989 * OBJ: Variables Simplify. 2990 * obj: Variables Simplify. 2991 * OBJECTS: Variables Simplify. 2992 * objects: Variables Simplify. 2993 * OBJS: Variables Simplify. 2994 * objs: Variables Simplify. 2995 * old-fashioned suffix rules: Suffix Rules. 2996 * options: Options Summary. 2997 * options, and recursion: Options/Recursion. 2998 * options, setting from environment: Options/Recursion. 2999 * options, setting in makefiles: Options/Recursion. 3000 * order of pattern rules: Pattern Intro. 3001 * order-only prerequisites: Prerequisite Types. 3002 * 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) 3003 3828 * overriding makefiles: Overriding Makefiles. 3004 * overriding variables with arguments: Overriding. 3005 * overriding with override: Override Directive. 3006 * parallel execution: Parallel. 3007 * parallel execution, and archive update: Archive Pitfalls. 3008 * parallel execution, overriding: Special Targets. 3009 * parts of makefile rule: Rule Introduction. 3010 * Pascal, rule to compile: Catalogue of Rules. 3011 * pattern rule: Pattern Intro. 3012 * pattern rule, expansion: Reading Makefiles. 3013 * pattern rules, order of: Pattern Intro. 3014 * pattern rules, static (not implicit): Static Pattern. 3015 * pattern rules, static, syntax of: Static Usage. 3016 * pattern-specific variables: Pattern-specific. 3017 * pc <1>: Implicit Variables. 3018 * pc: Catalogue of Rules. 3019 * phony targets: Phony Targets. 3020 * pitfalls of wildcards: Wildcard Pitfall. 3021 * portability: Features. 3022 * POSIX: Overview. 3023 * 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) 3024 3850 * post-installation commands: Install Command Categories. 3851 (line 6) 3025 3852 * pre-installation commands: Install Command Categories. 3026 * precious targets: Special Targets. 3027 * predefined rules and variables, printing: Options Summary. 3028 * prefix, adding: File Name Functions. 3029 * prerequisite: Rules. 3030 * prerequisite pattern, implicit: Pattern Intro. 3031 * prerequisite pattern, static (not implicit): Static Usage. 3032 * prerequisite types: Prerequisite Types. 3033 * prerequisite, expansion: Reading Makefiles. 3034 * 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) 3035 3863 * prerequisites, and automatic variables: Automatic Variables. 3864 (line 17) 3036 3865 * prerequisites, automatic generation <1>: Automatic Prerequisites. 3037 * prerequisites, automatic generation: Include. 3038 * prerequisites, introduction to: Rule Introduction. 3039 * prerequisites, list of all: Automatic Variables. 3040 * prerequisites, list of changed: Automatic Variables. 3041 * prerequisites, normal: Prerequisite Types. 3042 * prerequisites, order-only: Prerequisite Types. 3043 * prerequisites, varying (static pattern): Static Pattern. 3044 * preserving intermediate files: Chained Rules. 3045 * preserving with .PRECIOUS <1>: Chained Rules. 3046 * preserving with .PRECIOUS: Special Targets. 3047 * preserving with .SECONDARY: Special Targets. 3048 * print (standard target): Goals. 3049 * print target <1>: Empty Targets. 3050 * print target: Wildcard Examples. 3051 * printing directories: -w Option. 3052 * 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) 3053 3885 * printing user warnings: Make Control Functions. 3054 * problems and bugs, reporting: Bugs. 3055 * problems with wildcards: Wildcard Pitfall. 3056 * 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) 3057 3890 * question mode: Instead of Execution. 3058 * quoting %, in patsubst: Text Functions. 3059 * quoting %, in static pattern: Static Usage. 3060 * quoting %, in vpath: Selective Search. 3061 * quoting newline, in commands: Execution. 3062 * quoting newline, in makefile: Simple Makefile. 3063 * Ratfor, rule to compile: Catalogue of Rules. 3064 * RCS, rule to extract from: Catalogue of Rules. 3065 * reading makefiles: Reading Makefiles. 3066 * README: Makefile Names. 3067 * realclean (standard target): Goals. 3068 * 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) 3069 3904 * recompilation, avoiding: Avoiding Compilation. 3070 * recording events with empty targets: Empty Targets. 3071 * recursion: Recursion. 3072 * recursion, and -C: Options/Recursion. 3073 * recursion, and -f: Options/Recursion. 3074 * recursion, and -j: Options/Recursion. 3075 * recursion, and -o: Options/Recursion. 3076 * recursion, and -t: MAKE Variable. 3077 * recursion, and -w: -w Option. 3078 * 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) 3079 3915 * recursion, and command line variable definitions: Options/Recursion. 3080 * recursion, and environment: Variables/Recursion. 3081 * recursion, and MAKE variable: MAKE Variable.3082 * recursion, and MAKE FILES variable: MAKEFILES Variable.3083 * recursion, and options: Options/Recursion.3084 * recursion, and printing directories: -w Option.3085 * recursion, and variables: Variables/Recursion.3086 * recursion, level of: Variables/Recursion.3087 * recursi ve variable expansion <1>: Flavors.3088 * recursive variable expansion : Using Variables.3089 * recursive ly expanded variables: Flavors.3090 * re ference to variables <1>: Advanced.3091 * reference to variables : Reference.3092 * re linking: How Make Works.3093 * re making makefiles: Remaking Makefiles.3094 * rem oval of target files <1>: Interrupts.3095 * removal of target files : Errors.3096 * remov ing duplicate words: Text Functions.3097 * removing targets on failure: Special Targets.3098 * removing , to clean up: Cleanup.3099 * re porting bugs: Bugs.3100 * r m: Implicit Variables.3101 * rm (shell command) <1>: Errors.3102 * rm (shell command) < 2>: Phony Targets.3103 * rm (shell command) < 3>: Wildcard Examples.3104 * rm (shell command) : Simple Makefile.3105 * r ule commands: Commands.3106 * rule prerequisites: Rule Syntax.3107 * rule syntax: Rule Syntax.3108 * rule targets: Rule Syntax.3109 * rule , and $: Rule Syntax.3110 * rule, double-colon (::): Double-Colon. 3111 * rule, explicit, definition of: Makefile Contents. 3112 * rule, how to write: Rules. 3113 * rule, implicit: Implicit Rules. 3114 * rule, implicit, and directory search: Implicit/Search. 3115 * rule, implicit, and VPATH: Implicit/Search. 3116 * rule, implicit, chains of: Chained Rules. 3117 * rule, implicit, definition of: Makefile Contents. 3118 * rule, implicit, how to use: Using Implicit. 3119 * rule, implicit, introduction to: make Deduces. 3120 * rule, implicit, predefined: Catalogue of Rules. 3121 * rule, introduction to: Rule Introduction. 3122 * rule, multiple for one target: Multiple Rules. 3123 * rule, no commands or prerequisites: Force Targets. 3124 * rule, pattern: Pattern Intro. 3125 * 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) 3126 3962 * rule, static pattern versus implicit: Static versus Implicit. 3127 * rule, with multiple targets: Multiple Targets. 3128 * s. (SCCS file prefix): Catalogue of Rules. 3129 * 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) 3130 3968 * search algorithm, implicit rule: Implicit Rule Search. 3131 * search path for prerequisites (VPATH): Directory Search. 3969 (line 6) 3970 * search path for prerequisites (VPATH): Directory Search. (line 6) 3132 3971 * search path for prerequisites (VPATH), and implicit rules: Implicit/Search. 3972 (line 6) 3133 3973 * search path for prerequisites (VPATH), and link libraries: Libraries/Search. 3134 * searching for strings: Text Functions. 3135 * secondary files: Chained Rules. 3136 * 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) 3137 3985 * sed (shell command): Automatic Prerequisites. 3138 * selecting a word: Text Functions. 3139 * selecting word lists: Text Functions. 3140 * sequences of commands: Sequences. 3141 * setting options from environment: Options/Recursion. 3142 * setting options in makefiles: Options/Recursion. 3143 * setting variables: Setting. 3144 * several rules for one target: Multiple Rules. 3145 * several targets in a rule: Multiple Targets. 3146 * shar (standard target): Goals. 3147 * shell command: Simple Makefile. 3148 * shell command, and directory search: Commands/Search. 3149 * shell command, execution: Execution. 3150 * shell command, function for: Shell Function. 3151 * shell file name pattern (in include): Include. 3152 * shell wildcards (in include): Include. 3153 * SHELL, MS-DOS specifics: Execution. 3154 * signal: Interrupts. 3155 * silent operation: Echoing. 3156 * simple makefile: Simple Makefile. 3157 * simple variable expansion: Using Variables. 3158 * simplifying with variables: Variables Simplify. 3159 * simply expanded variables: Flavors. 3160 * sorting words: Text Functions. 3161 * spaces, in variable values: Flavors. 3162 * spaces, stripping: Text Functions. 3163 * special targets: Special Targets. 3164 * special variables: Special Variables. 3165 * specifying makefile name: Makefile Names. 3166 * standard input: Parallel. 3167 * 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) 3168 4024 * standards for makefiles: Makefile Conventions. 3169 * static pattern rule: Static Pattern. 3170 * 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) 3171 4028 * static pattern rule, versus implicit: Static versus Implicit. 3172 * stem <1>: Pattern Match. 3173 * stem: Static Usage. 3174 * 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) 3175 4035 * stopping make: Make Control Functions. 3176 * strings, searching for: Text Functions. 3177 * stripping whitespace: Text Functions. 3178 * sub-make: Variables/Recursion. 3179 * subdirectories, recursion for: Recursion. 3180 * substitution variable reference: Substitution Refs. 3181 * 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) 3182 4043 * suffix rule, for archive: Archive Suffix Rules. 3183 * suffix, adding: File Name Functions. 3184 * suffix, function to find: File Name Functions. 3185 * suffix, substituting in variables: Substitution Refs. 3186 * switches: Options Summary. 3187 * symbol directories, updating archive: Archive Symbols. 3188 * syntax of rules: Rule Syntax. 3189 * tab character (in commands): Rule Syntax. 3190 * tabs in rules: Rule Introduction. 3191 * TAGS (standard target): Goals. 3192 * tangle <1>: Implicit Variables. 3193 * tangle: Catalogue of Rules. 3194 * tar (standard target): Goals. 3195 * target: Rules. 3196 * target pattern, implicit: Pattern Intro. 3197 * target pattern, static (not implicit): Static Usage. 3198 * target, deleting on error: Errors. 3199 * target, deleting on interrupt: Interrupts. 3200 * target, expansion: Reading Makefiles. 3201 * target, multiple in pattern rule: Pattern Intro. 3202 * 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) 3203 4066 * target, touching: Instead of Execution. 3204 * target-specific variables: Target-specific. 3205 * targets: Rule Syntax. 3206 * targets without a file: Phony Targets. 3207 * targets, built-in special: Special Targets. 3208 * targets, empty: Empty Targets. 3209 * targets, force: Force Targets. 3210 * targets, introduction to: Rule Introduction. 3211 * targets, multiple: Multiple Targets. 3212 * 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) 3213 4077 * terminal rule: Match-Anything Rules. 3214 * test (standard target): Goals. 3215 * testing compilation: Testing. 3216 * tex <1>: Implicit Variables. 3217 * tex: Catalogue of Rules. 3218 * TeX, rule to run: Catalogue of Rules. 3219 * texi2dvi <1>: Implicit Variables. 3220 * texi2dvi: Catalogue of Rules. 3221 * Texinfo, rule to format: Catalogue of Rules. 3222 * tilde (~): Wildcards. 3223 * touch (shell command) <1>: Empty Targets. 3224 * 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) 3225 4090 * touching files: Instead of Execution. 3226 * traditional directory search (GPATH): Search Algorithm. 3227 * types of prerequisites: Prerequisite Types. 3228 * undefined variables, warning message: Options Summary. 3229 * updating archive symbol directories: Archive Symbols. 3230 * updating makefiles: Remaking Makefiles. 3231 * user defined functions: Call Function. 3232 * value: Using Variables. 3233 * value, how a variable gets it: Values. 3234 * variable: Using Variables. 3235 * variable definition: Makefile Contents. 3236 * variables: Variables Simplify. 3237 * variables, $ in name: Computed Names. 3238 * variables, and implicit rule: Automatic Variables. 3239 * variables, appending to: Appending. 3240 * variables, automatic: Automatic Variables. 3241 * variables, command line: Overriding. 3242 * variables, command line, and recursion: Options/Recursion. 3243 * variables, computed names: Computed Names. 3244 * variables, conditional assignment: Flavors. 3245 * variables, defining verbatim: Defining. 3246 * variables, environment <1>: Environment. 3247 * variables, environment: Variables/Recursion. 3248 * variables, exporting: Variables/Recursion. 3249 * variables, flavors: Flavors. 3250 * variables, how they get their values: Values. 3251 * variables, how to reference: Reference. 3252 * variables, loops in expansion: Flavors. 3253 * variables, modified reference: Substitution Refs. 3254 * variables, nested references: Computed Names. 3255 * variables, origin of: Origin Function. 3256 * variables, overriding: Override Directive. 3257 * variables, overriding with arguments: Overriding. 3258 * variables, pattern-specific: Pattern-specific. 3259 * variables, recursively expanded: Flavors. 3260 * variables, setting: Setting. 3261 * variables, simply expanded: Flavors. 3262 * variables, spaces in values: Flavors. 3263 * variables, substituting suffix in: Substitution Refs. 3264 * variables, substitution reference: Substitution Refs. 3265 * variables, target-specific: Target-specific. 3266 * variables, unexpanded value: Value Function. 3267 * variables, warning for undefined: Options Summary. 3268 * varying prerequisites: Static Pattern. 3269 * verbatim variable definition: Defining. 3270 * vpath: Directory Search. 3271 * VPATH, and implicit rules: Implicit/Search. 3272 * 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) 3273 4142 * warnings, printing: Make Control Functions. 3274 * weave <1>: Implicit Variables. 3275 * weave: Catalogue of Rules. 3276 * 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) 3277 4147 * what if: Instead of Execution. 3278 * whitespace, in variable values: Flavors. 3279 * whitespace, stripping: Text Functions. 3280 * wildcard: Wildcards. 3281 * wildcard pitfalls: Wildcard Pitfall. 3282 * wildcard, function: File Name Functions. 3283 * wildcard, in archive member: Archive Members. 3284 * 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) 3285 4156 * wildcards and MS-DOS/MS-Windows backslashes: Wildcard Pitfall. 3286 * word, selecting a: Text Functions. 3287 * words, extracting first: Text Functions. 3288 * words, filtering: Text Functions. 3289 * words, filtering out: Text Functions. 3290 * words, finding number: Text Functions. 3291 * words, iterating over: Foreach Function. 3292 * words, joining lists: File Name Functions. 3293 * words, removing duplicates: Text Functions. 3294 * words, selecting lists of: Text Functions. 3295 * writing rule commands: Commands. 3296 * writing rules: Rules. 3297 * yacc <1>: Implicit Variables. 3298 * yacc <2>: Catalogue of Rules. 3299 * yacc: Sequences. 3300 * Yacc, rule to run: Catalogue of Rules. 3301 * ~ (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) 3302 4176 3303 4177 … … 3307 4181 ******************************************* 3308 4182 4183 [index] 3309 4184 * Menu: 3310 4185 3311 * $$(@D): Automatic Variables. 3312 * $$(@F): Automatic Variables. 3313 * $$@: Automatic Variables. 3314 * $%: Automatic Variables. 3315 * $(%D): Automatic Variables. 3316 * $(%F): Automatic Variables. 3317 * $(*D): Automatic Variables. 3318 * $(*F): Automatic Variables. 3319 * $(+D): Automatic Variables. 3320 * $(+F): Automatic Variables. 3321 * $(.VARIABLES): Special Variables. 3322 * $(<D): Automatic Variables. 3323 * $(<F): Automatic Variables. 3324 * $(?D): Automatic Variables. 3325 * $(?F): Automatic Variables. 3326 * $(@D): Automatic Variables. 3327 * $(@F): Automatic Variables. 3328 * $(^D): Automatic Variables. 3329 * $(^F): Automatic Variables. 3330 * $*: Automatic Variables. 3331 * $*, and static pattern: Static Usage. 3332 * $+: Automatic Variables. 3333 * $<: Automatic Variables. 3334 * $?: Automatic Variables. 3335 * $@: Automatic Variables. 3336 * $^: Automatic Variables. 3337 * % (automatic variable): Automatic Variables. 3338 * %D (automatic variable): Automatic Variables. 3339 * %F (automatic variable): Automatic Variables. 3340 * * (automatic variable): Automatic Variables. 3341 * * (automatic variable), unsupported bizarre usage: Missing. 3342 * *D (automatic variable): Automatic Variables. 3343 * *F (automatic variable): Automatic Variables. 3344 * + (automatic variable): Automatic Variables. 3345 * +D (automatic variable): Automatic Variables. 3346 * +F (automatic variable): Automatic Variables. 3347 * .DEFAULT <1>: Last Resort. 3348 * .DEFAULT: Special Targets. 3349 * .DEFAULT, and empty commands: Empty Commands. 3350 * .DELETE_ON_ERROR <1>: Errors. 3351 * .DELETE_ON_ERROR: Special Targets. 3352 * .EXPORT_ALL_VARIABLES <1>: Variables/Recursion. 3353 * .EXPORT_ALL_VARIABLES: Special Targets. 3354 * .IGNORE <1>: Errors. 3355 * .IGNORE: Special Targets. 3356 * .INTERMEDIATE: Special Targets. 3357 * .LIBPATTERNS: Libraries/Search. 3358 * .LOW_RESOLUTION_TIME: Special Targets. 3359 * .NOTPARALLEL: Special Targets. 3360 * .PHONY <1>: Special Targets. 3361 * .PHONY: Phony Targets. 3362 * .POSIX: Options/Recursion. 3363 * .PRECIOUS <1>: Interrupts. 3364 * .PRECIOUS: Special Targets. 3365 * .SECONDARY: Special Targets. 3366 * .SILENT <1>: Echoing. 3367 * .SILENT: Special Targets. 3368 * .SUFFIXES <1>: Suffix Rules. 3369 * .SUFFIXES: Special Targets. 3370 * .VARIABLES (list of variables): Special Variables. 3371 * /usr/gnu/include: Include. 3372 * /usr/include: Include. 3373 * /usr/local/include: Include. 3374 * < (automatic variable): Automatic Variables. 3375 * <D (automatic variable): Automatic Variables. 3376 * <F (automatic variable): Automatic Variables. 3377 * ? (automatic variable): Automatic Variables. 3378 * ?D (automatic variable): Automatic Variables. 3379 * ?F (automatic variable): Automatic Variables. 3380 * @ (automatic variable): Automatic Variables. 3381 * @D (automatic variable): Automatic Variables. 3382 * @F (automatic variable): Automatic Variables. 3383 * ^ (automatic variable): Automatic Variables. 3384 * ^D (automatic variable): Automatic Variables. 3385 * ^F (automatic variable): Automatic Variables. 3386 * addprefix: File Name Functions. 3387 * addsuffix: File Name Functions. 3388 * AR: Implicit Variables. 3389 * ARFLAGS: Implicit Variables. 3390 * AS: Implicit Variables. 3391 * ASFLAGS: Implicit Variables. 3392 * basename: File Name Functions. 3393 * bindir: Directory Variables. 3394 * call: Call Function. 3395 * CC: Implicit Variables. 3396 * CFLAGS: Implicit Variables. 3397 * CO: Implicit Variables. 3398 * COFLAGS: Implicit Variables. 3399 * COMSPEC: Execution. 3400 * CPP: Implicit Variables. 3401 * CPPFLAGS: Implicit Variables. 3402 * CTANGLE: Implicit Variables. 3403 * CURDIR: Recursion. 3404 * CWEAVE: Implicit Variables. 3405 * CXX: Implicit Variables. 3406 * CXXFLAGS: Implicit Variables. 3407 * define: Defining. 3408 * dir: File Name Functions. 3409 * else: Conditional Syntax. 3410 * endef: Defining. 3411 * 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) 3412 4293 * error: Make Control Functions. 3413 * eval: Eval Function. 3414 * exec_prefix: Directory Variables. 3415 * export: Variables/Recursion. 3416 * FC: Implicit Variables. 3417 * FFLAGS: Implicit Variables. 3418 * filter: Text Functions. 3419 * filter-out: Text Functions. 3420 * findstring: Text Functions. 3421 * firstword: Text Functions. 3422 * foreach: Foreach Function. 3423 * GET: Implicit Variables. 3424 * GFLAGS: Implicit Variables. 3425 * GNUmakefile: Makefile Names. 3426 * GPATH: Search Algorithm. 3427 * if: If Function. 3428 * ifdef: Conditional Syntax. 3429 * ifeq: Conditional Syntax. 3430 * ifndef: Conditional Syntax. 3431 * ifneq: Conditional Syntax. 3432 * include: Include. 3433 * join: File Name Functions. 3434 * LDFLAGS: Implicit Variables. 3435 * LEX: Implicit Variables. 3436 * LFLAGS: Implicit Variables. 3437 * libexecdir: Directory Variables. 3438 * MAKE <1>: Flavors. 3439 * MAKE: MAKE Variable. 3440 * MAKECMDGOALS: Goals. 3441 * makefile: Makefile Names. 3442 * Makefile: Makefile Names. 3443 * MAKEFILES <1>: Variables/Recursion. 3444 * MAKEFILES: MAKEFILES Variable. 3445 * MAKEFLAGS: Options/Recursion. 3446 * MAKEINFO: Implicit Variables. 3447 * MAKELEVEL <1>: Flavors. 3448 * MAKELEVEL: Variables/Recursion. 3449 * MAKEOVERRIDES: Options/Recursion. 3450 * MFLAGS: Options/Recursion. 3451 * notdir: File Name Functions. 3452 * origin: Origin Function. 3453 * OUTPUT_OPTION: Catalogue of Rules. 3454 * override: Override Directive. 3455 * patsubst <1>: Text Functions. 3456 * patsubst: Substitution Refs. 3457 * PC: Implicit Variables. 3458 * PFLAGS: Implicit Variables. 3459 * prefix: Directory Variables. 3460 * RFLAGS: Implicit Variables. 3461 * RM: Implicit Variables. 3462 * sbindir: Directory Variables. 3463 * shell: Shell Function. 3464 * SHELL: Execution. 3465 * SHELL (command execution): Execution. 3466 * sort: Text Functions. 3467 * strip: Text Functions. 3468 * subst <1>: Text Functions. 3469 * subst: Multiple Targets. 3470 * suffix: File Name Functions. 3471 * SUFFIXES: Suffix Rules. 3472 * TANGLE: Implicit Variables. 3473 * TEX: Implicit Variables. 3474 * TEXI2DVI: Implicit Variables. 3475 * unexport: Variables/Recursion. 3476 * value: Value Function. 3477 * vpath: Selective Search. 3478 * VPATH: General Search. 3479 * vpath: Directory Search. 3480 * 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) 3481 4381 * warning: Make Control Functions. 3482 * WEAVE: Implicit Variables. 3483 * wildcard <1>: File Name Functions. 3484 * wildcard: Wildcard Function. 3485 * word: Text Functions. 3486 * wordlist: Text Functions. 3487 * words: Text Functions. 3488 * YACC: Implicit Variables. 3489 * YACCR: Implicit Variables. 3490 * YFLAGS: Implicit Variables. 3491 3492 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 -
vendor/gnumake/current/doc/make.texi
r280 r501 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.