Chapter 15: Makefile Conventions 161
generated. These targets should not be dependencies of the all target; the
user must manually invoke them.
Here’s an example rule for generating DVI files from Texinfo:
dvi: foo.dvi
foo.dvi: foo.texi chap1.texi chap2.texi
$(TEXI2DVI) $(srcdir)/foo.texi
You must define the variable TEXI2DVI in the Makefile. It should run the
program texi2dvi, which is part of the Texinfo distribution. (texi2dvi uses
T
E
X to do the real work of formatting. T
E
X is not distributed with Texinfo.)
Alternatively, write only the dependencies, and allow GNU make to provide the
command.
Here’s another example, this one for generating HTML from Texinfo:
html: foo.html
foo.html: foo.texi chap1.texi chap2.texi
$(TEXI2HTML) $(srcdir)/foo.texi
Again, you would define the variable TEXI2HTML in the Makefile; for example,
it might run makeinfo --no-split --html (makeinfo is part of the Texinfo
distribution).
‘dist’ Create a distribution tar file for this program. The tar file should be set up so
that the file names in the tar file start with a subdirectory name which is the
name of the package it is a distribution for. This name can include the version
number.
For example, the distribution tar file of GCC version 1.40 unpacks into a sub-
directory named gcc-1.40.
The easiest way to do this is to create a subdirectory appropriately named, use
ln or cp to install the proper files in it, and then tar that subdirectory.
Compress the tar file with gzip. For example, the actual distribution file for
GCC version 1.40 is called gcc-1.40.tar.gz. It is ok to support other free
compression formats as well.
The dist target should explicitly depend on all non-source files that are in the
distribution, to make sure they are up to date in the distribution. See Section
“Making Releases” in GNU Coding Standards.
‘check’ Perform self-tests (if any). The user must build the program before running
the tests, but need not install the program; you should write the self-tests so
that they work when the program is built but not installed.
The following targets are suggested as conventional names, for programs in which they
are useful.
installcheck
Perform installation tests (if any). The user must build and install the program
before running the tests. You should not assume that $(bindir) is in the
search path.
Comentarios a estos manuales