• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

The MinGW.org Windows System Libraries


コミットメタ情報

リビジョン40713b7cbd4d766a71a78c6b3cdd79a6491cdf96 (tree)
日時2016-04-14 05:39:45
作者Keith Marshall <keithmarshall@user...>
コミッターKeith Marshall

ログメッセージ

Generalize procedure for installing manpages.

--HG--
rename : mingwrt/man/dirname.man => mingwrt/man/dirname.3.man

変更サマリ

差分

--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,21 @@
1+2016-04-13 Keith Marshall <keithmarshall@users.sourceforge.net>
2+
3+ Generalize procedure for installing manpages.
4+
5+ * man/dirname.man: Rename it as...
6+ * man/dirname.3.man: ...this, with inherent MANSECT specification.
7+ (TH): Use %PAGEREF% substitution for NAME, MANSECT, and DATE.
8+ (MS-Windows): Do not append \[tm]; it doesn't render well in Windows
9+ console. Further, correct typos; some syntactic adjustments.
10+
11+ * Makefile.in (%:%.man): New rule; define it.
12+ (%.mancopy, %.mancopy-recursive): New rules; define and use with...
13+ (reference_manpage): ...this new macro, defining it to map...
14+ (dirname.3.man): ...this as the reference source file for both of...
15+ (basename.3, dirname.3): ...these installed manpages.
16+ (format_manpage): Add MANSECT and DATE to expansion of...
17+ (%PAGEREF%): ...this sed substitution pattern.
18+
119 2016-04-12 Keith Marshall <keithmarshall@users.sourceforge.net>
220
321 Update several incorrectly attributed header files.
--- a/mingwrt/Makefile.in
+++ b/mingwrt/Makefile.in
@@ -733,21 +733,31 @@ install-%-dll-files:
733733
734734 # Install manpages.
735735 #
736-install-man install-manpages: install-mingwrt-manpages
737-format_manpage = sed "s/%PAGEREF%/`echo $1 | tr a-z A-Z` $2/"
738-
739736 vpath %.man ${mingwrt_srcdir}/man
740-basename.$(man3ext) dirname.$(man3ext): %.$(man3ext): dirname.man
741- $(call format_manpage,$*,$(man3ext)) $< > $@
742-
743-mingwrt-man$(man3ext): basename.$(man3ext) dirname.$(man3ext)
744-
737+install-man install-manpages: install-mingwrt-manpages
738+mingwrt-man$(man3ext): $(addsuffix .$(man3ext),basename dirname)
745739 install-mingwrt-manpages: mandir mingwrt-man3
740+
746741 mingwrt-man%:
747742 $(call mkinstalldirs,,${man$*dir})
748743 $(call INSTALL_DATA,$^,${man$*dir})
749744 $(RM) $^
750745
746+%: %.man
747+ $(call format_manpage,$(basename $*),$(suffix $*),$<) $< > $@
748+
749+format_manpage = sed \
750+ -e "s/%PAGEREF%/`echo $1 | tr a-z A-Z` $(2:.%=%) `date -r $3 +%d-%b-%Y`/"
751+
752+basename.$(man3ext): export reference_manpage = dirname.$(man3ext).man
753+basename.$(man3ext): %: %.mancopy-recursive
754+
755+%.mancopy-recursive:
756+ $(MAKE) --no-print-directory $*.mancopy
757+
758+%.mancopy: $(reference_manpage)
759+ $(call format_manpage,$(basename $*),$(suffix $*),$<) $< > $*
760+
751761
752762 # Undo Installation
753763 # -----------------
--- a/mingwrt/man/dirname.man
+++ b/mingwrt/man/dirname.3.man
@@ -1,9 +1,10 @@
1-.\" t
2-.TH DIRNAME 3 04-Jan-2007 MinGW "Programmer's Reference Manual"
1+'\" t
2+.\" vim: ft=nroff
3+.TH %PAGEREF% MinGW "Programmer's Reference Manual"
34 .
45 .SH NAME
56 .
6-.BR dirname ,\0 basename
7+.BR \%dirname ,\0 \%basename
78 \- parse path name components
89 .
910 .
@@ -24,9 +25,9 @@
2425 .SH DESCRIPTION
2526 .
2627 The
27-.B dirname
28+.BR \%dirname ()
2829 and
29-.B basename
30+.BR \%basename ()
3031 functions parse a null\-terminated path name string,
3132 and split it into its
3233 .B directory name
@@ -37,7 +38,7 @@ Splitting is performed on the basis of the location of the
3738 .B directory separator
3839 characters,
3940 which,
40-for this MS\-Windows(\(tm) implementation,
41+for this MS\-Windows implementation,
4142 are the characters
4243 .RB \(dq / \(dq
4344 and
@@ -52,7 +53,7 @@ is a colon
5253 .RB (\(dq : \(dq),
5354 the first two characters of
5455 .I path
55-are interpreted as an MS\-Windows(\(tm) drive designator,
56+are interpreted as an MS\-Windows drive designator,
5657 which will be included in the
5758 .B directory name
5859 component of
@@ -63,48 +64,48 @@ component.
6364 .
6465 .PP
6566 In normal usage,
66-.B dirname
67+.BR \%dirname ()
6768 returns a pointer to a string representing the path name component of
6869 .IR path ,
6970 up to but not including the rightmost directory separator,
7071 while
71-.B basename
72+.BR \%basename ()
7273 returns a pointer to the component following this separator.
7374 Any trailing directory separators present in
7475 .I path
7576 are disregarded,
7677 when determining the rightmost separator,
7778 and, in the case of the return value from
78-.BR dirname ,
79+.BR \%dirname (),
7980 any internal sequences of recurring separator characters
8081 are each reduced to a single such character.
8182 .
8283 .PP
8384 If
8485 .I path
85-contains no MS\-Windows(\(tm) drive designator,
86+contains no MS\-Windows drive designator,
8687 and no directory separator character,
8788 then
88-.B dirname
89+.BR \%dirname ()
8990 returns the string
9091 .RB \(dq . \(dq,
9192 and
92-.B basename
93+.BR \%basename ()
9394 returns a copy of
9495 .IR path.
9596 If
9697 .I path
97-does commence with an MS\-Windows(\(tm) drive designator,
98+does commence with an MS\-Windows drive designator,
9899 but contains no directory separators,
99100 then
100-.B dirname
101+.BR \%dirname ()
101102 returns the string
102103 .RB \(dq d:. \(dq,
103104 where
104105 .RB \(dq d: \(dq
105106 represents the drive designator,
106107 while
107-.B basename
108+.BR \%basename ()
108109 returns a copy of
109110 .IR path ,
110111 with its initial two characters,
@@ -117,9 +118,9 @@ If
117118 is a NULL pointer,
118119 or is a pointer to an empty string,
119120 then both
120-.B dirname
121+.BR \%dirname ()
121122 and
122-.B basename
123+.BR \%basename ()
123124 return the string
124125 .RB \(dq . \(dq.
125126 .
@@ -131,9 +132,9 @@ is the string
131132 or the string
132133 .RB \(dq \e \(dq,
133134 both
134-.B dirname
135+.BR \%dirname ()
135136 and
136-.B basename
137+.BR \%basename ()
137138 return the string
138139 .RB \(dq / \(dq,
139140 or the string
@@ -148,15 +149,15 @@ commences with
148149 two directory separator characters,
149150 which must be similar,
150151 then
151-.B dirname
152+.BR \%dirname ()
152153 will preserve these two characters in the returned path name.
153154 This construct does not affect the string returned by
154-.BR basename ,
155+.BR \%basename (),
155156 neither is this behaviour replicated by
156-.BR dirname ,
157+.BR \%dirname (),
157158 if
158159 .I path
159-includes an MS\-Windows(\(tm) drive designator.
160+includes an MS\-Windows drive designator.
160161 .
161162 .PP
162163 In the special case,
@@ -165,13 +166,13 @@ where
165166 is specified as
166167 .I exactly
167168 two identical directory separator characters,
168-with no MS\-Windows(\(tm) drive designator,
169+with no MS\-Windows drive designator,
169170 and no following path name,
170-.B dirname
171+.BR \%dirname ()
171172 returns
172173 .I path
173174 unchanged;
174-.B basename
175+.BR \%basename ()
175176 normalises the return string to only a single character,
176177 either
177178 .RB \(dq / \(dq
@@ -182,27 +183,27 @@ matching the characters used to specify
182183 .
183184 .PP
184185 Concatenating the string returned by
185-.BR dirname ,
186+.BR \%dirname (),
186187 a
187188 .RB \(dq / \(dq
188189 or a
189190 .RB \(dq \e \(dq,
190191 and the string returned by
191-.B basename
192+.BR \%basename ()
192193 yields a complete path name.
193194 .
194195 .PP
195196 The
196-.B dirname
197+.BR \%dirname ()
197198 and
198-.B basename
199+.BR \%basename ()
199200 functions conform generally to SUSv3,
200201 extended to accommodate the handling of
201202 .RB \(dq / \(dq
202203 and
203204 .RB \(dq \e \(dq
204205 as alternative directory separator characters,
205-and also to accommodate the likelihood of MS\-Windows(\(tm)
206+and also to accommodate the likelihood of MS\-Windows
206207 drive designators appearing in any path name specification.
207208 The example,
208209 which follows,
@@ -213,9 +214,9 @@ and also the effects of the extended behaviour.
213214 .SH EXAMPLE
214215 .
215216 To verify the behaviour of the
216-.B dirname
217+.BR \%dirname ()
217218 and
218-.B basename
219+.BR \%basename ()
219220 functions,
220221 the test program defines the following function:\(em
221222 .
@@ -241,16 +242,16 @@ void result( char *path )
241242 .RE
242243 .PP
243244 This illustrates the correct use of the
244-.B dirname
245+.BR \%dirname ()
245246 and the
246-.B basename
247+.BR \%basename ()
247248 functions,
248249 with copies of the original
249250 .I path
250251 string being passed in the function calls.
251252 Note that the return values from each function are used immediately,
252253 in the
253-.B printf
254+.BR printf ()
254255 call,
255256 and the temporary copies of
256257 .I path
@@ -260,9 +261,9 @@ before these go out of scope.
260261 .
261262 .PP
262263 Calling this example function illustrates the effect of each of the
263-.B dirname
264+.BR \%dirname ()
264265 and
265-.B basename
266+.BR \%basename ()
266267 functions,
267268 for various values of
268269 .IR path .
@@ -290,7 +291,7 @@ lw(15n) lw(10n) lw(10n).
290291 .
291292 .PP
292293 Similarly,
293-for the case where path names are expressed using the MS\-Windows(\(tm)
294+for the case where path names are expressed using the MS\-Windows
294295 .RB \(dq \e \(dq
295296 directory separator notation,
296297 calling the example function displays:\(em
@@ -315,7 +316,7 @@ lw(15n) lw(10n) lw(10n).
315316 .
316317 .PP
317318 and,
318-when an MS\-Windows(\(tm) drive designator is also specified,
319+when an MS\-Windows drive designator is also specified,
319320 this becomes:\(em
320321 .RS
321322 .TS
@@ -344,7 +345,7 @@ the special handling of path names which begin with
344345 two directory separator characters,
345346 and also that this special handling is suppressed
346347 when these two characters are dissimilar,
347-or when an MS\-Windows(\(tm) drive designator is specified:\(em
348+or when an MS\-Windows drive designator is specified:\(em
348349 .RS
349350 .TS
350351 tab(!);
@@ -369,7 +370,7 @@ lw(15n) lw(10n) lw(10n).
369370 .SH RETURN VALUE
370371 .
371372 The
372-.B dirname
373+.BR \%dirname ()
373374 function returns a pointer to a null terminated string,
374375 which represents the directory path component of the passed
375376 .I path
@@ -380,7 +381,7 @@ normalised to a single separator at each level of directory nesting.
380381 .
381382 .PP
382383 The
383-.B basename
384+.BR \%basename ()
384385 function
385386 returns a pointer to a null terminated string,
386387 which represents the rightmost element of the passed
@@ -389,14 +390,14 @@ string,
389390 with all trailing directory separator characters removed.
390391 .
391392 .PP
392-If any MS\-Windows(\(tm) drive designator is specified in the input
393+If any MS\-Windows drive designator is specified in the input
393394 .I path
394395 string,
395396 it is included in the return value of the
396-.B dirname
397+.BR \%dirname ()
397398 function,
398399 but not in that of the
399-.B basename
400+.BR \%basename ()
400401 function.
401402 .
402403 .
@@ -408,9 +409,9 @@ None.
408409 .SH CAVEATS AND BUGS
409410 .
410411 The
411-.B dirname
412+.BR \%dirname ()
412413 and
413-.B basename
414+.BR \%basename ()
414415 functions may modify the
415416 .I path
416417 string passed to them.
@@ -425,9 +426,9 @@ Also note that,
425426 since the
426427 .I path
427428 argument may be modified by the
428-.B dirname
429+.BR \%dirname ()
429430 or the
430-.B basename
431+.BR \%basename ()
431432 function call,
432433 if you wish to preserve the original content of
433434 .IR path ,
@@ -437,14 +438,14 @@ either function may return its result in a statically allocated buffer,
437438 which may be overwritten on a subsequent function call.
438439 .PP
439440 Although the
440-.B dirname
441+.BR \%dirname ()
441442 and
442-.B basename
443+.BR \%basename ()
443444 functions parse path name strings,
444445 they are basically just
445446 .I string
446447 functions.
447-The presence of an MS\-Windows(\(tm) drive designator is determined
448+The presence of an MS\-Windows drive designator is determined
448449 by the appearance of a colon
449450 .RB (\(dq : \(dq)
450451 as the second character of the
@@ -459,13 +460,13 @@ represents a valid path name.
459460 .
460461 .SH AUTHOR
461462 .
462-This manpage was written for the MinGW implementation of the
463-.B dirname
463+This manpage was written by \%Keith\ Marshall,
464+\%<keithmarshall@users.sourceforge.net>, to document the
465+.BR \%basename ()
464466 and
465-.B basename
466-functions by Keith\ Marshall,
467-<keithmarshall@users.sourceforge.net>.
468-It may copied, modified and redistributed,
467+.BR \%dirname ()
468+functions as they have been implemented for the MinGW.org Project.
469+It may be copied, modified and redistributed,
469470 without restriction of copyright,
470471 provided this acknowledgement of contribution by
471472 the original author remains unchanged.