Thu Dec 8 00:44:40 2016 UTC ()
Fix typo.


(yyamano)
diff -r1.227 -r1.228 pkgsrc/doc/pkgsrc.html
diff -r1.227 -r1.228 pkgsrc/doc/pkgsrc.txt
diff -r1.26 -r1.27 pkgsrc/doc/guide/files/makefile.xml

cvs diff -r1.227 -r1.228 pkgsrc/doc/pkgsrc.html (expand / switch to unified diff)

--- pkgsrc/doc/pkgsrc.html 2016/11/15 13:51:07 1.227
+++ pkgsrc/doc/pkgsrc.html 2016/12/08 00:44:39 1.228
@@ -187,27 +187,27 @@ builds) @@ -187,27 +187,27 @@ builds)
187<dt><span class="sect2"><a href="#components.optional.none">11.5.3. Files affecting nothing at all</a></span></dt> 187<dt><span class="sect2"><a href="#components.optional.none">11.5.3. Files affecting nothing at all</a></span></dt>
188</dl></dd> 188</dl></dd>
189<dt><span class="sect1"><a href="#work-dir">11.6. <code class="filename">work*</code></a></span></dt> 189<dt><span class="sect1"><a href="#work-dir">11.6. <code class="filename">work*</code></a></span></dt>
190<dt><span class="sect1"><a href="#files-dir">11.7. <code class="filename">files/*</code></a></span></dt> 190<dt><span class="sect1"><a href="#files-dir">11.7. <code class="filename">files/*</code></a></span></dt>
191</dl></dd> 191</dl></dd>
192<dt><span class="chapter"><a href="#makefile">12. Programming in <code class="filename">Makefile</code>s</a></span></dt> 192<dt><span class="chapter"><a href="#makefile">12. Programming in <code class="filename">Makefile</code>s</a></span></dt>
193<dd><dl> 193<dd><dl>
194<dt><span class="sect1"><a href="#makefile.style">12.1. Caveats</a></span></dt> 194<dt><span class="sect1"><a href="#makefile.style">12.1. Caveats</a></span></dt>
195<dt><span class="sect1"><a href="#makefile.variables">12.2. <code class="filename">Makefile</code> variables</a></span></dt> 195<dt><span class="sect1"><a href="#makefile.variables">12.2. <code class="filename">Makefile</code> variables</a></span></dt>
196<dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">12.2.1. Naming conventions</a></span></dt></dl></dd> 196<dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">12.2.1. Naming conventions</a></span></dt></dl></dd>
197<dt><span class="sect1"><a href="#makefile.code">12.3. Code snippets</a></span></dt> 197<dt><span class="sect1"><a href="#makefile.code">12.3. Code snippets</a></span></dt>
198<dd><dl> 198<dd><dl>
199<dt><span class="sect2"><a href="#adding-to-list">12.3.1. Adding things to a list</a></span></dt> 199<dt><span class="sect2"><a href="#adding-to-list">12.3.1. Adding things to a list</a></span></dt>
200<dt><span class="sect2"><a href="#echo-literal">12.3.2. Echoing a string exacty as-is</a></span></dt> 200<dt><span class="sect2"><a href="#echo-literal">12.3.2. Echoing a string exactly as-is</a></span></dt>
201<dt><span class="sect2"><a href="#cflags-gnu-configure">12.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt> 201<dt><span class="sect2"><a href="#cflags-gnu-configure">12.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt>
202<dt><span class="sect2"><a href="#empty-variables">12.3.4. Handling possibly empty variables</a></span></dt> 202<dt><span class="sect2"><a href="#empty-variables">12.3.4. Handling possibly empty variables</a></span></dt>
203</dl></dd> 203</dl></dd>
204</dl></dd> 204</dl></dd>
205<dt><span class="chapter"><a href="#plist">13. PLIST issues</a></span></dt> 205<dt><span class="chapter"><a href="#plist">13. PLIST issues</a></span></dt>
206<dd><dl> 206<dd><dl>
207<dt><span class="sect1"><a href="#rcs-id">13.1. RCS ID</a></span></dt> 207<dt><span class="sect1"><a href="#rcs-id">13.1. RCS ID</a></span></dt>
208<dt><span class="sect1"><a href="#automatic-plist-generation">13.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> 208<dt><span class="sect1"><a href="#automatic-plist-generation">13.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt>
209<dt><span class="sect1"><a href="#print-PLIST">13.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt> 209<dt><span class="sect1"><a href="#print-PLIST">13.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt>
210<dt><span class="sect1"><a href="#plist.misc">13.4. Variable substitution in PLIST</a></span></dt> 210<dt><span class="sect1"><a href="#plist.misc">13.4. Variable substitution in PLIST</a></span></dt>
211<dt><span class="sect1"><a href="#manpage-compression">13.5. Man page compression</a></span></dt> 211<dt><span class="sect1"><a href="#manpage-compression">13.5. Man page compression</a></span></dt>
212<dt><span class="sect1"><a href="#using-PLIST_SRC">13.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt> 212<dt><span class="sect1"><a href="#using-PLIST_SRC">13.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt>
213<dt><span class="sect1"><a href="#platform-specific-plist">13.7. Platform-specific and differing PLISTs</a></span></dt> 213<dt><span class="sect1"><a href="#platform-specific-plist">13.7. Platform-specific and differing PLISTs</a></span></dt>
@@ -2801,27 +2801,27 @@ anymore, you can remove that file and ru @@ -2801,27 +2801,27 @@ anymore, you can remove that file and ru
2801<dt><span class="sect2"><a href="#components.optional.none">11.5.3. Files affecting nothing at all</a></span></dt> 2801<dt><span class="sect2"><a href="#components.optional.none">11.5.3. Files affecting nothing at all</a></span></dt>
2802</dl></dd> 2802</dl></dd>
2803<dt><span class="sect1"><a href="#work-dir">11.6. <code class="filename">work*</code></a></span></dt> 2803<dt><span class="sect1"><a href="#work-dir">11.6. <code class="filename">work*</code></a></span></dt>
2804<dt><span class="sect1"><a href="#files-dir">11.7. <code class="filename">files/*</code></a></span></dt> 2804<dt><span class="sect1"><a href="#files-dir">11.7. <code class="filename">files/*</code></a></span></dt>
2805</dl></dd> 2805</dl></dd>
2806<dt><span class="chapter"><a href="#makefile">12. Programming in <code class="filename">Makefile</code>s</a></span></dt> 2806<dt><span class="chapter"><a href="#makefile">12. Programming in <code class="filename">Makefile</code>s</a></span></dt>
2807<dd><dl> 2807<dd><dl>
2808<dt><span class="sect1"><a href="#makefile.style">12.1. Caveats</a></span></dt> 2808<dt><span class="sect1"><a href="#makefile.style">12.1. Caveats</a></span></dt>
2809<dt><span class="sect1"><a href="#makefile.variables">12.2. <code class="filename">Makefile</code> variables</a></span></dt> 2809<dt><span class="sect1"><a href="#makefile.variables">12.2. <code class="filename">Makefile</code> variables</a></span></dt>
2810<dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">12.2.1. Naming conventions</a></span></dt></dl></dd> 2810<dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">12.2.1. Naming conventions</a></span></dt></dl></dd>
2811<dt><span class="sect1"><a href="#makefile.code">12.3. Code snippets</a></span></dt> 2811<dt><span class="sect1"><a href="#makefile.code">12.3. Code snippets</a></span></dt>
2812<dd><dl> 2812<dd><dl>
2813<dt><span class="sect2"><a href="#adding-to-list">12.3.1. Adding things to a list</a></span></dt> 2813<dt><span class="sect2"><a href="#adding-to-list">12.3.1. Adding things to a list</a></span></dt>
2814<dt><span class="sect2"><a href="#echo-literal">12.3.2. Echoing a string exacty as-is</a></span></dt> 2814<dt><span class="sect2"><a href="#echo-literal">12.3.2. Echoing a string exactly as-is</a></span></dt>
2815<dt><span class="sect2"><a href="#cflags-gnu-configure">12.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt> 2815<dt><span class="sect2"><a href="#cflags-gnu-configure">12.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt>
2816<dt><span class="sect2"><a href="#empty-variables">12.3.4. Handling possibly empty variables</a></span></dt> 2816<dt><span class="sect2"><a href="#empty-variables">12.3.4. Handling possibly empty variables</a></span></dt>
2817</dl></dd> 2817</dl></dd>
2818</dl></dd> 2818</dl></dd>
2819<dt><span class="chapter"><a href="#plist">13. PLIST issues</a></span></dt> 2819<dt><span class="chapter"><a href="#plist">13. PLIST issues</a></span></dt>
2820<dd><dl> 2820<dd><dl>
2821<dt><span class="sect1"><a href="#rcs-id">13.1. RCS ID</a></span></dt> 2821<dt><span class="sect1"><a href="#rcs-id">13.1. RCS ID</a></span></dt>
2822<dt><span class="sect1"><a href="#automatic-plist-generation">13.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> 2822<dt><span class="sect1"><a href="#automatic-plist-generation">13.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt>
2823<dt><span class="sect1"><a href="#print-PLIST">13.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt> 2823<dt><span class="sect1"><a href="#print-PLIST">13.3. Tweaking output of <span class="command"><strong>make print-PLIST</strong></span></a></span></dt>
2824<dt><span class="sect1"><a href="#plist.misc">13.4. Variable substitution in PLIST</a></span></dt> 2824<dt><span class="sect1"><a href="#plist.misc">13.4. Variable substitution in PLIST</a></span></dt>
2825<dt><span class="sect1"><a href="#manpage-compression">13.5. Man page compression</a></span></dt> 2825<dt><span class="sect1"><a href="#manpage-compression">13.5. Man page compression</a></span></dt>
2826<dt><span class="sect1"><a href="#using-PLIST_SRC">13.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt> 2826<dt><span class="sect1"><a href="#using-PLIST_SRC">13.6. Changing PLIST source with <code class="varname">PLIST_SRC</code></a></span></dt>
2827<dt><span class="sect1"><a href="#platform-specific-plist">13.7. Platform-specific and differing PLISTs</a></span></dt> 2827<dt><span class="sect1"><a href="#platform-specific-plist">13.7. Platform-specific and differing PLISTs</a></span></dt>
@@ -4004,27 +4004,27 @@ FILESDIR=${.CURDIR}/../xemacs/files @@ -4004,27 +4004,27 @@ FILESDIR=${.CURDIR}/../xemacs/files
4004</div> 4004</div>
4005<div class="chapter"> 4005<div class="chapter">
4006<div class="titlepage"><div><div><h2 class="title"> 4006<div class="titlepage"><div><div><h2 class="title">
4007<a name="makefile"></a>Chapter 12. Programming in <code class="filename">Makefile</code>s</h2></div></div></div> 4007<a name="makefile"></a>Chapter 12. Programming in <code class="filename">Makefile</code>s</h2></div></div></div>
4008<div class="toc"> 4008<div class="toc">
4009<p><b>Table of Contents</b></p> 4009<p><b>Table of Contents</b></p>
4010<dl class="toc"> 4010<dl class="toc">
4011<dt><span class="sect1"><a href="#makefile.style">12.1. Caveats</a></span></dt> 4011<dt><span class="sect1"><a href="#makefile.style">12.1. Caveats</a></span></dt>
4012<dt><span class="sect1"><a href="#makefile.variables">12.2. <code class="filename">Makefile</code> variables</a></span></dt> 4012<dt><span class="sect1"><a href="#makefile.variables">12.2. <code class="filename">Makefile</code> variables</a></span></dt>
4013<dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">12.2.1. Naming conventions</a></span></dt></dl></dd> 4013<dd><dl><dt><span class="sect2"><a href="#makefile.variables.names">12.2.1. Naming conventions</a></span></dt></dl></dd>
4014<dt><span class="sect1"><a href="#makefile.code">12.3. Code snippets</a></span></dt> 4014<dt><span class="sect1"><a href="#makefile.code">12.3. Code snippets</a></span></dt>
4015<dd><dl> 4015<dd><dl>
4016<dt><span class="sect2"><a href="#adding-to-list">12.3.1. Adding things to a list</a></span></dt> 4016<dt><span class="sect2"><a href="#adding-to-list">12.3.1. Adding things to a list</a></span></dt>
4017<dt><span class="sect2"><a href="#echo-literal">12.3.2. Echoing a string exacty as-is</a></span></dt> 4017<dt><span class="sect2"><a href="#echo-literal">12.3.2. Echoing a string exactly as-is</a></span></dt>
4018<dt><span class="sect2"><a href="#cflags-gnu-configure">12.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt> 4018<dt><span class="sect2"><a href="#cflags-gnu-configure">12.3.3. Passing <code class="varname">CFLAGS</code> to GNU configure scripts</a></span></dt>
4019<dt><span class="sect2"><a href="#empty-variables">12.3.4. Handling possibly empty variables</a></span></dt> 4019<dt><span class="sect2"><a href="#empty-variables">12.3.4. Handling possibly empty variables</a></span></dt>
4020</dl></dd> 4020</dl></dd>
4021</dl> 4021</dl>
4022</div> 4022</div>
4023<p>Pkgsrc consists of many <code class="filename">Makefile</code> fragments, 4023<p>Pkgsrc consists of many <code class="filename">Makefile</code> fragments,
4024 each of which forms a well-defined part of the pkgsrc system. Using 4024 each of which forms a well-defined part of the pkgsrc system. Using
4025 the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> system as a programming language for a big system 4025 the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> system as a programming language for a big system
4026 like pkgsrc requires some discipline to keep the code correct and 4026 like pkgsrc requires some discipline to keep the code correct and
4027 understandable.</p> 4027 understandable.</p>
4028<p>The basic ingredients for <code class="filename">Makefile</code> 4028<p>The basic ingredients for <code class="filename">Makefile</code>
4029 programming are variables (which are actually macros) and shell 4029 programming are variables (which are actually macros) and shell
4030 commands. Among these shell commands may even be more complex ones 4030 commands. Among these shell commands may even be more complex ones
@@ -4144,27 +4144,27 @@ modifier.

 @@ -4144,27 +4144,27 @@ modifier.

4144<p>When adding another list to a list (example 2), it must not be 4144<p>When adding another list to a list (example 2), it must not be
4145quoted, since its elements are already quoted.</p> 4145quoted, since its elements are already quoted.</p>
4146<pre class="programlisting"> 4146<pre class="programlisting">
4147STRING= foo * bar `date` 4147STRING= foo * bar `date`
4148LIST= # empty 4148LIST= # empty
4149ANOTHER_LIST= a=b c=d 4149ANOTHER_LIST= a=b c=d
4150 4150
4151LIST+= ${STRING:Q} # 1 4151LIST+= ${STRING:Q} # 1
4152LIST+= ${ANOTHER_LIST} # 2 4152LIST+= ${ANOTHER_LIST} # 2
4153</pre> 4153</pre>
4154</div> 4154</div>
4155<div class="sect2"> 4155<div class="sect2">
4156<div class="titlepage"><div><div><h3 class="title"> 4156<div class="titlepage"><div><div><h3 class="title">
4157<a name="echo-literal"></a>12.3.2. Echoing a string exacty as-is</h3></div></div></div> 4157<a name="echo-literal"></a>12.3.2. Echoing a string exactly as-is</h3></div></div></div>
4158<p>Echoing a string containing special characters needs special 4158<p>Echoing a string containing special characters needs special
4159work.</p> 4159work.</p>
4160<pre class="programlisting"> 4160<pre class="programlisting">
4161STRING= foo bar &lt; &gt; * `date` $$HOME ' " 4161STRING= foo bar &lt; &gt; * `date` $$HOME ' "
4162EXAMPLE_ENV= string=${STRING:Q} x=multiple\ quoted\ words 4162EXAMPLE_ENV= string=${STRING:Q} x=multiple\ quoted\ words
4163 4163
4164all: 4164all:
4165 echo ${STRING} # 1 4165 echo ${STRING} # 1
4166 echo ${STRING:Q} # 2 4166 echo ${STRING:Q} # 2
4167 printf '%s\n' ${STRING:Q}'' # 3 4167 printf '%s\n' ${STRING:Q}'' # 3
4168 env ${EXAMPLE_ENV} sh -c 'echo "$$string"; echo "$$x"' # 4 4168 env ${EXAMPLE_ENV} sh -c 'echo "$$string"; echo "$$x"' # 4
4169</pre> 4169</pre>
4170<p>Example 1 leads to a syntax error in the shell, as the characters 4170<p>Example 1 leads to a syntax error in the shell, as the characters

cvs diff -r1.227 -r1.228 pkgsrc/doc/pkgsrc.txt (expand / switch to unified diff)

--- pkgsrc/doc/pkgsrc.txt 2016/11/15 13:51:07 1.227
+++ pkgsrc/doc/pkgsrc.txt 2016/12/08 00:44:39 1.228
@@ -174,27 +174,27 @@ II. The pkgsrc developer's guide @@ -174,27 +174,27 @@ II. The pkgsrc developer's guide
174 11.6. work* 174 11.6. work*
175 11.7. files/* 175 11.7. files/*
176 176
177 12. Programming in Makefiles 177 12. Programming in Makefiles
178 178
179 12.1. Caveats 179 12.1. Caveats
180 12.2. Makefile variables 180 12.2. Makefile variables
181 181
182 12.2.1. Naming conventions 182 12.2.1. Naming conventions
183 183
184 12.3. Code snippets 184 12.3. Code snippets
185 185
186 12.3.1. Adding things to a list 186 12.3.1. Adding things to a list
187 12.3.2. Echoing a string exacty as-is 187 12.3.2. Echoing a string exactly as-is
188 12.3.3. Passing CFLAGS to GNU configure scripts 188 12.3.3. Passing CFLAGS to GNU configure scripts
189 12.3.4. Handling possibly empty variables 189 12.3.4. Handling possibly empty variables
190 190
191 13. PLIST issues 191 13. PLIST issues
192 192
193 13.1. RCS ID 193 13.1. RCS ID
194 13.2. Semi-automatic PLIST generation 194 13.2. Semi-automatic PLIST generation
195 13.3. Tweaking output of make print-PLIST 195 13.3. Tweaking output of make print-PLIST
196 13.4. Variable substitution in PLIST 196 13.4. Variable substitution in PLIST
197 13.5. Man page compression 197 13.5. Man page compression
198 13.6. Changing PLIST source with PLIST_SRC 198 13.6. Changing PLIST source with PLIST_SRC
199 13.7. Platform-specific and differing PLISTs 199 13.7. Platform-specific and differing PLISTs
200 13.8. Build-specific PLISTs 200 13.8. Build-specific PLISTs
@@ -2389,27 +2389,27 @@ Table of Contents @@ -2389,27 +2389,27 @@ Table of Contents
2389 11.6. work* 2389 11.6. work*
2390 11.7. files/* 2390 11.7. files/*
2391 2391
239212. Programming in Makefiles 239212. Programming in Makefiles
2393 2393
2394 12.1. Caveats 2394 12.1. Caveats
2395 12.2. Makefile variables 2395 12.2. Makefile variables
2396 2396
2397 12.2.1. Naming conventions 2397 12.2.1. Naming conventions
2398 2398
2399 12.3. Code snippets 2399 12.3. Code snippets
2400 2400
2401 12.3.1. Adding things to a list 2401 12.3.1. Adding things to a list
2402 12.3.2. Echoing a string exacty as-is 2402 12.3.2. Echoing a string exactly as-is
2403 12.3.3. Passing CFLAGS to GNU configure scripts 2403 12.3.3. Passing CFLAGS to GNU configure scripts
2404 12.3.4. Handling possibly empty variables 2404 12.3.4. Handling possibly empty variables
2405 2405
240613. PLIST issues 240613. PLIST issues
2407 2407
2408 13.1. RCS ID 2408 13.1. RCS ID
2409 13.2. Semi-automatic PLIST generation 2409 13.2. Semi-automatic PLIST generation
2410 13.3. Tweaking output of make print-PLIST 2410 13.3. Tweaking output of make print-PLIST
2411 13.4. Variable substitution in PLIST 2411 13.4. Variable substitution in PLIST
2412 13.5. Man page compression 2412 13.5. Man page compression
2413 13.6. Changing PLIST source with PLIST_SRC 2413 13.6. Changing PLIST source with PLIST_SRC
2414 13.7. Platform-specific and differing PLISTs 2414 13.7. Platform-specific and differing PLISTs
2415 13.8. Build-specific PLISTs 2415 13.8. Build-specific PLISTs
@@ -3374,27 +3374,27 @@ FILESDIR=${.CURDIR}/../xemacs/files @@ -3374,27 +3374,27 @@ FILESDIR=${.CURDIR}/../xemacs/files
3374 3374
3375Chapter 12. Programming in Makefiles 3375Chapter 12. Programming in Makefiles
3376 3376
3377Table of Contents 3377Table of Contents
3378 3378
337912.1. Caveats 337912.1. Caveats
338012.2. Makefile variables 338012.2. Makefile variables
3381 3381
3382 12.2.1. Naming conventions 3382 12.2.1. Naming conventions
3383 3383
338412.3. Code snippets 338412.3. Code snippets
3385 3385
3386 12.3.1. Adding things to a list 3386 12.3.1. Adding things to a list
3387 12.3.2. Echoing a string exacty as-is 3387 12.3.2. Echoing a string exactly as-is
3388 12.3.3. Passing CFLAGS to GNU configure scripts 3388 12.3.3. Passing CFLAGS to GNU configure scripts
3389 12.3.4. Handling possibly empty variables 3389 12.3.4. Handling possibly empty variables
3390 3390
3391Pkgsrc consists of many Makefile fragments, each of which forms a well-defined 3391Pkgsrc consists of many Makefile fragments, each of which forms a well-defined
3392part of the pkgsrc system. Using the make(1) system as a programming language 3392part of the pkgsrc system. Using the make(1) system as a programming language
3393for a big system like pkgsrc requires some discipline to keep the code correct 3393for a big system like pkgsrc requires some discipline to keep the code correct
3394and understandable. 3394and understandable.
3395 3395
3396The basic ingredients for Makefile programming are variables (which are 3396The basic ingredients for Makefile programming are variables (which are
3397actually macros) and shell commands. Among these shell commands may even be 3397actually macros) and shell commands. Among these shell commands may even be
3398more complex ones like awk(1) programs. To make sure that every shell command 3398more complex ones like awk(1) programs. To make sure that every shell command
3399runs as intended it is necessary to quote all variables correctly when they are 3399runs as intended it is necessary to quote all variables correctly when they are
3400used. 3400used.
@@ -3490,27 +3490,27 @@ Strings and two types of lists. @@ -3490,27 +3490,27 @@ Strings and two types of lists.
3490When adding a string that possibly contains whitespace or quotes to a list 3490When adding a string that possibly contains whitespace or quotes to a list
3491(example 1), it must be quoted using the :Q modifier. 3491(example 1), it must be quoted using the :Q modifier.
3492 3492
3493When adding another list to a list (example 2), it must not be quoted, since 3493When adding another list to a list (example 2), it must not be quoted, since
3494its elements are already quoted. 3494its elements are already quoted.
3495 3495
3496STRING= foo * bar `date` 3496STRING= foo * bar `date`
3497LIST= # empty 3497LIST= # empty
3498ANOTHER_LIST= a=b c=d 3498ANOTHER_LIST= a=b c=d
3499 3499
3500LIST+= ${STRING:Q} # 1 3500LIST+= ${STRING:Q} # 1
3501LIST+= ${ANOTHER_LIST} # 2 3501LIST+= ${ANOTHER_LIST} # 2
3502 3502
350312.3.2. Echoing a string exacty as-is 350312.3.2. Echoing a string exactly as-is
3504 3504
3505Echoing a string containing special characters needs special work. 3505Echoing a string containing special characters needs special work.
3506 3506
3507STRING= foo bar < > * `date` $$HOME ' " 3507STRING= foo bar < > * `date` $$HOME ' "
3508EXAMPLE_ENV= string=${STRING:Q} x=multiple\ quoted\ words 3508EXAMPLE_ENV= string=${STRING:Q} x=multiple\ quoted\ words
3509 3509
3510all: 3510all:
3511 echo ${STRING} # 1 3511 echo ${STRING} # 1
3512 echo ${STRING:Q} # 2 3512 echo ${STRING:Q} # 2
3513 printf '%s\n' ${STRING:Q}'' # 3 3513 printf '%s\n' ${STRING:Q}'' # 3
3514 env ${EXAMPLE_ENV} sh -c 'echo "$$string"; echo "$$x"' # 4 3514 env ${EXAMPLE_ENV} sh -c 'echo "$$string"; echo "$$x"' # 4
3515 3515
3516Example 1 leads to a syntax error in the shell, as the characters are just 3516Example 1 leads to a syntax error in the shell, as the characters are just

cvs diff -r1.26 -r1.27 pkgsrc/doc/guide/files/makefile.xml (expand / switch to unified diff)

--- pkgsrc/doc/guide/files/makefile.xml 2016/06/11 19:54:44 1.26
+++ pkgsrc/doc/guide/files/makefile.xml 2016/12/08 00:44:40 1.27
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1<!-- $NetBSD: makefile.xml,v 1.26 2016/06/11 19:54:44 rillig Exp $ --> 1<!-- $NetBSD: makefile.xml,v 1.27 2016/12/08 00:44:40 yyamano Exp $ -->
2 2
3<chapter id="makefile"> <?dbhtml filename="makefile.html"?> 3<chapter id="makefile"> <?dbhtml filename="makefile.html"?>
4 <title>Programming in <filename>Makefile</filename>s</title> 4 <title>Programming in <filename>Makefile</filename>s</title>
5 5
6 <para>Pkgsrc consists of many <filename>Makefile</filename> fragments, 6 <para>Pkgsrc consists of many <filename>Makefile</filename> fragments,
7 each of which forms a well-defined part of the pkgsrc system. Using 7 each of which forms a well-defined part of the pkgsrc system. Using
8 the &man.make.1; system as a programming language for a big system 8 the &man.make.1; system as a programming language for a big system
9 like pkgsrc requires some discipline to keep the code correct and 9 like pkgsrc requires some discipline to keep the code correct and
10 understandable.</para> 10 understandable.</para>
11 11
12 <para>The basic ingredients for <filename>Makefile</filename> 12 <para>The basic ingredients for <filename>Makefile</filename>
13 programming are variables (which are actually macros) and shell 13 programming are variables (which are actually macros) and shell
14 commands. Among these shell commands may even be more complex ones 14 commands. Among these shell commands may even be more complex ones
@@ -154,27 +154,27 @@ quoted, since its elements are already q @@ -154,27 +154,27 @@ quoted, since its elements are already q
154 154
155<programlisting> 155<programlisting>
156STRING= foo * bar `date` 156STRING= foo * bar `date`
157LIST= # empty 157LIST= # empty
158ANOTHER_LIST= a=b c=d 158ANOTHER_LIST= a=b c=d
159 159
160LIST+= ${STRING:Q} # 1 160LIST+= ${STRING:Q} # 1
161LIST+= ${ANOTHER_LIST} # 2 161LIST+= ${ANOTHER_LIST} # 2
162</programlisting> 162</programlisting>
163 163
164</sect2> 164</sect2>
165 165
166<sect2 id="echo-literal"> 166<sect2 id="echo-literal">
167<title>Echoing a string exacty as-is</title> 167<title>Echoing a string exactly as-is</title>
168 168
169<para>Echoing a string containing special characters needs special 169<para>Echoing a string containing special characters needs special
170work.</para> 170work.</para>
171 171
172<programlisting> 172<programlisting>
173STRING= foo bar &lt; &gt; * `date` $$HOME ' " 173STRING= foo bar &lt; &gt; * `date` $$HOME ' "
174EXAMPLE_ENV= string=${STRING:Q} x=multiple\ quoted\ words 174EXAMPLE_ENV= string=${STRING:Q} x=multiple\ quoted\ words
175 175
176all: 176all:
177 echo ${STRING} # 1 177 echo ${STRING} # 1
178 echo ${STRING:Q} # 2 178 echo ${STRING:Q} # 2
179 printf '%s\n' ${STRING:Q}'' # 3 179 printf '%s\n' ${STRING:Q}'' # 3
180 env ${EXAMPLE_ENV} sh -c 'echo "$$string"; echo "$$x"' # 4 180 env ${EXAMPLE_ENV} sh -c 'echo "$$string"; echo "$$x"' # 4