Changeset 503 for trunk/src/gmake/doc/make-stds.texi
- Timestamp:
- Sep 15, 2006, 7:09:38 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/doc/make-stds.texi
r151 r503 9 9 @cindex standards for makefiles 10 10 11 @c Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001 Free12 @c Software Foundation, Inc.11 @c Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 12 @c 2004, 2005 Free Software Foundation, Inc. 13 13 14 14 @c Permission is granted to copy, distribute and/or modify this document … … 294 294 Installation directories should always be named by variables, so it is 295 295 easy to install in a nonstandard place. The standard names for these 296 variables are described below. They are based on a standard filesystem 297 layout; variants of it are used in SVR4, 4.4BSD, GNU/Linux, Ultrix v4, 298 and other modern operating systems. 296 variables and the values they should have in GNU packages are 297 described below. They are based on a standard filesystem layout; 298 variants of it are used in GNU/Linux and other modern operating 299 systems. 300 301 Installers are expected to override these values when calling 302 @command{make} (e.g., @kbd{make prefix=/usr install} or 303 @command{configure} (e.g., @kbd{configure --prefix=/usr}). GNU 304 packages should not try to guess which value should be appropriate for 305 these variables on the system they are being installed onto: use the 306 default settings specified here so that all GNU packages behave 307 identically, allowing the installer to achieve any desired layout. 299 308 300 309 These two variables set the root for the installation. All the other … … 356 365 @file{/usr/local/libexec}, but write it as @file{$(exec_prefix)/libexec}. 357 366 (If you are using Autoconf, write it as @samp{@@libexecdir@@}.) 367 368 The definition of @samp{libexecdir} is the same for all packages, so 369 you should install your data in a subdirectory thereof. Most packages 370 install their data under @file{$(libexecdir)/@var{package-name}/}, 371 possibly within additional subdirectories thereof, such as 372 @file{$(libexecdir)/@var{package-name}/@var{machine}/@var{version}}. 358 373 @end table 359 374 … … 378 393 architecture-independent, and it is generally not hard. 379 394 380 Therefore, here are the variables Makefiles should use to specify 381 directories:395 Here are the variables Makefiles should use to specify directories 396 to put these various kinds of files in: 382 397 383 398 @table @samp 399 @item datarootdir 400 The root of the directory tree for read-only architecture-independent 401 data files. This should normally be @file{/usr/local/share}, but 402 write it as @file{$(prefix)/share}. (If you are using Autoconf, write 403 it as @samp{@@datarootdir@@}.) @samp{datadir}'s default value is 404 based on this variable; so are @samp{infodir}, @samp{mandir}, and 405 others. 406 384 407 @item datadir 385 The directory for installing read-only architecture independent data 386 files. This should normally be @file{/usr/local/share}, but write it as 387 @file{$(prefix)/share}. 388 (If you are using Autoconf, write it as @samp{@@datadir@@}.) 389 As a special exception, see @file{$(infodir)} 390 and @file{$(includedir)} below. 408 The directory for installing idiosyncratic read-only 409 architecture-independent data files for this program. This is usually 410 the same place as @samp{datarootdir}, but we use the two separate 411 variables so that you can move these program-specific files without 412 altering the location for Info files, man pages, etc. 413 414 This should normally be @file{/usr/local/share}, but write it as 415 @file{$(datarootdir)}. (If you are using Autoconf, write it as 416 @samp{@@datadir@@}.) 417 418 The definition of @samp{datadir} is the same for all packages, so you 419 should install your data in a subdirectory thereof. Most packages 420 install their data under @file{$(datadir)/@var{package-name}/}. 391 421 392 422 @item sysconfdir … … 420 450 @file{$(prefix)/var}. 421 451 (If you are using Autoconf, write it as @samp{@@localstatedir@@}.) 422 423 @item libdir 424 The directory for object files and libraries of object code. Do not 425 install executables here, they probably ought to go in @file{$(libexecdir)} 426 instead. The value of @code{libdir} should normally be 427 @file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}. 428 (If you are using Autoconf, write it as @samp{@@libdir@@}.) 429 430 @item infodir 431 The directory for installing the Info files for this package. By 432 default, it should be @file{/usr/local/info}, but it should be written 433 as @file{$(prefix)/info}. 434 (If you are using Autoconf, write it as @samp{@@infodir@@}.) 435 436 @item lispdir 437 The directory for installing any Emacs Lisp files in this package. By 438 default, it should be @file{/usr/local/share/emacs/site-lisp}, but it 439 should be written as @file{$(prefix)/share/emacs/site-lisp}. 440 441 If you are using Autoconf, write the default as @samp{@@lispdir@@}. 442 In order to make @samp{@@lispdir@@} work, you need the following lines 443 in your @file{configure.in} file: 444 445 @example 446 lispdir='$@{datadir@}/emacs/site-lisp' 447 AC_SUBST(lispdir) 448 @end example 449 452 @end table 453 454 These variables specify the directory for installing certain specific 455 types of files, if your program has them. Every GNU package should 456 have Info files, so every program needs @samp{infodir}, but not all 457 need @samp{libdir} or @samp{lispdir}. 458 459 @table @samp 450 460 @item includedir 451 461 @c rewritten to avoid overfull hbox --roland … … 482 492 To tell whether @file{foo.h} came from the Foo package, put a magic 483 493 string in the file---part of a comment---and @code{grep} for that string. 494 495 @item docdir 496 The directory for installing documentation files (other than Info) for 497 this package. By default, it should be 498 @file{/usr/local/share/doc/@var{yourpkg}}, but it should be written as 499 @file{$(datarootdir)/doc/@var{yourpkg}}. (If you are using Autoconf, 500 write it as @samp{@@docdir@@}.) The @var{yourpkg} subdirectory, which 501 may include a version number, prevents collisions among files with 502 common names, such as @file{README}. 503 504 @item infodir 505 The directory for installing the Info files for this package. By 506 default, it should be @file{/usr/local/share/info}, but it should be 507 written as @file{$(datarootdir)/info}. (If you are using Autoconf, 508 write it as @samp{@@infodir@@}.) @code{infodir} is separate from 509 @code{docdir} for compatibility with existing practice. 510 511 @item htmldir 512 @itemx dvidir 513 @itemx pdfdir 514 @itemx psdir 515 Directories for installing documentation files in the particular 516 format. (It is not required to support documentation in all these 517 formats.) They should all be set to @code{$(docdir)} by default. (If 518 you are using Autoconf, write them as @samp{@@htmldir@@}, 519 @samp{@@dvidir@@}, etc.) Packages which supply several translations 520 of their documentation should install them in 521 @samp{$(htmldir)/}@var{ll}, @samp{$(pdfdir)/}@var{ll}, etc. where 522 @var{ll} is a locale abbreviation such as @samp{en} or @samp{pt_BR}. 523 524 @item libdir 525 The directory for object files and libraries of object code. Do not 526 install executables here, they probably ought to go in @file{$(libexecdir)} 527 instead. The value of @code{libdir} should normally be 528 @file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}. 529 (If you are using Autoconf, write it as @samp{@@libdir@@}.) 530 531 @item lispdir 532 The directory for installing any Emacs Lisp files in this package. By 533 default, it should be @file{/usr/local/share/emacs/site-lisp}, but it 534 should be written as @file{$(datarootdir)/emacs/site-lisp}. 535 536 If you are using Autoconf, write the default as @samp{@@lispdir@@}. 537 In order to make @samp{@@lispdir@@} work, you need the following lines 538 in your @file{configure.in} file: 539 540 @example 541 lispdir='$@{datarootdir@}/emacs/site-lisp' 542 AC_SUBST(lispdir) 543 @end example 544 545 @item localedir 546 The directory for installing locale-specific message catalogs for this 547 package. By default, it should be @file{/usr/local/share/locale}, but 548 it should be written as @file{$(datarootdir)/locale}. (If you are 549 using Autoconf, write it as @samp{@@localedir@@}.) This directory 550 usually has a subdirectory per locale. 484 551 @end table 485 552 … … 489 556 @item mandir 490 557 The top-level directory for installing the man pages (if any) for this 491 package. It will normally be @file{/usr/local/ man}, but you should492 write it as @file{$(prefix)/man}. 493 (If you are usingAutoconf, write it as @samp{@@mandir@@}.)558 package. It will normally be @file{/usr/local/share/man}, but you 559 should write it as @file{$(datarootdir)/man}. (If you are using 560 Autoconf, write it as @samp{@@mandir@@}.) 494 561 495 562 @item man1dir … … 536 603 # NOTE: This directory must exist when you start the install. 537 604 prefix = /usr/local 605 datarootdir = $(prefix)/share 606 datadir = $(datarootdir) 538 607 exec_prefix = $(prefix) 539 608 # Where to put the executable for the command `gcc'. … … 542 611 libexecdir = $(exec_prefix)/libexec 543 612 # Where to put the Info files. 544 infodir = $( prefix)/info613 infodir = $(datarootdir)/info 545 614 @end smallexample 546 615 … … 631 700 Categories}. 632 701 702 @item install-html 703 @itemx install-dvi 704 @itemx install-pdf 705 @itemx install-ps 706 These targets install documentation in formats other than Info; 707 they're intended to be called explicitly by the person installing the 708 package, if that format is desired. GNU prefers Info files, so these 709 must be installed by the @code{install} target. 710 711 When you have many documentation files to install, we recommend that 712 you avoid collisions and clutter by arranging for these targets to 713 install in subdirectories of the appropriate installation directory, 714 such as @code{htmldir}. As one example, if your package has multiple 715 manuals, and you wish to install HTML documentation with many files 716 (such as the ``split'' mode output by @code{makeinfo --html}), you'll 717 certainly want to use subdirectories, or two nodes with the same name 718 in different manuals will overwrite each other. 719 633 720 @item uninstall 634 721 Delete all the installed files---the copies that the @samp{install} 635 target creates.722 and @samp{install-*} targets create. 636 723 637 724 This rule should not modify the directories where compilation is done, … … 669 756 @item clean 670 757 671 Delete all files from the current directory that are normally created by 672 building the program. Don't delete the files that record the 673 configuration. Also preserve files that could be made by building, but 674 normally aren't because the distribution comes with them. 758 Delete all files in the current directory that are normally created by 759 building the program. Also delete files in other directories if they 760 are created by this makefile. However, don't delete the files that 761 record the configuration. Also preserve files that could be made by 762 building, but normally aren't because the distribution comes with 763 them. There is no need to delete parent directories that were created 764 with @samp{mkdir -p}, since they could have existed anyway. 675 765 676 766 Delete @file{.dvi} files here if they are not part of the distribution. 677 767 678 768 @item distclean 679 Delete all files from the current directory that are created by 680 configuring or building the program. If you have unpacked the source 681 and built the program without creating any other files, @samp{make 682 distclean} should leave only the files that were in the distribution. 769 Delete all files in the current directory (or created by this 770 makefile) that are created by configuring or building the program. If 771 you have unpacked the source and built the program without creating 772 any other files, @samp{make distclean} should leave only the files 773 that were in the distribution. However, there is no need to delete 774 parent directories that were created with @samp{mkdir -p}, since they 775 could have existed anyway. 683 776 684 777 @item mostlyclean … … 689 782 690 783 @item maintainer-clean 691 Delete almost everything from the current directory that can be692 reconstructed with this Makefile. This typically includes everything 693 deleted by @code{distclean}, plus more: C source files produced by 694 Bison, tags tables, Info files, andso on.784 Delete almost everything that can be reconstructed with this Makefile. 785 This typically includes everything deleted by @code{distclean}, plus 786 more: C source files produced by Bison, tags tables, Info files, and 787 so on. 695 788 696 789 The reason we say ``almost everything'' is that running the command 697 @samp{make maintainer-clean} should not delete @file{configure} even if 698 @file{configure} can be remade using a rule in the Makefile. More generally, 699 @samp{make maintainer-clean} should not delete anything that needs to 700 exist in order to run @file{configure} and then begin to build the 701 program. This is the only exception; @code{maintainer-clean} should 702 delete everything else that can be rebuilt. 790 @samp{make maintainer-clean} should not delete @file{configure} even 791 if @file{configure} can be remade using a rule in the Makefile. More 792 generally, @samp{make maintainer-clean} should not delete anything 793 that needs to exist in order to run @file{configure} and then begin to 794 build the program. Also, there is no need to delete parent 795 directories that were created with @samp{mkdir -p}, since they could 796 have existed anyway. These are the only exceptions; 797 @code{maintainer-clean} should delete everything else that can be 798 rebuilt. 703 799 704 800 The @samp{maintainer-clean} target is intended to be used by a maintainer of … … 744 840 745 841 @item dvi 746 Generate DVI files for all Texinfo documentation. 747 For example: 842 @itemx html 843 @itemx pdf 844 @itemx ps 845 Generate documentation files in the given format, if possible. 846 Here's an example rule for generating DVI files from Texinfo: 748 847 749 848 @smallexample … … 760 859 of formatting. @TeX{} is not distributed with Texinfo.} Alternatively, 761 860 write just the dependencies, and allow GNU @code{make} to provide the command. 861 862 Here's another example, this one for generating HTML from Texinfo: 863 864 @smallexample 865 html: foo.html 866 867 foo.html: foo.texi chap1.texi chap2.texi 868 $(TEXI2HTML) $(srcdir)/foo.texi 869 @end smallexample 870 871 @noindent 872 Again, you would define the variable @code{TEXI2HTML} in the Makefile; 873 for example, it might run @code{makeinfo --no-split --html} 874 (@command{makeinfo} is part of the Texinfo distribution). 762 875 763 876 @item dist … … 933 1046 Programs to build binary packages work by extracting the 934 1047 pre-installation and post-installation commands. Here is one way of 935 extracting the pre-installation commands: 936 937 @smallexample 938 make -n install -o all \ 1048 extracting the pre-installation commands (the @option{-s} option to 1049 @command{make} is needed to silence messages about entering 1050 subdirectories): 1051 1052 @smallexample 1053 make -s -n install -o all \ 939 1054 PRE_INSTALL=pre-install \ 940 1055 POST_INSTALL=post-install \ … … 947 1062 948 1063 @smallexample 949 $0 ~ /^ \t[ \t]*(normal_install|post_install)[ \t]*$/ @{on = 0@}1064 $0 ~ /^(normal-install|post-install)[ \t]*$/ @{on = 0@} 950 1065 on @{print $0@} 951 $0 ~ /^\t[ \t]*pre_install[ \t]*$/ @{on = 1@} 952 @end smallexample 953 954 The resulting file of pre-installation commands is executed as a shell 955 script as part of installing the binary package. 1066 $0 ~ /^pre-install[ \t]*$/ @{on = 1@} 1067 @end smallexample
Note:
See TracChangeset
for help on using the changeset viewer.