1 This is standards.info, produced by makeinfo version 4.0 from
5 * Standards: (standards). GNU coding standards.
8 GNU Coding Standards Copyright (C) 1992, 1993, 1994, 1995, 1996,
9 1997, 1998 Free Software Foundation, Inc.
11 Permission is granted to make and distribute verbatim copies of this
12 manual provided the copyright notice and this permission notice are
13 preserved on all copies.
15 Permission is granted to copy and distribute modified versions of
16 this manual under the conditions for verbatim copying, provided that
17 the entire resulting derived work is distributed under the terms of a
18 permission notice identical to this one.
20 Permission is granted to copy and distribute translations of this
21 manual into another language, under the above conditions for modified
22 versions, except that this permission notice may be stated in a
23 translation approved by the Free Software Foundation.
26 File: standards.info, Node: Top, Next: Preface, Prev: (dir), Up: (dir)
31 Last updated March 13, 1998.
35 * Preface:: About the GNU Coding Standards
36 * Intellectual Property:: Keeping Free Software Free
37 * Design Advice:: General Program Design
38 * Program Behavior:: Program Behavior for All Programs
39 * Writing C:: Making The Best Use of C
40 * Documentation:: Documenting Programs
41 * Managing Releases:: The Release Process
44 File: standards.info, Node: Preface, Next: Intellectual Property, Prev: Top, Up: Top
46 About the GNU Coding Standards
47 ******************************
49 The GNU Coding Standards were written by Richard Stallman and other
50 GNU Project volunteers. Their purpose is to make the GNU system clean,
51 consistent, and easy to install. This document can also be read as a
52 guide to writing portable, robust and reliable programs. It focuses on
53 programs written in C, but many of the rules and principles are useful
54 even if you write in another programming language. The rules often
55 state reasons for writing in a certain way.
57 Corrections or suggestions for this document should be sent to
58 <gnu@gnu.org>. If you make a suggestion, please include a suggested
59 new wording for it; our time is limited. We prefer a context diff to
60 the `standards.texi' or `make-stds.texi' files, but if you don't have
61 those files, please mail your suggestion anyway.
63 This release of the GNU Coding Standards was last updated March 13,
67 File: standards.info, Node: Intellectual Property, Next: Design Advice, Prev: Preface, Up: Top
69 Keeping Free Software Free
70 **************************
72 This node discusses how you can make sure that GNU software remains
77 * Reading Non-Free Code:: Referring to Proprietary Programs
78 * Contributions:: Accepting Contributions
81 File: standards.info, Node: Reading Non-Free Code, Next: Contributions, Up: Intellectual Property
83 Referring to Proprietary Programs
84 =================================
86 Don't in any circumstances refer to Unix source code for or during
87 your work on GNU! (Or to any other proprietary programs.)
89 If you have a vague recollection of the internals of a Unix program,
90 this does not absolutely mean you can't write an imitation of it, but
91 do try to organize the imitation internally along different lines,
92 because this is likely to make the details of the Unix version
93 irrelevant and dissimilar to your results.
95 For example, Unix utilities were generally optimized to minimize
96 memory use; if you go for speed instead, your program will be very
97 different. You could keep the entire input file in core and scan it
98 there instead of using stdio. Use a smarter algorithm discovered more
99 recently than the Unix program. Eliminate use of temporary files. Do
100 it in one pass instead of two (we did this in the assembler).
102 Or, on the contrary, emphasize simplicity instead of speed. For some
103 applications, the speed of today's computers makes simpler algorithms
106 Or go for generality. For example, Unix programs often have static
107 tables or fixed-size strings, which make for arbitrary limits; use
108 dynamic allocation instead. Make sure your program handles NULs and
109 other funny characters in the input files. Add a programming language
110 for extensibility and write part of the program in that language.
112 Or turn some parts of the program into independently usable
113 libraries. Or use a simple garbage collector instead of tracking
114 precisely when to free memory, or use a new GNU facility such as
118 File: standards.info, Node: Contributions, Prev: Reading Non-Free Code, Up: Intellectual Property
120 Accepting Contributions
121 =======================
123 If someone else sends you a piece of code to add to the program you
124 are working on, we need legal papers to use it--the same sort of legal
125 papers we will need to get from you. _Each_ significant contributor to
126 a program must sign some sort of legal papers in order for us to have
127 clear title to the program. The main author alone is not enough.
129 So, before adding in any contributions from other people, please tell
130 us, so we can arrange to get the papers. Then wait until we tell you
131 that we have received the signed papers, before you actually use the
134 This applies both before you release the program and afterward. If
135 you receive diffs to fix a bug, and they make significant changes, we
136 need legal papers for that change.
138 This also applies to comments and documentation files. For copyright
139 law, comments and code are just text. Copyright applies to all kinds of
140 text, so we need legal papers for all kinds.
142 You don't need papers for changes of a few lines here or there, since
143 they are not significant for copyright purposes. Also, you don't need
144 papers if all you get from the suggestion is some ideas, not actual code
145 which you use. For example, if you write a different solution to the
146 problem, you don't need to get papers.
148 We know this is frustrating; it's frustrating for us as well. But if
149 you don't wait, you are going out on a limb--for example, what if the
150 contributor's employer won't sign a disclaimer? You might have to take
153 The very worst thing is if you forget to tell us about the other
154 contributor. We could be very embarrassed in court some day as a
157 We have more detailed advice for maintainers of programs; if you have
158 reached the stage of actually maintaining a program for GNU (whether
159 released or not), please ask us for a copy.
162 File: standards.info, Node: Design Advice, Next: Program Behavior, Prev: Intellectual Property, Up: Top
164 General Program Design
165 **********************
167 This node discusses some of the issues you should take into account
168 when designing your program.
172 * Compatibility:: Compatibility with other implementations
173 * Using Extensions:: Using non-standard features
174 * ANSI C:: Using ANSI C features
175 * Source Language:: Using languages other than C
178 File: standards.info, Node: Compatibility, Next: Using Extensions, Up: Design Advice
180 Compatibility with Other Implementations
181 ========================================
183 With occasional exceptions, utility programs and libraries for GNU
184 should be upward compatible with those in Berkeley Unix, and upward
185 compatible with ANSI C if ANSI C specifies their behavior, and upward
186 compatible with POSIX if POSIX specifies their behavior.
188 When these standards conflict, it is useful to offer compatibility
189 modes for each of them.
191 ANSI C and POSIX prohibit many kinds of extensions. Feel free to
192 make the extensions anyway, and include a `--ansi', `--posix', or
193 `--compatible' option to turn them off. However, if the extension has
194 a significant chance of breaking any real programs or scripts, then it
195 is not really upward compatible. Try to redesign its interface.
197 Many GNU programs suppress extensions that conflict with POSIX if the
198 environment variable `POSIXLY_CORRECT' is defined (even if it is
199 defined with a null value). Please make your program recognize this
200 variable if appropriate.
202 When a feature is used only by users (not by programs or command
203 files), and it is done poorly in Unix, feel free to replace it
204 completely with something totally different and better. (For example,
205 `vi' is replaced with Emacs.) But it is nice to offer a compatible
206 feature as well. (There is a free `vi' clone, so we offer it.)
208 Additional useful features not in Berkeley Unix are welcome.
211 File: standards.info, Node: Using Extensions, Next: ANSI C, Prev: Compatibility, Up: Design Advice
213 Using Non-standard Features
214 ===========================
216 Many GNU facilities that already exist support a number of convenient
217 extensions over the comparable Unix facilities. Whether to use these
218 extensions in implementing your program is a difficult question.
220 On the one hand, using the extensions can make a cleaner program.
221 On the other hand, people will not be able to build the program unless
222 the other GNU tools are available. This might cause the program to
223 work on fewer kinds of machines.
225 With some extensions, it might be easy to provide both alternatives.
226 For example, you can define functions with a "keyword" `INLINE' and
227 define that as a macro to expand into either `inline' or nothing,
228 depending on the compiler.
230 In general, perhaps it is best not to use the extensions if you can
231 straightforwardly do without them, but to use the extensions if they
232 are a big improvement.
234 An exception to this rule are the large, established programs (such
235 as Emacs) which run on a great variety of systems. Such programs would
236 be broken by use of GNU extensions.
238 Another exception is for programs that are used as part of
239 compilation: anything that must be compiled with other compilers in
240 order to bootstrap the GNU compilation facilities. If these require
241 the GNU compiler, then no one can compile them without having them
242 installed already. That would be no good.
245 File: standards.info, Node: ANSI C, Next: Source Language, Prev: Using Extensions, Up: Design Advice
247 ANSI C and pre-ANSI C
248 =====================
250 Do not ever use the "trigraph" feature of ANSI C.
252 ANSI C is widespread enough now that it is ok to write new programs
253 that use ANSI C features (and therefore will not work in non-ANSI
254 compilers). And if a program is already written in ANSI C, there's no
255 need to convert it to support non-ANSI compilers.
257 However, it is easy to support non-ANSI compilers in most programs,
258 so you might still consider doing so when you write a program. Instead
259 of writing function definitions in ANSI prototype form,
265 write the definition in pre-ANSI style like this,
272 and use a separate declaration to specify the argument prototype:
276 You need such a declaration anyway, in a header file, to get the
277 benefit of ANSI C prototypes in all the files where the function is
278 called. And once you have it, you lose nothing by writing the function
279 definition in the pre-ANSI style.
281 If you don't know non-ANSI C, there's no need to learn it; just
285 File: standards.info, Node: Source Language, Prev: ANSI C, Up: Design Advice
287 Using Languages Other Than C
288 ============================
290 Using a language other than C is like using a non-standard feature:
291 it will cause trouble for users. Even if GCC supports the other
292 language, users may find it inconvenient to have to install the
293 compiler for that other language in order to build your program. For
294 example, if you write your program in C++, people will have to install
295 the C++ compiler in order to compile your program. Thus, it is better
298 But there are three situations when there is no disadvantage in using
301 * It is okay to use another language if your program contains an
302 interpreter for that language.
304 For example, if your program links with GUILE, it is ok to write
305 part of the program in Scheme or another language supported by
308 * It is okay to use another language in a tool specifically intended
309 for use with that language.
311 This is okay because the only people who want to build the tool
312 will be those who have installed the other language anyway.
314 * If an application is of interest to a narrow community, then
315 perhaps it's not important if the application is inconvenient to
318 C has one other advantage over C++ and other compiled languages: more
319 people know C, so more people will find it easy to read and modify the
320 program if it is written in C.
323 File: standards.info, Node: Program Behavior, Next: Writing C, Prev: Design Advice, Up: Top
325 Program Behavior for All Programs
326 *********************************
328 This node describes how to write robust software. It also describes
329 general standards for error messages, the command line interface, and
330 how libraries should behave.
334 * Semantics:: Writing robust programs
335 * Libraries:: Library behavior
336 * Errors:: Formatting error messages
337 * User Interfaces:: Standards for command line interfaces
338 * Option Table:: Table of long options.
339 * Memory Usage:: When and how to care about memory needs
342 File: standards.info, Node: Semantics, Next: Libraries, Up: Program Behavior
344 Writing Robust Programs
345 =======================
347 Avoid arbitrary limits on the length or number of _any_ data
348 structure, including file names, lines, files, and symbols, by
349 allocating all data structures dynamically. In most Unix utilities,
350 "long lines are silently truncated". This is not acceptable in a GNU
353 Utilities reading files should not drop NUL characters, or any other
354 nonprinting characters _including those with codes above 0177_. The
355 only sensible exceptions would be utilities specifically intended for
356 interface to certain types of printers that can't handle those
359 Check every system call for an error return, unless you know you
360 wish to ignore errors. Include the system error text (from `perror' or
361 equivalent) in _every_ error message resulting from a failing system
362 call, as well as the name of the file if any and the name of the
363 utility. Just "cannot open foo.c" or "stat failed" is not sufficient.
365 Check every call to `malloc' or `realloc' to see if it returned
366 zero. Check `realloc' even if you are making the block smaller; in a
367 system that rounds block sizes to a power of 2, `realloc' may get a
368 different block if you ask for less space.
370 In Unix, `realloc' can destroy the storage block if it returns zero.
371 GNU `realloc' does not have this bug: if it fails, the original block
372 is unchanged. Feel free to assume the bug is fixed. If you wish to
373 run your program on Unix, and wish to avoid lossage in this case, you
374 can use the GNU `malloc'.
376 You must expect `free' to alter the contents of the block that was
377 freed. Anything you want to fetch from the block, you must fetch before
380 If `malloc' fails in a noninteractive program, make that a fatal
381 error. In an interactive program (one that reads commands from the
382 user), it is better to abort the command and return to the command
383 reader loop. This allows the user to kill other processes to free up
384 virtual memory, and then try the command again.
386 Use `getopt_long' to decode arguments, unless the argument syntax
387 makes this unreasonable.
389 When static storage is to be written in during program execution, use
390 explicit C code to initialize it. Reserve C initialized declarations
391 for data that will not be changed.
393 Try to avoid low-level interfaces to obscure Unix data structures
394 (such as file directories, utmp, or the layout of kernel memory), since
395 these are less likely to work compatibly. If you need to find all the
396 files in a directory, use `readdir' or some other high-level interface.
397 These will be supported compatibly by GNU.
399 By default, the GNU system will provide the signal handling
400 functions of BSD and of POSIX. So GNU software should be written to use
403 In error checks that detect "impossible" conditions, just abort.
404 There is usually no point in printing any message. These checks
405 indicate the existence of bugs. Whoever wants to fix the bugs will have
406 to read the source code and run a debugger. So explain the problem with
407 comments in the source. The relevant data will be in variables, which
408 are easy to examine with the debugger, so there is no point moving them
411 Do not use a count of errors as the exit status for a program.
412 _That does not work_, because exit status values are limited to 8 bits
413 (0 through 255). A single run of the program might have 256 errors; if
414 you try to return 256 as the exit status, the parent process will see 0
415 as the status, and it will appear that the program succeeded.
417 If you make temporary files, check the `TMPDIR' environment
418 variable; if that variable is defined, use the specified directory
422 File: standards.info, Node: Libraries, Next: Errors, Prev: Semantics, Up: Program Behavior
427 Try to make library functions reentrant. If they need to do dynamic
428 storage allocation, at least try to avoid any nonreentrancy aside from
429 that of `malloc' itself.
431 Here are certain name conventions for libraries, to avoid name
434 Choose a name prefix for the library, more than two characters long.
435 All external function and variable names should start with this prefix.
436 In addition, there should only be one of these in any given library
437 member. This usually means putting each one in a separate source file.
439 An exception can be made when two external symbols are always used
440 together, so that no reasonable program could use one without the
441 other; then they can both go in the same file.
443 External symbols that are not documented entry points for the user
444 should have names beginning with `_'. They should also contain the
445 chosen name prefix for the library, to prevent collisions with other
446 libraries. These can go in the same files with user entry points if
449 Static functions and variables can be used as you like and need not
450 fit any naming convention.
453 File: standards.info, Node: Errors, Next: User Interfaces, Prev: Libraries, Up: Program Behavior
455 Formatting Error Messages
456 =========================
458 Error messages from compilers should look like this:
460 SOURCE-FILE-NAME:LINENO: MESSAGE
462 Error messages from other noninteractive programs should look like
465 PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE
467 when there is an appropriate source file, or like this:
471 when there is no relevant source file.
473 In an interactive program (one that is reading commands from a
474 terminal), it is better not to include the program name in an error
475 message. The place to indicate which program is running is in the
476 prompt or with the screen layout. (When the same program runs with
477 input from a source other than a terminal, it is not interactive and
478 would do best to print error messages using the noninteractive style.)
480 The string MESSAGE should not begin with a capital letter when it
481 follows a program name and/or file name. Also, it should not end with
484 Error messages from interactive programs, and other messages such as
485 usage messages, should start with a capital letter. But they should not
489 File: standards.info, Node: User Interfaces, Next: Option Table, Prev: Errors, Up: Program Behavior
491 Standards for Command Line Interfaces
492 =====================================
494 Please don't make the behavior of a utility depend on the name used
495 to invoke it. It is useful sometimes to make a link to a utility with
496 a different name, and that should not change what it does.
498 Instead, use a run time option or a compilation switch or both to
499 select among the alternate behaviors.
501 Likewise, please don't make the behavior of the program depend on the
502 type of output device it is used with. Device independence is an
503 important principle of the system's design; do not compromise it merely
504 to save someone from typing an option now and then.
506 If you think one behavior is most useful when the output is to a
507 terminal, and another is most useful when the output is a file or a
508 pipe, then it is usually best to make the default behavior the one that
509 is useful with output to a terminal, and have an option for the other
512 Compatibility requires certain programs to depend on the type of
513 output device. It would be disastrous if `ls' or `sh' did not do so in
514 the way all users expect. In some of these cases, we supplement the
515 program with a preferred alternate version that does not depend on the
516 output device type. For example, we provide a `dir' program much like
517 `ls' except that its default output format is always multi-column
520 It is a good idea to follow the POSIX guidelines for the
521 command-line options of a program. The easiest way to do this is to use
522 `getopt' to parse them. Note that the GNU version of `getopt' will
523 normally permit options anywhere among the arguments unless the special
524 argument `--' is used. This is not what POSIX specifies; it is a GNU
527 Please define long-named options that are equivalent to the
528 single-letter Unix-style options. We hope to make GNU more user
529 friendly this way. This is easy to do with the GNU function
532 One of the advantages of long-named options is that they can be
533 consistent from program to program. For example, users should be able
534 to expect the "verbose" option of any GNU program which has one, to be
535 spelled precisely `--verbose'. To achieve this uniformity, look at the
536 table of common long-option names when you choose the option names for
537 your program (*note Option Table::).
539 It is usually a good idea for file names given as ordinary arguments
540 to be input files only; any output files would be specified using
541 options (preferably `-o' or `--output'). Even if you allow an output
542 file name as an ordinary argument for compatibility, try to provide an
543 option as another way to specify it. This will lead to more consistency
544 among GNU utilities, and fewer idiosyncracies for users to remember.
546 All programs should support two standard options: `--version' and
550 This option should direct the program to information about its
551 name, version, origin and legal status, all on standard output,
552 and then exit successfully. Other options and arguments should be
553 ignored once this is seen, and the program should not perform its
556 The first line is meant to be easy for a program to parse; the
557 version number proper starts after the last space. In addition,
558 it contains the canonical name for this program, in this format:
562 The program's name should be a constant string; _don't_ compute it
563 from `argv[0]'. The idea is to state the standard or canonical
564 name for the program, not its file name. There are other ways to
565 find out the precise file name where a command is found in `PATH'.
567 If the program is a subsidiary part of a larger package, mention
568 the package name in parentheses, like this:
570 emacsserver (GNU Emacs) 19.30
572 If the package has a version number which is different from this
573 program's version number, you can mention the package version
574 number just before the close-parenthesis.
576 If you *need* to mention the version numbers of libraries which
577 are distributed separately from the package which contains this
578 program, you can do so by printing an additional line of version
579 info for each library you want to mention. Use the same format
580 for these lines as for the first line.
582 Please do not mention all of the libraries that the program uses
583 "just for completeness"--that would produce a lot of unhelpful
584 clutter. Please mention library version numbers only if you find
585 in practice that they are very important to you in debugging.
587 The following line, after the version number line or lines, should
588 be a copyright notice. If more than one copyright notice is
589 called for, put each on a separate line.
591 Next should follow a brief statement that the program is free
592 software, and that users are free to copy and change it on certain
593 conditions. If the program is covered by the GNU GPL, say so
594 here. Also mention that there is no warranty, to the extent
597 It is ok to finish the output with a list of the major authors of
598 the program, as a way of giving credit.
600 Here's an example of output that follows these rules:
603 Copyright (C) 1996 Free Software Foundation, Inc.
604 GNU Emacs comes with NO WARRANTY,
605 to the extent permitted by law.
606 You may redistribute copies of GNU Emacs
607 under the terms of the GNU General Public License.
608 For more information about these matters,
609 see the files named COPYING.
611 You should adapt this to your program, of course, filling in the
612 proper year, copyright holder, name of program, and the references
613 to distribution terms, and changing the rest of the wording as
616 This copyright notice only needs to mention the most recent year in
617 which changes were made--there's no need to list the years for
618 previous versions' changes. You don't have to mention the name of
619 the program in these notices, if that is inconvenient, since it
620 appeared in the first line.
623 This option should output brief documentation for how to invoke the
624 program, on standard output, then exit successfully. Other
625 options and arguments should be ignored once this is seen, and the
626 program should not perform its normal function.
628 Near the end of the `--help' option's output there should be a line
629 that says where to mail bug reports. It should have this format:
631 Report bugs to MAILING-ADDRESS.
634 File: standards.info, Node: Option Table, Next: Memory Usage, Prev: User Interfaces, Up: Program Behavior
636 Table of Long Options
637 =====================
639 Here is a table of long options used by GNU programs. It is surely
640 incomplete, but we aim to list all the options that a new program might
641 want to be compatible with. If you use names not already in the table,
642 please send <gnu@gnu.org> a list of them, with their meanings, so we
643 can update the table.
649 `-a' in `du', `ls', `nm', `stty', `uname', and `unexpand'.
658 `-a' in `etags', `tee', `time'; `-r' in `tar'.
709 `-b' in `cpio' and `diff'.
715 Used in `cpio' and `tar'.
718 `-b' in `head' and `tail'.
724 Used in various programs to make output shorter.
727 `-c' in `head', `split', and `tail'.
736 Used in various programs to specify the directory to use.
739 `-c' in `chgrp' and `chown'.
748 `-c' in `su'; `-x' in GDB.
757 `-Z' in `tar' and `shar'.
769 `-W copyleft' in `gawk'.
772 `-C' in `ptx', `recode', and `wdiff'; `-W copyright' in `gawk'.
784 Used in `tar' and `cpio'.
796 `-d' in Make and `m4'; `-t' in Bison.
802 `-d' in Bison and `ctags'.
808 `-L' in `chgrp', `chown', `cpio', `du', `ls', and `tar'.
826 Specify the directory to use, in various programs. In `ls', it
827 means to show directories themselves rather than their contents.
828 In `rm' and `ln', it means to not treat links to directories
855 `environment-overrides'
895 `-i' in `cpio'; `-x' in `tar'.
907 `-f' in `info', `gawk', Make, `mt', and `tar'; `-n' in `sed'; `-r'
938 `-f' in `cp', `ln', `mv', and `rm'.
944 Used in `ls', `time', and `ptx'.
968 `-z' in `tar' and `shar'.
974 `-h' in `objdump' and `recode'
980 Used to ask for brief usage information.
995 `-I' in `ls'; `-x' in `recode'.
1003 `ignore-blank-lines'
1007 `-f' in `look' and `ptx'; `-i' in `diff' and `wdiff'.
1015 `ignore-indentation'
1024 `ignore-matching-lines'
1027 `ignore-space-change'
1034 `-i' in `etags'; `-I' in `m4'.
1043 `-i', `-l', and `-m' in Finger.
1055 `-i' in `cp', `ln', `mv', `rm'; `-e' in `m4'; `-p' in `xargs';
1074 `-k' in `du' and `ls'.
1089 Used in `split', `head', and `tail'.
1099 `-t' in `cpio'; `-l' in `recode'.
1114 No listing of which programs already use this; someone should
1115 check to see if any actually do, and tell <gnu@gnu.org>.
1121 `-m' in `hello' and `uname'.
1160 `-m' in `install', `mkdir', and `mkfifo'.
1183 `no-character-count'
1241 Used in `emacsclient'.
1244 Used in various programs to inhibit warnings.
1271 `-n' in `cpio' and `ls'.
1283 `-l' in `tar', `cp', and `du'.
1295 In various programs, specify the output file name.
1316 `-p' in `mkdir' and `rmdir'.
1328 `-c' in `cpio' and `tar'.
1340 Used in `tar' and `cp'.
1342 `preserve-environment'
1345 `preserve-modification-time'
1351 `preserve-permissions'
1385 Used in many programs to inhibit the usual output. *Note:* every
1386 program accepting `--quiet' should accept `--silent' as a synonym.
1413 Used in `chgrp', `chown', `cp', `ls', `diff', and `rm'.
1422 `-r' in `tac' and `etags'.
1439 `report-identical-files'
1446 `-r' in `ls' and `nm'.
1476 Used by `recode' to chose files or pipes for sequencing passes.
1490 `show-function-line'
1497 Used in many programs to inhibit the usual output. *Note:* every
1498 program accepting `--silent' should accept `--quiet' as a synonym.
1507 `-W source' in `gawk'.
1531 Used in `tar' and `diff' to specify which file within a directory
1532 to start processing with.
1559 `-S' in `cp', `ln', `mv'.
1574 Used in GDB and `objdump'.
1583 `-t' in `expand' and `unexpand'.
1589 `-T' in `tput' and `ul'. `-t' in `wdiff'.
1598 Used in `ls' and `touch'.
1607 `-t' in Make, `ranlib', and `recode'.
1613 `-t' in `hello'; `-W traditional' in `gawk'; `-G' in `ed', `m4',
1641 `-u' in `cp', `ctags', `mv', `tar'.
1644 Used in `gawk'; same as `--help'.
1653 Print more information about progress. Many programs support this.
1659 Print the version number.
1662 `-V' in `cp', `ln', `mv'.
1677 `-w' in `ls' and `ptx'.
1689 File: standards.info, Node: Memory Usage, Prev: Option Table, Up: Program Behavior
1694 If it typically uses just a few meg of memory, don't bother making
1695 any effort to reduce memory usage. For example, if it is impractical
1696 for other reasons to operate on files more than a few meg long, it is
1697 reasonable to read entire input files into core to operate on them.
1699 However, for programs such as `cat' or `tail', that can usefully
1700 operate on very large files, it is important to avoid using a technique
1701 that would artificially limit the size of files it can handle. If a
1702 program works by lines and could be applied to arbitrary user-supplied
1703 input files, it should keep only a line in memory, because this is not
1704 very hard and users will want to be able to operate on input files that
1705 are bigger than will fit in core all at once.
1707 If your program creates complicated data structures, just make them
1708 in core and give a fatal error if `malloc' returns zero.
1711 File: standards.info, Node: Writing C, Next: Documentation, Prev: Program Behavior, Up: Top
1713 Making The Best Use of C
1714 ************************
1716 This node provides advice on how best to use the C language when
1717 writing GNU software.
1721 * Formatting:: Formatting Your Source Code
1722 * Comments:: Commenting Your Work
1723 * Syntactic Conventions:: Clean Use of C Constructs
1724 * Names:: Naming Variables and Functions
1725 * System Portability:: Portability between different operating systems
1726 * CPU Portability:: Supporting the range of CPU types
1727 * System Functions:: Portability and ``standard'' library functions
1728 * Internationalization:: Techniques for internationalization
1729 * Mmap:: How you can safely use `mmap'.
1732 File: standards.info, Node: Formatting, Next: Comments, Up: Writing C
1734 Formatting Your Source Code
1735 ===========================
1737 It is important to put the open-brace that starts the body of a C
1738 function in column zero, and avoid putting any other open-brace or
1739 open-parenthesis or open-bracket in column zero. Several tools look
1740 for open-braces in column zero to find the beginnings of C functions.
1741 These tools will not work on code not formatted that way.
1743 It is also important for function definitions to start the name of
1744 the function in column zero. This helps people to search for function
1745 definitions, and may also help certain tools recognize them. Thus, the
1746 proper format is this:
1749 concat (s1, s2) /* Name starts in column zero here */
1751 { /* Open brace in column zero here */
1755 or, if you want to use ANSI C, format the definition like this:
1758 concat (char *s1, char *s2)
1763 In ANSI C, if the arguments don't fit nicely on one line, split it
1767 lots_of_args (int an_integer, long a_long, short a_short,
1768 double a_double, float a_float)
1771 For the body of the function, we prefer code formatted like this:
1782 return ++x + bar ();
1785 We find it easier to read a program when it has spaces before the
1786 open-parentheses and after the commas. Especially after the commas.
1788 When you split an expression into multiple lines, split it before an
1789 operator, not after one. Here is the right way:
1791 if (foo_this_is_long && bar > win (x, y, z)
1792 && remaining_condition)
1794 Try to avoid having two operators of different precedence at the same
1795 level of indentation. For example, don't write this:
1797 mode = (inmode[j] == VOIDmode
1798 || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])
1799 ? outmode[j] : inmode[j]);
1801 Instead, use extra parentheses so that the indentation shows the
1804 mode = ((inmode[j] == VOIDmode
1805 || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])))
1806 ? outmode[j] : inmode[j]);
1808 Insert extra parentheses so that Emacs will indent the code properly.
1809 For example, the following indentation looks nice if you do it by hand,
1810 but Emacs would mess it up:
1812 v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
1813 + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000;
1815 But adding a set of parentheses solves the problem:
1817 v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
1818 + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000);
1820 Format do-while statements like this:
1828 Please use formfeed characters (control-L) to divide the program into
1829 pages at logical places (but not within a function). It does not matter
1830 just how long the pages are, since they do not have to fit on a printed
1831 page. The formfeeds should appear alone on lines by themselves.
1834 File: standards.info, Node: Comments, Next: Syntactic Conventions, Prev: Formatting, Up: Writing C
1836 Commenting Your Work
1837 ====================
1839 Every program should start with a comment saying briefly what it is
1840 for. Example: `fmt - filter for simple filling of text'.
1842 Please write the comments in a GNU program in English, because
1843 English is the one language that nearly all programmers in all
1844 countries can read. If you do not write English well, please write
1845 comments in English as well as you can, then ask other people to help
1846 rewrite them. If you can't write comments in English, please find
1847 someone to work with you and translate your comments into English.
1849 Please put a comment on each function saying what the function does,
1850 what sorts of arguments it gets, and what the possible values of
1851 arguments mean and are used for. It is not necessary to duplicate in
1852 words the meaning of the C argument declarations, if a C type is being
1853 used in its customary fashion. If there is anything nonstandard about
1854 its use (such as an argument of type `char *' which is really the
1855 address of the second character of a string, not the first), or any
1856 possible values that would not work the way one would expect (such as,
1857 that strings containing newlines are not guaranteed to work), be sure
1860 Also explain the significance of the return value, if there is one.
1862 Please put two spaces after the end of a sentence in your comments,
1863 so that the Emacs sentence commands will work. Also, please write
1864 complete sentences and capitalize the first word. If a lower-case
1865 identifier comes at the beginning of a sentence, don't capitalize it!
1866 Changing the spelling makes it a different identifier. If you don't
1867 like starting a sentence with a lower case letter, write the sentence
1868 differently (e.g., "The identifier lower-case is ...").
1870 The comment on a function is much clearer if you use the argument
1871 names to speak about the argument values. The variable name itself
1872 should be lower case, but write it in upper case when you are speaking
1873 about the value rather than the variable itself. Thus, "the inode
1874 number NODE_NUM" rather than "an inode".
1876 There is usually no purpose in restating the name of the function in
1877 the comment before it, because the reader can see that for himself.
1878 There might be an exception when the comment is so long that the
1879 function itself would be off the bottom of the screen.
1881 There should be a comment on each static variable as well, like this:
1883 /* Nonzero means truncate lines in the display;
1884 zero means continue them. */
1887 Every `#endif' should have a comment, except in the case of short
1888 conditionals (just a few lines) that are not nested. The comment should
1889 state the condition of the conditional that is ending, _including its
1890 sense_. `#else' should have a comment describing the condition _and
1891 sense_ of the code that follows. For example:
1897 #endif /* not foo */
1902 but, by contrast, write the comments this way for a `#ifndef':
1911 #endif /* not foo */
1914 File: standards.info, Node: Syntactic Conventions, Next: Names, Prev: Comments, Up: Writing C
1916 Clean Use of C Constructs
1917 =========================
1919 Please explicitly declare all arguments to functions. Don't omit
1920 them just because they are `int's.
1922 Declarations of external functions and functions to appear later in
1923 the source file should all go in one place near the beginning of the
1924 file (somewhere before the first function definition in the file), or
1925 else should go in a header file. Don't put `extern' declarations inside
1928 It used to be common practice to use the same local variables (with
1929 names like `tem') over and over for different values within one
1930 function. Instead of doing this, it is better declare a separate local
1931 variable for each distinct purpose, and give it a name which is
1932 meaningful. This not only makes programs easier to understand, it also
1933 facilitates optimization by good compilers. You can also move the
1934 declaration of each local variable into the smallest scope that includes
1935 all its uses. This makes the program even cleaner.
1937 Don't use local variables or parameters that shadow global
1940 Don't declare multiple variables in one declaration that spans lines.
1941 Start a new declaration on each line, instead. For example, instead of
1956 (If they are global variables, each should have a comment preceding it
1959 When you have an `if'-`else' statement nested in another `if'
1960 statement, always put braces around the `if'-`else'. Thus, never write
1979 If you have an `if' statement nested inside of an `else' statement,
1980 either write `else if' on one line, like this,
1987 with its `then'-part indented like the preceding `then'-part, or write
1988 the nested `if' within braces like this:
1998 Don't declare both a structure tag and variables or typedefs in the
1999 same declaration. Instead, declare the structure tag separately and
2000 then use it to declare the variables or typedefs.
2002 Try to avoid assignments inside `if'-conditions. For example, don't
2005 if ((foo = (char *) malloc (sizeof *foo)) == 0)
2006 fatal ("virtual memory exhausted");
2008 instead, write this:
2010 foo = (char *) malloc (sizeof *foo);
2012 fatal ("virtual memory exhausted");
2014 Don't make the program ugly to placate `lint'. Please don't insert
2015 any casts to `void'. Zero without a cast is perfectly fine as a null
2016 pointer constant, except when calling a varargs function.
2019 File: standards.info, Node: Names, Next: System Portability, Prev: Syntactic Conventions, Up: Writing C
2021 Naming Variables and Functions
2022 ==============================
2024 The names of global variables and functions in a program serve as
2025 comments of a sort. So don't choose terse names--instead, look for
2026 names that give useful information about the meaning of the variable or
2027 function. In a GNU program, names should be English, like other
2030 Local variable names can be shorter, because they are used only
2031 within one context, where (presumably) comments explain their purpose.
2033 Please use underscores to separate words in a name, so that the Emacs
2034 word commands can be useful within them. Stick to lower case; reserve
2035 upper case for macros and `enum' constants, and for name-prefixes that
2036 follow a uniform convention.
2038 For example, you should use names like `ignore_space_change_flag';
2039 don't use names like `iCantReadThis'.
2041 Variables that indicate whether command-line options have been
2042 specified should be named after the meaning of the option, not after
2043 the option-letter. A comment should state both the exact meaning of
2044 the option and its letter. For example,
2046 /* Ignore changes in horizontal whitespace (-b). */
2047 int ignore_space_change_flag;
2049 When you want to define names with constant integer values, use
2050 `enum' rather than `#define'. GDB knows about enumeration constants.
2052 Use file names of 14 characters or less, to avoid creating gratuitous
2053 problems on older System V systems. You can use the program `doschk'
2054 to test for this. `doschk' also tests for potential name conflicts if
2055 the files were loaded onto an MS-DOS file system--something you may or
2059 File: standards.info, Node: System Portability, Next: CPU Portability, Prev: Names, Up: Writing C
2061 Portability between System Types
2062 ================================
2064 In the Unix world, "portability" refers to porting to different Unix
2065 versions. For a GNU program, this kind of portability is desirable, but
2068 The primary purpose of GNU software is to run on top of the GNU
2069 kernel, compiled with the GNU C compiler, on various types of CPU. The
2070 amount and kinds of variation among GNU systems on different CPUs will
2071 be comparable to the variation among Linux-based GNU systems or among
2072 BSD systems today. So the kinds of portability that are absolutely
2073 necessary are quite limited.
2075 But many users do run GNU software on non-GNU Unix or Unix-like
2076 systems. So supporting a variety of Unix-like systems is desirable,
2077 although not paramount.
2079 The easiest way to achieve portability to most Unix-like systems is
2080 to use Autoconf. It's unlikely that your program needs to know more
2081 information about the host platform than Autoconf can provide, simply
2082 because most of the programs that need such knowledge have already been
2085 Avoid using the format of semi-internal data bases (e.g.,
2086 directories) when there is a higher-level alternative (`readdir').
2088 As for systems that are not like Unix, such as MSDOS, Windows, the
2089 Macintosh, VMS, and MVS, supporting them is usually so much work that it
2090 is better if you don't.
2092 The planned GNU kernel is not finished yet, but you can tell which
2093 facilities it will provide by looking at the GNU C Library Manual. The
2094 GNU kernel is based on Mach, so the features of Mach will also be
2095 available. However, if you use Mach features, you'll probably have
2096 trouble debugging your program today.
2099 File: standards.info, Node: CPU Portability, Next: System Functions, Prev: System Portability, Up: Writing C
2101 Portability between CPUs
2102 ========================
2104 Even GNU systems will differ because of differences among CPU
2105 types--for example, difference in byte ordering and alignment
2106 requirements. It is absolutely essential to handle these differences.
2107 However, don't make any effort to cater to the possibility that an
2108 `int' will be less than 32 bits. We don't support 16-bit machines in
2111 Don't assume that the address of an `int' object is also the address
2112 of its least-significant byte. This is false on big-endian machines.
2113 Thus, don't make the following mistake:
2117 while ((c = getchar()) != EOF)
2118 write(file_descriptor, &c, 1);
2120 When calling functions, you need not worry about the difference
2121 between pointers of various types, or between pointers and integers.
2122 On most machines, there's no difference anyway. As for the few
2123 machines where there is a difference, all of them support ANSI C, so
2124 you can use prototypes (conditionalized to be active only in ANSI C) to
2125 make the code work on those systems.
2127 In certain cases, it is ok to pass integer and pointer arguments
2128 indiscriminately to the same function, and use no prototype on any
2129 system. For example, many GNU programs have error-reporting functions
2130 that pass their arguments along to `printf' and friends:
2132 error (s, a1, a2, a3)
2136 fprintf (stderr, "error: ");
2137 fprintf (stderr, s, a1, a2, a3);
2140 In practice, this works on all machines, and it is much simpler than any
2141 "correct" alternative. Be sure _not_ to use a prototype for such
2144 However, avoid casting pointers to integers unless you really need
2145 to. These assumptions really reduce portability, and in most programs
2146 they are easy to avoid. In the cases where casting pointers to
2147 integers is essential--such as, a Lisp interpreter which stores type
2148 information as well as an address in one word--it is ok to do so, but
2149 you'll have to make explicit provisions to handle different word sizes.
2152 File: standards.info, Node: System Functions, Next: Internationalization, Prev: CPU Portability, Up: Writing C
2154 Calling System Functions
2155 ========================
2157 C implementations differ substantially. ANSI C reduces but does not
2158 eliminate the incompatibilities; meanwhile, many users wish to compile
2159 GNU software with pre-ANSI compilers. This chapter gives
2160 recommendations for how to use the more or less standard C library
2161 functions to avoid unnecessary loss of portability.
2163 * Don't use the value of `sprintf'. It returns the number of
2164 characters written on some systems, but not on all systems.
2166 * `main' should be declared to return type `int'. It should
2167 terminate either by calling `exit' or by returning the integer
2168 status code; make sure it cannot ever return an undefined value.
2170 * Don't declare system functions explicitly.
2172 Almost any declaration for a system function is wrong on some
2173 system. To minimize conflicts, leave it to the system header
2174 files to declare system functions. If the headers don't declare a
2175 function, let it remain undeclared.
2177 While it may seem unclean to use a function without declaring it,
2178 in practice this works fine for most system library functions on
2179 the systems where this really happens; thus, the disadvantage is
2180 only theoretical. By contrast, actual declarations have
2181 frequently caused actual conflicts.
2183 * If you must declare a system function, don't specify the argument
2184 types. Use an old-style declaration, not an ANSI prototype. The
2185 more you specify about the function, the more likely a conflict.
2187 * In particular, don't unconditionally declare `malloc' or `realloc'.
2189 Most GNU programs use those functions just once, in functions
2190 conventionally named `xmalloc' and `xrealloc'. These functions
2191 call `malloc' and `realloc', respectively, and check the results.
2193 Because `xmalloc' and `xrealloc' are defined in your program, you
2194 can declare them in other files without any risk of type conflict.
2196 On most systems, `int' is the same length as a pointer; thus, the
2197 calls to `malloc' and `realloc' work fine. For the few
2198 exceptional systems (mostly 64-bit machines), you can use
2199 *conditionalized* declarations of `malloc' and `realloc'--or put
2200 these declarations in configuration files specific to those
2203 * The string functions require special treatment. Some Unix systems
2204 have a header file `string.h'; others have `strings.h'. Neither
2205 file name is portable. There are two things you can do: use
2206 Autoconf to figure out which file to include, or don't include
2209 * If you don't include either strings file, you can't get
2210 declarations for the string functions from the header file in the
2213 That causes less of a problem than you might think. The newer ANSI
2214 string functions should be avoided anyway because many systems
2215 still don't support them. The string functions you can use are
2218 strcpy strncpy strcat strncat
2219 strlen strcmp strncmp
2222 The copy and concatenate functions work fine without a declaration
2223 as long as you don't use their values. Using their values without
2224 a declaration fails on systems where the width of a pointer
2225 differs from the width of `int', and perhaps in other cases. It
2226 is trivial to avoid using their values, so do that.
2228 The compare functions and `strlen' work fine without a declaration
2229 on most systems, possibly all the ones that GNU software runs on.
2230 You may find it necessary to declare them *conditionally* on a few
2233 The search functions must be declared to return `char *'. Luckily,
2234 there is no variation in the data type they return. But there is
2235 variation in their names. Some systems give these functions the
2236 names `index' and `rindex'; other systems use the names `strchr'
2237 and `strrchr'. Some systems support both pairs of names, but
2238 neither pair works on all systems.
2240 You should pick a single pair of names and use it throughout your
2241 program. (Nowadays, it is better to choose `strchr' and `strrchr'
2242 for new programs, since those are the standard ANSI names.)
2243 Declare both of those names as functions returning `char *'. On
2244 systems which don't support those names, define them as macros in
2245 terms of the other pair. For example, here is what to put at the
2246 beginning of your file (or in a header) if you want to use the
2247 names `strchr' and `strrchr' throughout:
2250 #define strchr index
2252 #ifndef HAVE_STRRCHR
2253 #define strrchr rindex
2259 Here we assume that `HAVE_STRCHR' and `HAVE_STRRCHR' are macros
2260 defined in systems where the corresponding functions exist. One way to
2261 get them properly defined is to use Autoconf.
2264 File: standards.info, Node: Internationalization, Next: Mmap, Prev: System Functions, Up: Writing C
2266 Internationalization
2267 ====================
2269 GNU has a library called GNU gettext that makes it easy to translate
2270 the messages in a program into various languages. You should use this
2271 library in every program. Use English for the messages as they appear
2272 in the program, and let gettext provide the way to translate them into
2275 Using GNU gettext involves putting a call to the `gettext' macro
2276 around each string that might need translation--like this:
2278 printf (gettext ("Processing file `%s'..."));
2280 This permits GNU gettext to replace the string `"Processing file
2281 `%s'..."' with a translated version.
2283 Once a program uses gettext, please make a point of writing calls to
2284 `gettext' when you add new strings that call for translation.
2286 Using GNU gettext in a package involves specifying a "text domain
2287 name" for the package. The text domain name is used to separate the
2288 translations for this package from the translations for other packages.
2289 Normally, the text domain name should be the same as the name of the
2290 package--for example, `fileutils' for the GNU file utilities.
2292 To enable gettext to work well, avoid writing code that makes
2293 assumptions about the structure of words or sentences. When you want
2294 the precise text of a sentence to vary depending on the data, use two or
2295 more alternative string constants each containing a complete sentences,
2296 rather than inserting conditionalized words or phrases into a single
2299 Here is an example of what not to do:
2301 printf ("%d file%s processed", nfiles,
2302 nfiles != 1 ? "s" : "");
2304 The problem with that example is that it assumes that plurals are made
2305 by adding `s'. If you apply gettext to the format string, like this,
2307 printf (gettext ("%d file%s processed"), nfiles,
2308 nfiles != 1 ? "s" : "");
2310 the message can use different words, but it will still be forced to use
2311 `s' for the plural. Here is a better way:
2313 printf ((nfiles != 1 ? "%d files processed"
2314 : "%d file processed"),
2317 This way, you can apply gettext to each of the two strings
2320 printf ((nfiles != 1 ? gettext ("%d files processed")
2321 : gettext ("%d file processed")),
2324 This can be any method of forming the plural of the word for "file", and
2325 also handles languages that require agreement in the word for
2328 A similar problem appears at the level of sentence structure with
2331 printf ("# Implicit rule search has%s been done.\n",
2332 f->tried_implicit ? "" : " not");
2334 Adding `gettext' calls to this code cannot give correct results for all
2335 languages, because negation in some languages requires adding words at
2336 more than one place in the sentence. By contrast, adding `gettext'
2337 calls does the job straightfowardly if the code starts out like this:
2339 printf (f->tried_implicit
2340 ? "# Implicit rule search has been done.\n",
2341 : "# Implicit rule search has not been done.\n");
2344 File: standards.info, Node: Mmap, Prev: Internationalization, Up: Writing C
2349 Don't assume that `mmap' either works on all files or fails for all
2350 files. It may work on some files and fail on others.
2352 The proper way to use `mmap' is to try it on the specific file for
2353 which you want to use it--and if `mmap' doesn't work, fall back on
2354 doing the job in another way using `read' and `write'.
2356 The reason this precaution is needed is that the GNU kernel (the
2357 HURD) provides a user-extensible file system, in which there can be many
2358 different kinds of "ordinary files." Many of them support `mmap', but
2359 some do not. It is important to make programs handle all these kinds
2363 File: standards.info, Node: Documentation, Next: Managing Releases, Prev: Writing C, Up: Top
2365 Documenting Programs
2366 ********************
2370 * GNU Manuals:: Writing proper manuals.
2371 * Manual Structure Details:: Specific structure conventions.
2372 * NEWS File:: NEWS files supplement manuals.
2373 * Change Logs:: Recording Changes
2374 * Man Pages:: Man pages are secondary.
2375 * Reading other Manuals:: How far you can go in learning
2379 File: standards.info, Node: GNU Manuals, Next: Manual Structure Details, Up: Documentation
2384 The preferred way to document part of the GNU system is to write a
2385 manual in the Texinfo formatting language. See the Texinfo manual,
2386 either the hardcopy, or the on-line version available through `info' or
2387 the Emacs Info subsystem (`C-h i').
2389 Programmers often find it most natural to structure the documentation
2390 following the structure of the implementation, which they know. But
2391 this structure is not necessarily good for explaining how to use the
2392 program; it may be irrelevant and confusing for a user.
2394 At every level, from the sentences in a paragraph to the grouping of
2395 topics into separate manuals, the right way to structure documentation
2396 is according to the concepts and questions that a user will have in mind
2397 when reading it. Sometimes this structure of ideas matches the
2398 structure of the implementation of the software being documented--but
2399 often they are different. Often the most important part of learning to
2400 write good documentation is learning to notice when you are structuring
2401 the documentation like the implementation, and think about better
2404 For example, each program in the GNU system probably ought to be
2405 documented in one manual; but this does not mean each program should
2406 have its own manual. That would be following the structure of the
2407 implementation, rather than the structure that helps the user
2410 Instead, each manual should cover a coherent _topic_. For example,
2411 instead of a manual for `diff' and a manual for `diff3', we have one
2412 manual for "comparison of files" which covers both of those programs,
2413 as well as `cmp'. By documenting these programs together, we can make
2414 the whole subject clearer.
2416 The manual which discusses a program should document all of the
2417 program's command-line options and all of its commands. It should give
2418 examples of their use. But don't organize the manual as a list of
2419 features. Instead, organize it logically, by subtopics. Address the
2420 questions that a user will ask when thinking about the job that the
2423 In general, a GNU manual should serve both as tutorial and reference.
2424 It should be set up for convenient access to each topic through Info,
2425 and for reading straight through (appendixes aside). A GNU manual
2426 should give a good introduction to a beginner reading through from the
2427 start, and should also provide all the details that hackers want.
2429 That is not as hard as it first sounds. Arrange each chapter as a
2430 logical breakdown of its topic, but order the sections, and write their
2431 text, so that reading the chapter straight through makes sense. Do
2432 likewise when structuring the book into chapters, and when structuring a
2433 section into paragraphs. The watchword is, _at each point, address the
2434 most fundamental and important issue raised by the preceding text._
2436 If necessary, add extra chapters at the beginning of the manual which
2437 are purely tutorial and cover the basics of the subject. These provide
2438 the framework for a beginner to understand the rest of the manual. The
2439 Bison manual provides a good example of how to do this.
2441 Don't use Unix man pages as a model for how to write GNU
2442 documentation; most of them are terse, badly structured, and give
2443 inadequate explanation of the underlying concepts. (There are, of
2444 course exceptions.) Also Unix man pages use a particular format which
2445 is different from what we use in GNU manuals.
2447 Please do not use the term "pathname" that is used in Unix
2448 documentation; use "file name" (two words) instead. We use the term
2449 "path" only for search paths, which are lists of file names.
2451 Please do not use the term "illegal" to refer to erroneous input to a
2452 computer program. Please use "invalid" for this, and reserve the term
2453 "illegal" for violations of law.
2456 File: standards.info, Node: Manual Structure Details, Next: NEWS File, Prev: GNU Manuals, Up: Documentation
2458 Manual Structure Details
2459 ========================
2461 The title page of the manual should state the version of the
2462 programs or packages documented in the manual. The Top node of the
2463 manual should also contain this information. If the manual is changing
2464 more frequently than or independent of the program, also state a version
2465 number for the manual in both of these places.
2467 Each program documented in the manual should should have a node named
2468 `PROGRAM Invocation' or `Invoking PROGRAM'. This node (together with
2469 its subnodes, if any) should describe the program's command line
2470 arguments and how to run it (the sort of information people would look
2471 in a man page for). Start with an `@example' containing a template for
2472 all the options and arguments that the program uses.
2474 Alternatively, put a menu item in some menu whose item name fits one
2475 of the above patterns. This identifies the node which that item points
2476 to as the node for this purpose, regardless of the node's actual name.
2478 There will be automatic features for specifying a program name and
2479 quickly reading just this part of its manual.
2481 If one manual describes several programs, it should have such a node
2482 for each program described.
2485 File: standards.info, Node: NEWS File, Next: Change Logs, Prev: Manual Structure Details, Up: Documentation
2490 In addition to its manual, the package should have a file named
2491 `NEWS' which contains a list of user-visible changes worth mentioning.
2492 In each new release, add items to the front of the file and identify
2493 the version they pertain to. Don't discard old items; leave them in
2494 the file after the newer items. This way, a user upgrading from any
2495 previous version can see what is new.
2497 If the `NEWS' file gets very long, move some of the older items into
2498 a file named `ONEWS' and put a note at the end referring the user to
2502 File: standards.info, Node: Change Logs, Next: Man Pages, Prev: NEWS File, Up: Documentation
2507 Keep a change log to describe all the changes made to program source
2508 files. The purpose of this is so that people investigating bugs in the
2509 future will know about the changes that might have introduced the bug.
2510 Often a new bug can be found by looking at what was recently changed.
2511 More importantly, change logs can help you eliminate conceptual
2512 inconsistencies between different parts of a program, by giving you a
2513 history of how the conflicting concepts arose and who they came from.
2517 * Change Log Concepts::
2518 * Style of Change Logs::
2520 * Conditional Changes::
2523 File: standards.info, Node: Change Log Concepts, Next: Style of Change Logs, Up: Change Logs
2528 You can think of the change log as a conceptual "undo list" which
2529 explains how earlier versions were different from the current version.
2530 People can see the current version; they don't need the change log to
2531 tell them what is in it. What they want from a change log is a clear
2532 explanation of how the earlier version differed.
2534 The change log file is normally called `ChangeLog' and covers an
2535 entire directory. Each directory can have its own change log, or a
2536 directory can use the change log of its parent directory-it's up to you.
2538 Another alternative is to record change log information with a
2539 version control system such as RCS or CVS. This can be converted
2540 automatically to a `ChangeLog' file.
2542 There's no need to describe the full purpose of the changes or how
2543 they work together. If you think that a change calls for explanation,
2544 you're probably right. Please do explain it--but please put the
2545 explanation in comments in the code, where people will see it whenever
2546 they see the code. For example, "New function" is enough for the
2547 change log when you add a function, because there should be a comment
2548 before the function definition to explain what it does.
2550 However, sometimes it is useful to write one line to describe the
2551 overall purpose of a batch of changes.
2553 The easiest way to add an entry to `ChangeLog' is with the Emacs
2554 command `M-x add-change-log-entry'. An entry should have an asterisk,
2555 the name of the changed file, and then in parentheses the name of the
2556 changed functions, variables or whatever, followed by a colon. Then
2557 describe the changes you made to that function or variable.
2560 File: standards.info, Node: Style of Change Logs, Next: Simple Changes, Prev: Change Log Concepts, Up: Change Logs
2562 Style of Change Logs
2563 --------------------
2565 Here are some examples of change log entries:
2567 * register.el (insert-register): Return nil.
2568 (jump-to-register): Likewise.
2570 * sort.el (sort-subr): Return nil.
2572 * tex-mode.el (tex-bibtex-file, tex-file, tex-region):
2573 Restart the tex shell if process is gone or stopped.
2574 (tex-shell-running): New function.
2576 * expr.c (store_one_arg): Round size up for move_block_to_reg.
2577 (expand_call): Round up when emitting USE insns.
2578 * stmt.c (assign_parms): Round size up for move_block_from_reg.
2580 It's important to name the changed function or variable in full.
2581 Don't abbreviate function or variable names, and don't combine them.
2582 Subsequent maintainers will often search for a function name to find all
2583 the change log entries that pertain to it; if you abbreviate the name,
2584 they won't find it when they search.
2586 For example, some people are tempted to abbreviate groups of function
2587 names by writing `* register.el ({insert,jump-to}-register)'; this is
2588 not a good idea, since searching for `jump-to-register' or
2589 `insert-register' would not find that entry.
2591 Separate unrelated change log entries with blank lines. When two
2592 entries represent parts of the same change, so that they work together,
2593 then don't put blank lines between them. Then you can omit the file
2594 name and the asterisk when successive entries are in the same file.
2597 File: standards.info, Node: Simple Changes, Next: Conditional Changes, Prev: Style of Change Logs, Up: Change Logs
2602 Certain simple kinds of changes don't need much detail in the change
2605 When you change the calling sequence of a function in a simple
2606 fashion, and you change all the callers of the function, there is no
2607 need to make individual entries for all the callers that you changed.
2608 Just write in the entry for the function being called, "All callers
2611 * keyboard.c (Fcommand_execute): New arg SPECIAL.
2612 All callers changed.
2614 When you change just comments or doc strings, it is enough to write
2615 an entry for the file, without mentioning the functions. Just "Doc
2616 fixes" is enough for the change log.
2618 There's no need to make change log entries for documentation files.
2619 This is because documentation is not susceptible to bugs that are hard
2620 to fix. Documentation does not consist of parts that must interact in a
2621 precisely engineered fashion. To correct an error, you need not know
2622 the history of the erroneous passage; it is enough to compare what the
2623 documentation says with the way the program actually works.
2626 File: standards.info, Node: Conditional Changes, Prev: Simple Changes, Up: Change Logs
2631 C programs often contain compile-time `#if' conditionals. Many
2632 changes are conditional; sometimes you add a new definition which is
2633 entirely contained in a conditional. It is very useful to indicate in
2634 the change log the conditions for which the change applies.
2636 Our convention for indicating conditional changes is to use square
2637 brackets around the name of the condition.
2639 Here is a simple example, describing a change which is conditional
2640 but does not have a function or entity name associated with it:
2642 * xterm.c [SOLARIS2]: Include string.h.
2644 Here is an entry describing a new definition which is entirely
2645 conditional. This new definition for the macro `FRAME_WINDOW_P' is
2646 used only when `HAVE_X_WINDOWS' is defined:
2648 * frame.h [HAVE_X_WINDOWS] (FRAME_WINDOW_P): Macro defined.
2650 Here is an entry for a change within the function `init_display',
2651 whose definition as a whole is unconditional, but the changes themselves
2652 are contained in a `#ifdef HAVE_LIBNCURSES' conditional:
2654 * dispnew.c (init_display) [HAVE_LIBNCURSES]: If X, call tgetent.
2656 Here is an entry for a change that takes affect only when a certain
2657 macro is _not_ defined:
2659 (gethostname) [!HAVE_SOCKETS]: Replace with winsock version.
2662 File: standards.info, Node: Man Pages, Next: Reading other Manuals, Prev: Change Logs, Up: Documentation
2667 In the GNU project, man pages are secondary. It is not necessary or
2668 expected for every GNU program to have a man page, but some of them do.
2669 It's your choice whether to include a man page in your program.
2671 When you make this decision, consider that supporting a man page
2672 requires continual effort each time the program is changed. The time
2673 you spend on the man page is time taken away from more useful work.
2675 For a simple program which changes little, updating the man page may
2676 be a small job. Then there is little reason not to include a man page,
2679 For a large program that changes a great deal, updating a man page
2680 may be a substantial burden. If a user offers to donate a man page,
2681 you may find this gift costly to accept. It may be better to refuse
2682 the man page unless the same person agrees to take full responsibility
2683 for maintaining it--so that you can wash your hands of it entirely. If
2684 this volunteer later ceases to do the job, then don't feel obliged to
2685 pick it up yourself; it may be better to withdraw the man page from the
2686 distribution until someone else agrees to update it.
2688 When a program changes only a little, you may feel that the
2689 discrepancies are small enough that the man page remains useful without
2690 updating. If so, put a prominent note near the beginning of the man
2691 page explaining that you don't maintain it and that the Texinfo manual
2692 is more authoritative. The note should say how to access the Texinfo
2696 File: standards.info, Node: Reading other Manuals, Prev: Man Pages, Up: Documentation
2698 Reading other Manuals
2699 =====================
2701 There may be non-free books or documentation files that describe the
2702 program you are documenting.
2704 It is ok to use these documents for reference, just as the author of
2705 a new algebra textbook can read other books on algebra. A large portion
2706 of any non-fiction book consists of facts, in this case facts about how
2707 a certain program works, and these facts are necessarily the same for
2708 everyone who writes about the subject. But be careful not to copy your
2709 outline structure, wording, tables or examples from preexisting non-free
2710 documentation. Copying from free documentation may be ok; please check
2711 with the FSF about the individual case.
2714 File: standards.info, Node: Managing Releases, Prev: Documentation, Up: Top
2719 Making a release is more than just bundling up your source files in a
2720 tar file and putting it up for FTP. You should set up your software so
2721 that it can be configured to run on a variety of systems. Your Makefile
2722 should conform to the GNU standards described below, and your directory
2723 layout should also conform to the standards discussed below. Doing so
2724 makes it easy to include your package into the larger framework of all
2729 * Configuration:: How Configuration Should Work
2730 * Makefile Conventions:: Makefile Conventions
2731 * Releases:: Making Releases
2734 File: standards.info, Node: Configuration, Next: Makefile Conventions, Up: Managing Releases
2736 How Configuration Should Work
2737 =============================
2739 Each GNU distribution should come with a shell script named
2740 `configure'. This script is given arguments which describe the kind of
2741 machine and system you want to compile the program for.
2743 The `configure' script must record the configuration options so that
2744 they affect compilation.
2746 One way to do this is to make a link from a standard name such as
2747 `config.h' to the proper configuration file for the chosen system. If
2748 you use this technique, the distribution should _not_ contain a file
2749 named `config.h'. This is so that people won't be able to build the
2750 program without configuring it first.
2752 Another thing that `configure' can do is to edit the Makefile. If
2753 you do this, the distribution should _not_ contain a file named
2754 `Makefile'. Instead, it should include a file `Makefile.in' which
2755 contains the input used for editing. Once again, this is so that people
2756 won't be able to build the program without configuring it first.
2758 If `configure' does write the `Makefile', then `Makefile' should
2759 have a target named `Makefile' which causes `configure' to be rerun,
2760 setting up the same configuration that was set up last time. The files
2761 that `configure' reads should be listed as dependencies of `Makefile'.
2763 All the files which are output from the `configure' script should
2764 have comments at the beginning explaining that they were generated
2765 automatically using `configure'. This is so that users won't think of
2766 trying to edit them by hand.
2768 The `configure' script should write a file named `config.status'
2769 which describes which configuration options were specified when the
2770 program was last configured. This file should be a shell script which,
2771 if run, will recreate the same configuration.
2773 The `configure' script should accept an option of the form
2774 `--srcdir=DIRNAME' to specify the directory where sources are found (if
2775 it is not the current directory). This makes it possible to build the
2776 program in a separate directory, so that the actual source directory is
2779 If the user does not specify `--srcdir', then `configure' should
2780 check both `.' and `..' to see if it can find the sources. If it finds
2781 the sources in one of these places, it should use them from there.
2782 Otherwise, it should report that it cannot find the sources, and should
2783 exit with nonzero status.
2785 Usually the easy way to support `--srcdir' is by editing a
2786 definition of `VPATH' into the Makefile. Some rules may need to refer
2787 explicitly to the specified source directory. To make this possible,
2788 `configure' can add to the Makefile a variable named `srcdir' whose
2789 value is precisely the specified directory.
2791 The `configure' script should also take an argument which specifies
2792 the type of system to build the program for. This argument should look
2797 For example, a Sun 3 might be `m68k-sun-sunos4.1'.
2799 The `configure' script needs to be able to decode all plausible
2800 alternatives for how to describe a machine. Thus, `sun3-sunos4.1'
2801 would be a valid alias. For many programs, `vax-dec-ultrix' would be
2802 an alias for `vax-dec-bsd', simply because the differences between
2803 Ultrix and BSD are rarely noticeable, but a few programs might need to
2806 There is a shell script called `config.sub' that you can use as a
2807 subroutine to validate system types and canonicalize aliases.
2809 Other options are permitted to specify in more detail the software
2810 or hardware present on the machine, and include or exclude optional
2811 parts of the package:
2813 `--enable-FEATURE[=PARAMETER]'
2814 Configure the package to build and install an optional user-level
2815 facility called FEATURE. This allows users to choose which
2816 optional features to include. Giving an optional PARAMETER of
2817 `no' should omit FEATURE, if it is built by default.
2819 No `--enable' option should *ever* cause one feature to replace
2820 another. No `--enable' option should ever substitute one useful
2821 behavior for another useful behavior. The only proper use for
2822 `--enable' is for questions of whether to build part of the program
2826 The package PACKAGE will be installed, so configure this package
2827 to work with PACKAGE.
2829 Possible values of PACKAGE include `gnu-as' (or `gas'), `gnu-ld',
2830 `gnu-libc', `gdb', `x', and `x-toolkit'.
2832 Do not use a `--with' option to specify the file name to use to
2833 find certain files. That is outside the scope of what `--with'
2837 The target machine has no floating point processor.
2840 The target machine assembler is GAS, the GNU assembler. This is
2841 obsolete; users should use `--with-gnu-as' instead.
2844 The target machine has the X Window System installed. This is
2845 obsolete; users should use `--with-x' instead.
2847 All `configure' scripts should accept all of these "detail" options,
2848 whether or not they make any difference to the particular package at
2849 hand. In particular, they should accept any option that starts with
2850 `--with-' or `--enable-'. This is so users will be able to configure
2851 an entire GNU source tree at once with a single set of options.
2853 You will note that the categories `--with-' and `--enable-' are
2854 narrow: they *do not* provide a place for any sort of option you might
2855 think of. That is deliberate. We want to limit the possible
2856 configuration options in GNU software. We do not want GNU programs to
2857 have idiosyncratic configuration options.
2859 Packages that perform part of the compilation process may support
2860 cross-compilation. In such a case, the host and target machines for
2861 the program may be different. The `configure' script should normally
2862 treat the specified type of system as both the host and the target,
2863 thus producing a program which works for the same type of machine that
2866 The way to build a cross-compiler, cross-assembler, or what have
2867 you, is to specify the option `--host=HOSTTYPE' when running
2868 `configure'. This specifies the host system without changing the type
2869 of target system. The syntax for HOSTTYPE is the same as described
2872 Bootstrapping a cross-compiler requires compiling it on a machine
2873 other than the host it will run on. Compilation packages accept a
2874 configuration option `--build=HOSTTYPE' for specifying the
2875 configuration on which you will compile them, in case that is different
2878 Programs for which cross-operation is not meaningful need not accept
2879 the `--host' option, because configuring an entire operating system for
2880 cross-operation is not a meaningful thing.
2882 Some programs have ways of configuring themselves automatically. If
2883 your program is set up to do this, your `configure' script can simply
2884 ignore most of its arguments.
2887 File: standards.info, Node: Makefile Conventions, Next: Releases, Prev: Configuration, Up: Managing Releases
2889 Makefile Conventions
2890 ====================
2892 This node describes conventions for writing the Makefiles for GNU
2897 * Makefile Basics:: General Conventions for Makefiles
2898 * Utilities in Makefiles:: Utilities in Makefiles
2899 * Command Variables:: Variables for Specifying Commands
2900 * Directory Variables:: Variables for Installation Directories
2901 * Standard Targets:: Standard Targets for Users
2902 * Install Command Categories:: Three categories of commands in the `install'
2903 rule: normal, pre-install and post-install.
2906 File: standards.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions
2908 General Conventions for Makefiles
2909 ---------------------------------
2911 Every Makefile should contain this line:
2915 to avoid trouble on systems where the `SHELL' variable might be
2916 inherited from the environment. (This is never a problem with GNU
2919 Different `make' programs have incompatible suffix lists and
2920 implicit rules, and this sometimes creates confusion or misbehavior. So
2921 it is a good idea to set the suffix list explicitly using only the
2922 suffixes you need in the particular Makefile, like this:
2927 The first line clears out the suffix list, the second introduces all
2928 suffixes which may be subject to implicit rules in this Makefile.
2930 Don't assume that `.' is in the path for command execution. When
2931 you need to run programs that are a part of your package during the
2932 make, please make sure that it uses `./' if the program is built as
2933 part of the make or `$(srcdir)/' if the file is an unchanging part of
2934 the source code. Without one of these prefixes, the current search
2937 The distinction between `./' (the "build directory") and
2938 `$(srcdir)/' (the "source directory") is important because users can
2939 build in a separate directory using the `--srcdir' option to
2940 `configure'. A rule of the form:
2942 foo.1 : foo.man sedscript
2943 sed -e sedscript foo.man > foo.1
2945 will fail when the build directory is not the source directory, because
2946 `foo.man' and `sedscript' are in the the source directory.
2948 When using GNU `make', relying on `VPATH' to find the source file
2949 will work in the case where there is a single dependency file, since
2950 the `make' automatic variable `$<' will represent the source file
2951 wherever it is. (Many versions of `make' set `$<' only in implicit
2952 rules.) A Makefile target like
2955 $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o
2957 should instead be written as
2960 $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@
2962 in order to allow `VPATH' to work correctly. When the target has
2963 multiple dependencies, using an explicit `$(srcdir)' is the easiest way
2964 to make the rule work well. For example, the target above for `foo.1'
2967 foo.1 : foo.man sedscript
2968 sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@
2970 GNU distributions usually contain some files which are not source
2971 files--for example, Info files, and the output from Autoconf, Automake,
2972 Bison or Flex. Since these files normally appear in the source
2973 directory, they should always appear in the source directory, not in the
2974 build directory. So Makefile rules to update them should put the
2975 updated files in the source directory.
2977 However, if a file does not appear in the distribution, then the
2978 Makefile should not put it in the source directory, because building a
2979 program in ordinary circumstances should not modify the source directory
2982 Try to make the build and installation targets, at least (and all
2983 their subtargets) work correctly with a parallel `make'.
2986 File: standards.info, Node: Utilities in Makefiles, Next: Command Variables, Prev: Makefile Basics, Up: Makefile Conventions
2988 Utilities in Makefiles
2989 ----------------------
2991 Write the Makefile commands (and any shell scripts, such as
2992 `configure') to run in `sh', not in `csh'. Don't use any special
2993 features of `ksh' or `bash'.
2995 The `configure' script and the Makefile rules for building and
2996 installation should not use any utilities directly except these:
2998 cat cmp cp diff echo egrep expr false grep install-info
2999 ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true
3001 The compression program `gzip' can be used in the `dist' rule.
3003 Stick to the generally supported options for these programs. For
3004 example, don't use `mkdir -p', convenient as it may be, because most
3005 systems don't support it.
3007 It is a good idea to avoid creating symbolic links in makefiles,
3008 since a few systems don't support them.
3010 The Makefile rules for building and installation can also use
3011 compilers and related programs, but should do so via `make' variables
3012 so that the user can substitute alternatives. Here are some of the
3015 ar bison cc flex install ld ldconfig lex
3016 make makeinfo ranlib texi2dvi yacc
3018 Use the following `make' variables to run those programs:
3020 $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX)
3021 $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
3023 When you use `ranlib' or `ldconfig', you should make sure nothing
3024 bad happens if the system does not have the program in question.
3025 Arrange to ignore an error from that command, and print a message before
3026 the command to tell the user that failure of this command does not mean
3027 a problem. (The Autoconf `AC_PROG_RANLIB' macro can help with this.)
3029 If you use symbolic links, you should implement a fallback for
3030 systems that don't have symbolic links.
3032 Additional utilities that can be used via Make variables are:
3034 chgrp chmod chown mknod
3036 It is ok to use other utilities in Makefile portions (or scripts)
3037 intended only for particular systems where you know those utilities
3041 File: standards.info, Node: Command Variables, Next: Directory Variables, Prev: Utilities in Makefiles, Up: Makefile Conventions
3043 Variables for Specifying Commands
3044 ---------------------------------
3046 Makefiles should provide variables for overriding certain commands,
3049 In particular, you should run most utility programs via variables.
3050 Thus, if you use Bison, have a variable named `BISON' whose default
3051 value is set with `BISON = bison', and refer to it with `$(BISON)'
3052 whenever you need to use Bison.
3054 File management utilities such as `ln', `rm', `mv', and so on, need
3055 not be referred to through variables in this way, since users don't
3056 need to replace them with other programs.
3058 Each program-name variable should come with an options variable that
3059 is used to supply options to the program. Append `FLAGS' to the
3060 program-name variable name to get the options variable name--for
3061 example, `BISONFLAGS'. (The names `CFLAGS' for the C compiler,
3062 `YFLAGS' for yacc, and `LFLAGS' for lex, are exceptions to this rule,
3063 but we keep them because they are standard.) Use `CPPFLAGS' in any
3064 compilation command that runs the preprocessor, and use `LDFLAGS' in
3065 any compilation command that does linking as well as in any direct use
3068 If there are C compiler options that _must_ be used for proper
3069 compilation of certain files, do not include them in `CFLAGS'. Users
3070 expect to be able to specify `CFLAGS' freely themselves. Instead,
3071 arrange to pass the necessary options to the C compiler independently
3072 of `CFLAGS', by writing them explicitly in the compilation commands or
3073 by defining an implicit rule, like this:
3076 ALL_CFLAGS = -I. $(CFLAGS)
3078 $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
3080 Do include the `-g' option in `CFLAGS', because that is not
3081 _required_ for proper compilation. You can consider it a default that
3082 is only recommended. If the package is set up so that it is compiled
3083 with GCC by default, then you might as well include `-O' in the default
3084 value of `CFLAGS' as well.
3086 Put `CFLAGS' last in the compilation command, after other variables
3087 containing compiler options, so the user can use `CFLAGS' to override
3090 `CFLAGS' should be used in every invocation of the C compiler, both
3091 those which do compilation and those which do linking.
3093 Every Makefile should define the variable `INSTALL', which is the
3094 basic command for installing a file into the system.
3096 Every Makefile should also define the variables `INSTALL_PROGRAM'
3097 and `INSTALL_DATA'. (The default for each of these should be
3098 `$(INSTALL)'.) Then it should use those variables as the commands for
3099 actual installation, for executables and nonexecutables respectively.
3100 Use these variables as follows:
3102 $(INSTALL_PROGRAM) foo $(bindir)/foo
3103 $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a
3105 Optionally, you may prepend the value of `DESTDIR' to the target
3106 filename. Doing this allows the installer to create a snapshot of the
3107 installation to be copied onto the real target filesystem later. Do not
3108 set the value of `DESTDIR' in your Makefile, and do not include it in
3109 any installed files. With support for `DESTDIR', the above examples
3112 $(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo
3113 $(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a
3115 Always use a file name, not a directory name, as the second argument of
3116 the installation commands. Use a separate command for each file to be
3120 File: standards.info, Node: Directory Variables, Next: Standard Targets, Prev: Command Variables, Up: Makefile Conventions
3122 Variables for Installation Directories
3123 --------------------------------------
3125 Installation directories should always be named by variables, so it
3126 is easy to install in a nonstandard place. The standard names for these
3127 variables are described below. They are based on a standard filesystem
3128 layout; variants of it are used in SVR4, 4.4BSD, Linux, Ultrix v4, and
3129 other modern operating systems.
3131 These two variables set the root for the installation. All the other
3132 installation directories should be subdirectories of one of these two,
3133 and nothing should be directly installed into these two directories.
3136 A prefix used in constructing the default values of the variables
3137 listed below. The default value of `prefix' should be
3138 `/usr/local'. When building the complete GNU system, the prefix
3139 will be empty and `/usr' will be a symbolic link to `/'. (If you
3140 are using Autoconf, write it as `@prefix@'.)
3142 Running `make install' with a different value of `prefix' from the
3143 one used to build the program should NOT recompile the program.
3146 A prefix used in constructing the default values of some of the
3147 variables listed below. The default value of `exec_prefix' should
3148 be `$(prefix)'. (If you are using Autoconf, write it as
3151 Generally, `$(exec_prefix)' is used for directories that contain
3152 machine-specific files (such as executables and subroutine
3153 libraries), while `$(prefix)' is used directly for other
3156 Running `make install' with a different value of `exec_prefix'
3157 from the one used to build the program should NOT recompile the
3160 Executable programs are installed in one of the following
3164 The directory for installing executable programs that users can
3165 run. This should normally be `/usr/local/bin', but write it as
3166 `$(exec_prefix)/bin'. (If you are using Autoconf, write it as
3170 The directory for installing executable programs that can be run
3171 from the shell, but are only generally useful to system
3172 administrators. This should normally be `/usr/local/sbin', but
3173 write it as `$(exec_prefix)/sbin'. (If you are using Autoconf,
3174 write it as `@sbindir@'.)
3177 The directory for installing executable programs to be run by other
3178 programs rather than by users. This directory should normally be
3179 `/usr/local/libexec', but write it as `$(exec_prefix)/libexec'.
3180 (If you are using Autoconf, write it as `@libexecdir@'.)
3182 Data files used by the program during its execution are divided into
3183 categories in two ways.
3185 * Some files are normally modified by programs; others are never
3186 normally modified (though users may edit some of these).
3188 * Some files are architecture-independent and can be shared by all
3189 machines at a site; some are architecture-dependent and can be
3190 shared only by machines of the same kind and operating system;
3191 others may never be shared between two machines.
3193 This makes for six different possibilities. However, we want to
3194 discourage the use of architecture-dependent files, aside from object
3195 files and libraries. It is much cleaner to make other data files
3196 architecture-independent, and it is generally not hard.
3198 Therefore, here are the variables Makefiles should use to specify
3202 The directory for installing read-only architecture independent
3203 data files. This should normally be `/usr/local/share', but write
3204 it as `$(prefix)/share'. (If you are using Autoconf, write it as
3205 `@datadir@'.) As a special exception, see `$(infodir)' and
3206 `$(includedir)' below.
3209 The directory for installing read-only data files that pertain to a
3210 single machine-that is to say, files for configuring a host.
3211 Mailer and network configuration files, `/etc/passwd', and so
3212 forth belong here. All the files in this directory should be
3213 ordinary ASCII text files. This directory should normally be
3214 `/usr/local/etc', but write it as `$(prefix)/etc'. (If you are
3215 using Autoconf, write it as `@sysconfdir@'.)
3217 Do not install executables here in this directory (they probably
3218 belong in `$(libexecdir)' or `$(sbindir)'). Also do not install
3219 files that are modified in the normal course of their use (programs
3220 whose purpose is to change the configuration of the system
3221 excluded). Those probably belong in `$(localstatedir)'.
3224 The directory for installing architecture-independent data files
3225 which the programs modify while they run. This should normally be
3226 `/usr/local/com', but write it as `$(prefix)/com'. (If you are
3227 using Autoconf, write it as `@sharedstatedir@'.)
3230 The directory for installing data files which the programs modify
3231 while they run, and that pertain to one specific machine. Users
3232 should never need to modify files in this directory to configure
3233 the package's operation; put such configuration information in
3234 separate files that go in `$(datadir)' or `$(sysconfdir)'.
3235 `$(localstatedir)' should normally be `/usr/local/var', but write
3236 it as `$(prefix)/var'. (If you are using Autoconf, write it as
3240 The directory for object files and libraries of object code. Do
3241 not install executables here, they probably ought to go in
3242 `$(libexecdir)' instead. The value of `libdir' should normally be
3243 `/usr/local/lib', but write it as `$(exec_prefix)/lib'. (If you
3244 are using Autoconf, write it as `@libdir@'.)
3247 The directory for installing the Info files for this package. By
3248 default, it should be `/usr/local/info', but it should be written
3249 as `$(prefix)/info'. (If you are using Autoconf, write it as
3253 The directory for installing any Emacs Lisp files in this package.
3254 By default, it should be `/usr/local/share/emacs/site-lisp', but
3255 it should be written as `$(prefix)/share/emacs/site-lisp'.
3257 If you are using Autoconf, write the default as `@lispdir@'. In
3258 order to make `@lispdir@' work, you need the following lines in
3259 your `configure.in' file:
3261 lispdir='${datadir}/emacs/site-lisp'
3265 The directory for installing header files to be included by user
3266 programs with the C `#include' preprocessor directive. This
3267 should normally be `/usr/local/include', but write it as
3268 `$(prefix)/include'. (If you are using Autoconf, write it as
3271 Most compilers other than GCC do not look for header files in
3272 directory `/usr/local/include'. So installing the header files
3273 this way is only useful with GCC. Sometimes this is not a problem
3274 because some libraries are only really intended to work with GCC.
3275 But some libraries are intended to work with other compilers.
3276 They should install their header files in two places, one
3277 specified by `includedir' and one specified by `oldincludedir'.
3280 The directory for installing `#include' header files for use with
3281 compilers other than GCC. This should normally be `/usr/include'.
3282 (If you are using Autoconf, you can write it as `@oldincludedir@'.)
3284 The Makefile commands should check whether the value of
3285 `oldincludedir' is empty. If it is, they should not try to use
3286 it; they should cancel the second installation of the header files.
3288 A package should not replace an existing header in this directory
3289 unless the header came from the same package. Thus, if your Foo
3290 package provides a header file `foo.h', then it should install the
3291 header file in the `oldincludedir' directory if either (1) there
3292 is no `foo.h' there or (2) the `foo.h' that exists came from the
3295 To tell whether `foo.h' came from the Foo package, put a magic
3296 string in the file--part of a comment--and `grep' for that string.
3298 Unix-style man pages are installed in one of the following:
3301 The top-level directory for installing the man pages (if any) for
3302 this package. It will normally be `/usr/local/man', but you should
3303 write it as `$(prefix)/man'. (If you are using Autoconf, write it
3307 The directory for installing section 1 man pages. Write it as
3311 The directory for installing section 2 man pages. Write it as
3315 *Don't make the primary documentation for any GNU software be a
3316 man page. Write a manual in Texinfo instead. Man pages are just
3317 for the sake of people running GNU software on Unix, which is a
3318 secondary application only.*
3321 The file name extension for the installed man page. This should
3322 contain a period followed by the appropriate digit; it should
3326 The file name extension for installed section 1 man pages.
3329 The file name extension for installed section 2 man pages.
3332 Use these names instead of `manext' if the package needs to
3333 install man pages in more than one section of the manual.
3335 And finally, you should set the following variable:
3338 The directory for the sources being compiled. The value of this
3339 variable is normally inserted by the `configure' shell script.
3340 (If you are using Autconf, use `srcdir = @srcdir@'.)
3344 # Common prefix for installation directories.
3345 # NOTE: This directory must exist when you start the install.
3347 exec_prefix = $(prefix)
3348 # Where to put the executable for the command `gcc'.
3349 bindir = $(exec_prefix)/bin
3350 # Where to put the directories used by the compiler.
3351 libexecdir = $(exec_prefix)/libexec
3352 # Where to put the Info files.
3353 infodir = $(prefix)/info
3355 If your program installs a large number of files into one of the
3356 standard user-specified directories, it might be useful to group them
3357 into a subdirectory particular to that program. If you do this, you
3358 should write the `install' rule to create these subdirectories.
3360 Do not expect the user to include the subdirectory name in the value
3361 of any of the variables listed above. The idea of having a uniform set
3362 of variable names for installation directories is to enable the user to
3363 specify the exact same values for several different GNU packages. In
3364 order for this to be useful, all the packages must be designed so that
3365 they will work sensibly when the user does so.
3368 File: standards.info, Node: Standard Targets, Next: Install Command Categories, Prev: Directory Variables, Up: Makefile Conventions
3370 Standard Targets for Users
3371 --------------------------
3373 All GNU programs should have the following targets in their
3377 Compile the entire program. This should be the default target.
3378 This target need not rebuild any documentation files; Info files
3379 should normally be included in the distribution, and DVI files
3380 should be made only when explicitly asked for.
3382 By default, the Make rules should compile and link with `-g', so
3383 that executable programs have debugging symbols. Users who don't
3384 mind being helpless can strip the executables later if they wish.
3387 Compile the program and copy the executables, libraries, and so on
3388 to the file names where they should reside for actual use. If
3389 there is a simple test to verify that a program is properly
3390 installed, this target should run that test.
3392 Do not strip executables when installing them. Devil-may-care
3393 users can use the `install-strip' target to do that.
3395 If possible, write the `install' target rule so that it does not
3396 modify anything in the directory where the program was built,
3397 provided `make all' has just been done. This is convenient for
3398 building the program under one user name and installing it under
3401 The commands should create all the directories in which files are
3402 to be installed, if they don't already exist. This includes the
3403 directories specified as the values of the variables `prefix' and
3404 `exec_prefix', as well as all subdirectories that are needed. One
3405 way to do this is by means of an `installdirs' target as described
3408 Use `-' before any command for installing a man page, so that
3409 `make' will ignore any errors. This is in case there are systems
3410 that don't have the Unix man page documentation system installed.
3412 The way to install Info files is to copy them into `$(infodir)'
3413 with `$(INSTALL_DATA)' (*note Command Variables::), and then run
3414 the `install-info' program if it is present. `install-info' is a
3415 program that edits the Info `dir' file to add or update the menu
3416 entry for the given Info file; it is part of the Texinfo package.
3417 Here is a sample rule to install an Info file:
3419 $(DESTDIR)$(infodir)/foo.info: foo.info
3421 # There may be a newer info file in . than in srcdir.
3422 -if test -f foo.info; then d=.; \
3423 else d=$(srcdir); fi; \
3424 $(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@; \
3425 # Run install-info only if it exists.
3426 # Use `if' instead of just prepending `-' to the
3427 # line so we notice real errors from install-info.
3428 # We use `$(SHELL) -c' because some shells do not
3429 # fail gracefully when there is an unknown command.
3430 if $(SHELL) -c 'install-info --version' \
3431 >/dev/null 2>&1; then \
3432 install-info --dir-file=$(DESTDIR)$(infodir)/dir \
3433 $(DESTDIR)$(infodir)/foo.info; \
3436 When writing the `install' target, you must classify all the
3437 commands into three categories: normal ones, "pre-installation"
3438 commands and "post-installation" commands. *Note Install Command
3442 Delete all the installed files--the copies that the `install'
3445 This rule should not modify the directories where compilation is
3446 done, only the directories where files are installed.
3448 The uninstallation commands are divided into three categories,
3449 just like the installation commands. *Note Install Command
3453 Like `install', but strip the executable files while installing
3454 them. In many cases, the definition of this target can be very
3458 $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
3461 Normally we do not recommend stripping an executable unless you
3462 are sure the program has no bugs. However, it can be reasonable
3463 to install a stripped executable for actual execution while saving
3464 the unstripped executable elsewhere in case there is a bug.
3467 Delete all files from the current directory that are normally
3468 created by building the program. Don't delete the files that
3469 record the configuration. Also preserve files that could be made
3470 by building, but normally aren't because the distribution comes
3473 Delete `.dvi' files here if they are not part of the distribution.
3476 Delete all files from the current directory that are created by
3477 configuring or building the program. If you have unpacked the
3478 source and built the program without creating any other files,
3479 `make distclean' should leave only the files that were in the
3483 Like `clean', but may refrain from deleting a few files that people
3484 normally don't want to recompile. For example, the `mostlyclean'
3485 target for GCC does not delete `libgcc.a', because recompiling it
3486 is rarely necessary and takes a lot of time.
3489 Delete almost everything from the current directory that can be
3490 reconstructed with this Makefile. This typically includes
3491 everything deleted by `distclean', plus more: C source files
3492 produced by Bison, tags tables, Info files, and so on.
3494 The reason we say "almost everything" is that running the command
3495 `make maintainer-clean' should not delete `configure' even if
3496 `configure' can be remade using a rule in the Makefile. More
3497 generally, `make maintainer-clean' should not delete anything that
3498 needs to exist in order to run `configure' and then begin to build
3499 the program. This is the only exception; `maintainer-clean' should
3500 delete everything else that can be rebuilt.
3502 The `maintainer-clean' target is intended to be used by a
3503 maintainer of the package, not by ordinary users. You may need
3504 special tools to reconstruct some of the files that `make
3505 maintainer-clean' deletes. Since these files are normally
3506 included in the distribution, we don't take care to make them easy
3507 to reconstruct. If you find you need to unpack the full
3508 distribution again, don't blame us.
3510 To help make users aware of this, the commands for the special
3511 `maintainer-clean' target should start with these two:
3513 @echo 'This command is intended for maintainers to use; it'
3514 @echo 'deletes files that may need special tools to rebuild.'
3517 Update a tags table for this program.
3520 Generate any Info files needed. The best way to write the rules
3525 foo.info: foo.texi chap1.texi chap2.texi
3526 $(MAKEINFO) $(srcdir)/foo.texi
3528 You must define the variable `MAKEINFO' in the Makefile. It should
3529 run the `makeinfo' program, which is part of the Texinfo
3532 Normally a GNU distribution comes with Info files, and that means
3533 the Info files are present in the source directory. Therefore,
3534 the Make rule for an info file should update it in the source
3535 directory. When users build the package, ordinarily Make will not
3536 update the Info files because they will already be up to date.
3539 Generate DVI files for all Texinfo documentation. For example:
3543 foo.dvi: foo.texi chap1.texi chap2.texi
3544 $(TEXI2DVI) $(srcdir)/foo.texi
3546 You must define the variable `TEXI2DVI' in the Makefile. It should
3547 run the program `texi2dvi', which is part of the Texinfo
3548 distribution.(1) Alternatively, write just the dependencies, and
3549 allow GNU `make' to provide the command.
3552 Create a distribution tar file for this program. The tar file
3553 should be set up so that the file names in the tar file start with
3554 a subdirectory name which is the name of the package it is a
3555 distribution for. This name can include the version number.
3557 For example, the distribution tar file of GCC version 1.40 unpacks
3558 into a subdirectory named `gcc-1.40'.
3560 The easiest way to do this is to create a subdirectory
3561 appropriately named, use `ln' or `cp' to install the proper files
3562 in it, and then `tar' that subdirectory.
3564 Compress the tar file file with `gzip'. For example, the actual
3565 distribution file for GCC version 1.40 is called `gcc-1.40.tar.gz'.
3567 The `dist' target should explicitly depend on all non-source files
3568 that are in the distribution, to make sure they are up to date in
3569 the distribution. *Note Making Releases: Releases.
3572 Perform self-tests (if any). The user must build the program
3573 before running the tests, but need not install the program; you
3574 should write the self-tests so that they work when the program is
3575 built but not installed.
3577 The following targets are suggested as conventional names, for
3578 programs in which they are useful.
3581 Perform installation tests (if any). The user must build and
3582 install the program before running the tests. You should not
3583 assume that `$(bindir)' is in the search path.
3586 It's useful to add a target named `installdirs' to create the
3587 directories where files are installed, and their parent
3588 directories. There is a script called `mkinstalldirs' which is
3589 convenient for this; you can find it in the Texinfo package. You
3590 can use a rule like this:
3592 # Make sure all installation directories (e.g. $(bindir))
3593 # actually exist by making them if necessary.
3594 installdirs: mkinstalldirs
3595 $(srcdir)/mkinstalldirs $(bindir) $(datadir) \
3596 $(libdir) $(infodir) \
3599 This rule should not modify the directories where compilation is
3600 done. It should do nothing but create installation directories.
3602 ---------- Footnotes ----------
3604 (1) `texi2dvi' uses TeX to do the real work of formatting. TeX is
3605 not distributed with Texinfo.
3608 File: standards.info, Node: Install Command Categories, Prev: Standard Targets, Up: Makefile Conventions
3610 Install Command Categories
3611 --------------------------
3613 When writing the `install' target, you must classify all the
3614 commands into three categories: normal ones, "pre-installation"
3615 commands and "post-installation" commands.
3617 Normal commands move files into their proper places, and set their
3618 modes. They may not alter any files except the ones that come entirely
3619 from the package they belong to.
3621 Pre-installation and post-installation commands may alter other
3622 files; in particular, they can edit global configuration files or data
3625 Pre-installation commands are typically executed before the normal
3626 commands, and post-installation commands are typically run after the
3629 The most common use for a post-installation command is to run
3630 `install-info'. This cannot be done with a normal command, since it
3631 alters a file (the Info directory) which does not come entirely and
3632 solely from the package being installed. It is a post-installation
3633 command because it needs to be done after the normal command which
3634 installs the package's Info files.
3636 Most programs don't need any pre-installation commands, but we have
3637 the feature just in case it is needed.
3639 To classify the commands in the `install' rule into these three
3640 categories, insert "category lines" among them. A category line
3641 specifies the category for the commands that follow.
3643 A category line consists of a tab and a reference to a special Make
3644 variable, plus an optional comment at the end. There are three
3645 variables you can use, one for each category; the variable name
3646 specifies the category. Category lines are no-ops in ordinary execution
3647 because these three Make variables are normally undefined (and you
3648 _should not_ define them in the makefile).
3650 Here are the three possible category lines, each with a comment that
3651 explains what it means:
3653 $(PRE_INSTALL) # Pre-install commands follow.
3654 $(POST_INSTALL) # Post-install commands follow.
3655 $(NORMAL_INSTALL) # Normal commands follow.
3657 If you don't use a category line at the beginning of the `install'
3658 rule, all the commands are classified as normal until the first category
3659 line. If you don't use any category lines, all the commands are
3660 classified as normal.
3662 These are the category lines for `uninstall':
3664 $(PRE_UNINSTALL) # Pre-uninstall commands follow.
3665 $(POST_UNINSTALL) # Post-uninstall commands follow.
3666 $(NORMAL_UNINSTALL) # Normal commands follow.
3668 Typically, a pre-uninstall command would be used for deleting entries
3669 from the Info directory.
3671 If the `install' or `uninstall' target has any dependencies which
3672 act as subroutines of installation, then you should start _each_
3673 dependency's commands with a category line, and start the main target's
3674 commands with a category line also. This way, you can ensure that each
3675 command is placed in the right category regardless of which of the
3676 dependencies actually run.
3678 Pre-installation and post-installation commands should not run any
3679 programs except for these:
3681 [ basename bash cat chgrp chmod chown cmp cp dd diff echo
3682 egrep expand expr false fgrep find getopt grep gunzip gzip
3683 hostname install install-info kill ldconfig ln ls md5sum
3684 mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee
3685 test touch true uname xargs yes
3687 The reason for distinguishing the commands in this way is for the
3688 sake of making binary packages. Typically a binary package contains
3689 all the executables and other files that need to be installed, and has
3690 its own method of installing them--so it does not need to run the normal
3691 installation commands. But installing the binary package does need to
3692 execute the pre-installation and post-installation commands.
3694 Programs to build binary packages work by extracting the
3695 pre-installation and post-installation commands. Here is one way of
3696 extracting the pre-installation commands:
3698 make -n install -o all \
3699 PRE_INSTALL=pre-install \
3700 POST_INSTALL=post-install \
3701 NORMAL_INSTALL=normal-install \
3702 | gawk -f pre-install.awk
3704 where the file `pre-install.awk' could contain this:
3706 $0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ {on = 0}
3708 $0 ~ /^\t[ \t]*pre_install[ \t]*$/ {on = 1}
3710 The resulting file of pre-installation commands is executed as a
3711 shell script as part of installing the binary package.
3714 File: standards.info, Node: Releases, Prev: Makefile Conventions, Up: Managing Releases
3719 Package the distribution of `Foo version 69.96' up in a gzipped tar
3720 file with the name `foo-69.96.tar.gz'. It should unpack into a
3721 subdirectory named `foo-69.96'.
3723 Building and installing the program should never modify any of the
3724 files contained in the distribution. This means that all the files
3725 that form part of the program in any way must be classified into "source
3726 files" and "non-source files". Source files are written by humans and
3727 never changed automatically; non-source files are produced from source
3728 files by programs under the control of the Makefile.
3730 Naturally, all the source files must be in the distribution. It is
3731 okay to include non-source files in the distribution, provided they are
3732 up-to-date and machine-independent, so that building the distribution
3733 normally will never modify them. We commonly include non-source files
3734 produced by Bison, `lex', TeX, and `makeinfo'; this helps avoid
3735 unnecessary dependencies between our distributions, so that users can
3736 install whichever packages they want to install.
3738 Non-source files that might actually be modified by building and
3739 installing the program should *never* be included in the distribution.
3740 So if you do distribute non-source files, always make sure they are up
3741 to date when you make a new distribution.
3743 Make sure that the directory into which the distribution unpacks (as
3744 well as any subdirectories) are all world-writable (octal mode 777).
3745 This is so that old versions of `tar' which preserve the ownership and
3746 permissions of the files from the tar archive will be able to extract
3747 all the files even if the user is unprivileged.
3749 Make sure that all the files in the distribution are world-readable.
3751 Make sure that no file name in the distribution is more than 14
3752 characters long. Likewise, no file created by building the program
3753 should have a name longer than 14 characters. The reason for this is
3754 that some systems adhere to a foolish interpretation of the POSIX
3755 standard, and refuse to open a longer name, rather than truncating as
3756 they did in the past.
3758 Don't include any symbolic links in the distribution itself. If the
3759 tar file contains symbolic links, then people cannot even unpack it on
3760 systems that don't support symbolic links. Also, don't use multiple
3761 names for one file in different directories, because certain file
3762 systems cannot handle this and that prevents unpacking the distribution.
3764 Try to make sure that all the file names will be unique on MS-DOS. A
3765 name on MS-DOS consists of up to 8 characters, optionally followed by a
3766 period and up to three characters. MS-DOS will truncate extra
3767 characters both before and after the period. Thus, `foobarhacker.c'
3768 and `foobarhacker.o' are not ambiguous; they are truncated to
3769 `foobarha.c' and `foobarha.o', which are distinct.
3771 Include in your distribution a copy of the `texinfo.tex' you used to
3772 test print any `*.texinfo' or `*.texi' files.
3774 Likewise, if your program uses small GNU software packages like
3775 regex, getopt, obstack, or termcap, include them in the distribution
3776 file. Leaving them out would make the distribution file a little
3777 smaller at the expense of possible inconvenience to a user who doesn't
3778 know what other files to get.
3784 Node: Preface
\x7f1505
3785 Node: Intellectual Property
\x7f2532
3786 Node: Reading Non-Free Code
\x7f2907
3787 Node: Contributions
\x7f4639
3788 Node: Design Advice
\x7f6633
3789 Node: Compatibility
\x7f7150
3790 Node: Using Extensions
\x7f8661
3791 Node: ANSI C
\x7f10163
3792 Node: Source Language
\x7f11399
3793 Node: Program Behavior
\x7f12892
3794 Node: Semantics
\x7f13601
3795 Node: Libraries
\x7f17355
3796 Node: Errors
\x7f18590
3797 Node: User Interfaces
\x7f19813
3798 Node: Option Table
\x7f26559
3799 Node: Memory Usage
\x7f40648
3800 Node: Writing C
\x7f41642
3801 Node: Formatting
\x7f42483
3802 Node: Comments
\x7f45755
3803 Node: Syntactic Conventions
\x7f49053
3804 Node: Names
\x7f51991
3805 Node: System Portability
\x7f53727
3806 Node: CPU Portability
\x7f55503
3807 Node: System Functions
\x7f57664
3808 Node: Internationalization
\x7f62768
3810 Node: Documentation
\x7f66621
3811 Node: GNU Manuals
\x7f67179
3812 Node: Manual Structure Details
\x7f71066
3813 Node: NEWS File
\x7f72396
3814 Node: Change Logs
\x7f73077
3815 Node: Change Log Concepts
\x7f73794
3816 Node: Style of Change Logs
\x7f75562
3817 Node: Simple Changes
\x7f77116
3818 Node: Conditional Changes
\x7f78307
3819 Node: Man Pages
\x7f79684
3820 Node: Reading other Manuals
\x7f81303
3821 Node: Managing Releases
\x7f82087
3822 Node: Configuration
\x7f82823
3823 Node: Makefile Conventions
\x7f89763
3824 Node: Makefile Basics
\x7f90443
3825 Node: Utilities in Makefiles
\x7f93612
3826 Node: Command Variables
\x7f95748
3827 Node: Directory Variables
\x7f99249
3828 Node: Standard Targets
\x7f110126
3829 Ref: Standard Targets-Footnote-1
\x7f120565
3830 Node: Install Command Categories
\x7f120665
3831 Node: Releases
\x7f125238