f78
Standard Targets for Users
If possible, write the
The commands should create all the directories in which files are to be
installed, if they dont already exist. This includes the directories specified as
the values of the variables,
Use
The way to install
This rule should not modify the directories where compilation is done, only
the directories where files are installed.
The reason we say almost everything is that
The
To help make users aware of this,
The easiest way to do this is to create a subdirectory appropriately named, use
The following targets are suggested as conventional names, for programs in
which they are useful.
Compile the entire program. This should be the default tar-get. This target
need not rebuild any documentation files; Info files should normally be included
in the distribution, and DVI files should be made only when explicitly asked
for.
Compile the program and copy the executables, libraries, and so on to the file
names where they should reside for actual use. If there is a simple test to
verify that a program is properly installed, this target should run that test.
# There may be a newer info file in . than in srcdir.
-if test -f foo.info; then d=.; \
else d=$(srcdir); fi; \
$(INSTALL_DATA) $$d/foo.info $
ffb
@; \
# Run install-info only if it exists.
# Use if instead of just prepending - to the
# line so we notice real errors from install-info.
# We use $(SHELL) -c because some shells do not
# fail gracefully when there is an unknown command.
if $(SHELL) -c install-info --version \
>/dev/null 2>&1; then \
install-info --infodir=$(infodir) $$d/foo.info; \
else true; fi
Delete all the installed files that the install target would create (but not the non-installed files such as make all would create).
Delete all files from the current directory that are normally created by
building the program. Dont delete the files that record the configuration. Also
preserve files that could be made by building, but normally arent because the
distribution comes with them. Delete .dvi files here if they are not part of the distribution.
Delete all files from the current directory that are created by configuring or
building the program. If you have unpacked the source and built the program
without creating any other files, make distclean should leave only the files that were in the distribution.
Like clean, but may refrain from deleting a few files that people normally dont want
to recompile. For example, the mostlyclean target for GCC does not delete libgcc.a, be-cause recompiling it is rarely necessary and takes a lot of time.
Delete almost everything from the current directory that can be reconstructed
with this Makefile. This typically includes everything deleted by distclean,
plus more: C source files produced by Bison, tags tables, info files, and so on.
to use;
@echo it deletes files that may require special \
tools to rebuild.
Update a tags table for this program.
Generate any Info files needed. The best way to write the rules is as follows.
foo.info: foo.texi chap1.texi chap2.texi $(MAKEINFO)
$(srcdir)/foo.texi
Generate DVI files for all Texinfo documentation. For example:
foo.dvi: foo.texi chap1.texi chap2.texi $(TEXI2DVI)
$(srcdir)/foo.texi
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 i
bee
s 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 subdirectory named gcc-1.40.
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.
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.
Its useful to add a target named installdirs to create the directories where files are installed, and their parent
directories. There is a script called mkinstalldirs which is convenient for this; find it in the Texinfo package.You can use a
rule like this:
# (e.g. $(bindir)) actually exist by
# making them if necessary.
installdirs: mkinstalldirs
$(srcdir)/mkinstalldirs $(bindir) $(datadir) \
$(libdir) $(infodir) \
$(mandir)