Changeset 903 in kBuild for trunk/src/gmakenew/doc
- Timestamp:
- May 23, 2007 5:31:19 AM (18 years ago)
- Location:
- trunk/src/gmakenew/doc
- Files:
-
- 8 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmakenew/doc/make.texi
r503 r903 5 5 @include version.texi 6 6 @set EDITION 0.70 7 @set RCSID $Id: make.texi,v 1.4 5 2006/04/01 06:36:40psmith Exp $7 @set RCSID $Id: make.texi,v 1.47 2007/05/11 20:57:21 psmith Exp $ 8 8 9 9 @settitle GNU @code{make} … … 51 51 52 52 53 @dircategory GNU Packages53 @dircategory Software development 54 54 @direntry 55 55 * Make: (make). Remake files automatically. … … 1010 1010 specially in certain situations. 1011 1011 1012 You cannot use comments within variable references or function calls: 1013 any instance of @code{#} will be treated literally (rather than as the 1014 start of a comment) inside a variable reference or function call. 1015 1012 1016 Within a command script (if the line begins with a TAB character) the 1013 1017 entire line is passed to the shell, just as with any other line that … … 1252 1256 @end example 1253 1257 1254 @xref{Text Functions}, for more information on the @code{ word} and1255 @code{words} functions used above. @xref{Flavors, The Two Flavors of 1256 Variables}, for more information on simply-expanded (@code{:=}) 1257 variabledefinitions.1258 @xref{Text Functions}, for more information on the @code{lastword} 1259 function used above. @xref{Flavors, The Two Flavors of Variables}, 1260 for more information on simply-expanded (@code{:=}) variable 1261 definitions. 1258 1262 1259 1263 @node Special Variables, Remaking Makefiles, MAKEFILE_LIST Variable, Makefiles … … 1745 1749 @code{foo.1 bar.1} respectively. In the third they will have values 1746 1750 @code{foo.1}, @code{foo.1 bar.1 foo.2 bar.2}, and @code{foo.1 bar.1 1747 foo.2 bar.2 } respectively.1751 foo.2 bar.2 foo.1 foo.1 bar.1 foo.1 bar.1} respectively. 1748 1752 1749 1753 Rules undergo secondary expansion in makefile order, except that … … 1938 1942 Variables, ,How to Use Variables}). If you have enabled secondary 1939 1943 expansion (@pxref{Secondary Expansion}) and you want a literal dollar 1940 sign in the prerequisites lis e, you must actually write @emph{four}1944 sign in the prerequisites list, you must actually write @emph{four} 1941 1945 dollar signs (@samp{$$$$}). 1942 1946 … … 2001 2005 The normal prerequisites section may of course be empty. Also, you 2002 2006 may still declare multiple lines of prerequisites for the same target: 2003 they are appended appropriately. Note that if you declare the same 2004 file to be both a normal and an order-only prerequisite, the normal 2005 prerequisite takes precedence (since they are a strict superset of the 2006 behavior of an order-only prerequisite). 2007 they are appended appropriately (normal prerequisites are appended to 2008 the list of normal prerequisites; order-only prerequisites are 2009 appended to the list of order-only prerequisites). Note that if you 2010 declare the same file to be both a normal and an order-only 2011 prerequisite, the normal prerequisite takes precedence (since they 2012 have a strict superset of the behavior of an order-only prerequisite). 2013 2014 Consider an example where your targets are to be placed in a separate 2015 directory, and that directory might not exist before @code{make} is 2016 run. In this situation, you want the directory to be created before 2017 any targets are placed into it but, because the timestamps on 2018 directories change whenever a file is added, removed, or renamed, we 2019 certainly don't want to rebuild all the targets whenever the 2020 directory's timestamp changes. One way to manage this is with 2021 order-only prerequisites: make the directory an order-only 2022 prerequisite on all the targets: 2023 2024 @example 2025 OBJDIR := objdir 2026 OBJS := $(addprefix $(OBJDIR)/,foo.o bar.o baz.o) 2027 2028 $(OBJDIR)/%.o : %.c 2029 $(COMPILE.c) $(OUTPUT_OPTION) $< 2030 2031 all: $(OBJS) 2032 2033 $(OBJS): | $(OBJDIR) 2034 2035 $(OBJDIR): 2036 mkdir $(OBJDIR) 2037 @end example 2038 2039 Now the rule to create the @file{objdir} directory will be run, if 2040 needed, before any @samp{.o} is built, but no @samp{.o} will be built 2041 because the @file{objdir} directory timestamp changed. 2007 2042 2008 2043 @node Wildcards, Directory Search, Prerequisite Types, Rules … … 2906 2941 @xref{Secondary Expansion, ,Secondary Expansion}. 2907 2942 2908 The prerequisites of the special target @code{.SUFFIXES} are the list2909 of suffixes to be used in checking for suffix rules.2910 @xref{Suffix Rules, , Old-Fashioned Suffix Rules}.2911 2912 2943 @findex .DELETE_ON_ERROR 2913 2944 @item .DELETE_ON_ERROR … … 2996 3027 @cindex parallel execution, overriding 2997 3028 2998 If @code{.NOTPARALLEL} is mentioned as a target, then this invocation of2999 @code{make} will be run serially, even if the @samp{-j} option is3000 given. Any recursively invoked @code{make} command will still be run in3001 parallel (unless its makefile contains this target). Any prerequisites 3002 on this target are ignored.3029 If @code{.NOTPARALLEL} is mentioned as a target, then this invocation 3030 of @code{make} will be run serially, even if the @samp{-j} option is 3031 given. Any recursively invoked @code{make} command will still run 3032 commands in parallel (unless its makefile also contains this target). 3033 Any prerequisites on this target are ignored. 3003 3034 @end table 3004 3035 … … 3094 3125 if the file's name begins with a dot, no error message is printed. 3095 3126 This odd behavior is only for compatibility with other implementations 3096 of @code{make} ...you should avoid using it). Occasionally it is3127 of @code{make}@dots{} you should avoid using it). Occasionally it is 3097 3128 useful to have the same target invoke multiple commands which are 3098 3129 defined in different parts of your makefile; you can use … … 3653 3684 3654 3685 @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. 3686 Notice how the backslash/newline pair was removed inside the string 3687 quoted with double quotes (@code{"@dots{}"}), but not from the string 3688 quoted with single quotes (@code{'@dots{}'}). This is the way the 3689 default shell (@file{/bin/sh}) handles backslash/newline pairs. If 3690 you specify a different shell in your makefiles it may treat them 3691 differently. 3660 3692 3661 3693 Sometimes you want to split a long line inside of single quotes, but … … 3943 3975 for it to finish before executing the next. However, the @samp{-j} or 3944 3976 @samp{--jobs} option tells @code{make} to execute many commands 3945 simultaneously.@refill 3977 simultaneously. You can inhibit parallelism in a particular makefile 3978 with the @code{.NOTPARALLEL} pseudo-target (@pxref{Special 3979 Targets,Special Built-in Target Names}).@refill 3946 3980 3947 3981 On MS-DOS, the @samp{-j} option has no effect, since that system doesn't … … 8353 8387 the special target @code{.SUFFIXES}). The default suffix list is: 8354 8388 @code{.out}, @code{.a}, @code{.ln}, @code{.o}, @code{.c}, @code{.cc}, 8355 @code{.C}, @code{.cpp}, @code{.p}, @code{.f}, @code{.F}, @code{.r}, @code{.y}, 8356 @code{.l}, @code{.s}, @code{.S}, @code{.mod}, @code{.sym}, @code{.def}, 8357 @code{.h}, @code{.info}, @code{.dvi}, @code{.tex}, @code{.texinfo}, 8358 @code{.texi}, @code{.txinfo}, @code{.w}, @code{.ch} @code{.web}, 8359 @code{.sh}, @code{.elc}, @code{.el}. All of the implicit rules 8360 described below whose prerequisites have one of these suffixes are 8361 actually suffix rules. If you modify the suffix list, the only 8362 predefined suffix rules in effect will be those named by one or two of 8363 the suffixes that are on the list you specify; rules whose suffixes fail 8364 to be on the list are disabled. @xref{Suffix Rules, ,Old-Fashioned 8365 Suffix Rules}, for full details on suffix rules. 8389 @code{.C}, @code{.cpp}, @code{.p}, @code{.f}, @code{.F}, @code{.m}, 8390 @code{.r}, @code{.y}, @code{.l}, @code{.ym}, @code{.lm}, @code{.s}, 8391 @code{.S}, @code{.mod}, @code{.sym}, @code{.def}, @code{.h}, 8392 @code{.info}, @code{.dvi}, @code{.tex}, @code{.texinfo}, @code{.texi}, 8393 @code{.txinfo}, @code{.w}, @code{.ch} @code{.web}, @code{.sh}, 8394 @code{.elc}, @code{.el}. All of the implicit rules described below 8395 whose prerequisites have one of these suffixes are actually suffix 8396 rules. If you modify the suffix list, the only predefined suffix 8397 rules in effect will be those named by one or two of the suffixes that 8398 are on the list you specify; rules whose suffixes fail to be on the 8399 list are disabled. @xref{Suffix Rules, ,Old-Fashioned Suffix Rules}, 8400 for full details on suffix rules. 8366 8401 8367 8402 @table @asis … … 8694 8729 @pindex cc 8695 8730 8696 @item CO8697 @vindex CO8698 Program for checking out files from RCS; default @samp{co}.8699 @pindex cc8700 8701 8731 @item CXX 8702 8732 @vindex CXX 8703 8733 Program for compiling C++ programs; default @samp{g++}. 8704 8734 @pindex g++ 8705 8706 @item CO8707 @vindex CO8708 Program for extracting a file from RCS; default @samp{co}.8709 @pindex co8710 8735 8711 8736 @item CPP … … 8720 8745 @pindex f77 8721 8746 8747 @item M2C 8748 @vindex M2C 8749 Program to use to compile Modula-2 source code; default @samp{m2c}. 8750 @pindex m2c 8751 8752 @item PC 8753 @vindex PC 8754 Program for compiling Pascal programs; default @samp{pc}. 8755 @pindex pc 8756 8757 @item CO 8758 @vindex CO 8759 Program for extracting a file from RCS; default @samp{co}. 8760 @pindex co 8761 8722 8762 @item GET 8723 8763 @vindex GET … … 8739 8779 Program to use to run lint on source code; default @samp{lint}. 8740 8780 @pindex lint 8741 8742 @item M2C8743 @vindex M2C8744 Program to use to compile Modula-2 source code; default @samp{m2c}.8745 @pindex m2c8746 8747 @item PC8748 @vindex PC8749 Program for compiling Pascal programs; default @samp{pc}.8750 @pindex pc8751 8781 8752 8782 @item MAKEINFO
Note:
See TracChangeset
for help on using the changeset viewer.