Talk about which dir Info files, Bison output, etc. should go in.

Add some more utilities that can be used in make commands.
This commit is contained in:
Richard M. Stallman 1996-11-07 22:30:30 +00:00
parent 78a4848b83
commit a1eb3e67cd

View file

@ -67,9 +67,10 @@ part of the make or @file{$(srcdir)/} if the file is an unchanging part
of the source code. Without one of these prefixes, the current search of the source code. Without one of these prefixes, the current search
path is used. path is used.
The distinction between @file{./} and @file{$(srcdir)/} is important The distinction between @file{./} (the @dfn{build directory}) and
when using the @samp{--srcdir} option to @file{configure}. A rule of @file{$(srcdir)/} (the @dfn{source directory}) is important because
the form: users can build in a separate directory using the @samp{--srcdir} option
to @file{configure}. A rule of the form:
@smallexample @smallexample
foo.1 : foo.man sedscript foo.1 : foo.man sedscript
@ -77,9 +78,8 @@ foo.1 : foo.man sedscript
@end smallexample @end smallexample
@noindent @noindent
will fail when the current directory is not the source directory, will fail when the build directory is not the source directory, because
because @file{foo.man} and @file{sedscript} are not in the current @file{foo.man} and @file{sedscript} are in the the source directory.
directory.
When using GNU @code{make}, relying on @samp{VPATH} to find the source When using GNU @code{make}, relying on @samp{VPATH} to find the source
file will work in the case where there is a single dependency file, file will work in the case where there is a single dependency file,
@ -111,6 +111,18 @@ foo.1 : foo.man sedscript
sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@ sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@
@end smallexample @end smallexample
GNU distributions usually contain some files which are not source
files---for example, Info files, and the output from Autoconf, Automake,
Bison or Flex. Since these files normally appear in the source
directory, they should always appear in the source directory, not in the
build directory. So Makefile rules to update them should put the
updated files in the source directory.
However, if a file does not appear in the distribution, then the
Makefile should not put it in the source directory, because building a
program in ordinary circumstances should not modify the source directory
in any way.
Try to make the build and installation targets, at least (and all their Try to make the build and installation targets, at least (and all their
subtargets) work correctly with a parallel @code{make}. subtargets) work correctly with a parallel @code{make}.
@ -124,11 +136,17 @@ special features of @code{ksh} or @code{bash}.
The @code{configure} script and the Makefile rules for building and The @code{configure} script and the Makefile rules for building and
installation should not use any utilities directly except these: installation should not use any utilities directly except these:
@c dd find
@c gunzip gzip md5sum
@c mkfifo mknod tee uname
@example @example
cat cmp cp echo egrep expr false grep cat cmp cp diff echo egrep expr false grep install-info
ln mkdir mv pwd rm rmdir sed test touch true ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true
@end example @end example
The compression program @code{gzip} can be used in the @code{dist} rule.
Stick to the generally supported options for these programs. For Stick to the generally supported options for these programs. For
example, don't use @samp{mkdir -p}, convenient as it may be, because example, don't use @samp{mkdir -p}, convenient as it may be, because
most systems don't support it. most systems don't support it.
@ -142,26 +160,33 @@ user can substitute alternatives. Here are some of the programs we
mean: mean:
@example @example
ar bison cc flex install ld lex ar bison cc flex install ld ldconfig lex
make makeinfo ranlib texi2dvi yacc make makeinfo ranlib texi2dvi yacc
@end example @end example
Use the following @code{make} variables: Use the following @code{make} variables to run those programs:
@example @example
$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX) $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX)
$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
@end example @end example
When you use @code{ranlib}, you should make sure nothing bad happens if When you use @code{ranlib} or @code{ldconfig}, you should make sure
the system does not have @code{ranlib}. Arrange to ignore an error nothing bad happens if the system does not have the program in question.
from that command, and print a message before the command to tell the Arrange to ignore an error from that command, and print a message before
user that failure of the @code{ranlib} command does not mean a problem. the command to tell the user that failure of this command does not mean
(The Autoconf @samp{AC_PROG_RANLIB} macro can help with this.) a problem. (The Autoconf @samp{AC_PROG_RANLIB} macro can help with
this.)
If you use symbolic links, you should implement a fallback for systems If you use symbolic links, you should implement a fallback for systems
that don't have symbolic links. that don't have symbolic links.
Additional utilities that can be used via Make variables are:
@example
chgrp chmod chown mknod
@end example
It is ok to use other utilities in Makefile portions (or scripts) It is ok to use other utilities in Makefile portions (or scripts)
intended only for particular systems where you know those utilities intended only for particular systems where you know those utilities
exist. exist.
@ -662,6 +687,12 @@ You must define the variable @code{MAKEINFO} in the Makefile. It should
run the @code{makeinfo} program, which is part of the Texinfo run the @code{makeinfo} program, which is part of the Texinfo
distribution. distribution.
Normally a GNU distribution comes with Info files, and that means the
Info files are present in the source directory. Therefore, the Make
rule for an info file should update it in the source directory. When
users build the package, ordinarily Make will not update the Info files
because they will already be up to date.
@item dvi @item dvi
Generate DVI files for all Texinfo documentation. Generate DVI files for all Texinfo documentation.
For example: For example: