home *** CD-ROM | disk | FTP | other *** search
GNU Info File | 1996-10-12 | 21.3 KB | 592 lines |
- This is Info file automake.info, produced by Makeinfo-1.64 from the
- input file /ade-src/fsf/automake/automake.texi.
-
- START-INFO-DIR-ENTRY
- * automake: (automake). Making Makefile.in's
- END-INFO-DIR-ENTRY
-
- This file documents GNU automake 1.1e
-
- Copyright (C) 1995 Free Software Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
- manual provided the copyright notice and this permission notice are
- preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
- this manual under the conditions for verbatim copying, provided that
- the entire resulting derived work is distributed under the terms of a
- permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
- manual into another language, under the above conditions for modified
- versions, except that this permission notice may be stated in a
- translation approved by the Foundation.
-
- File: automake.info, Node: Miscellaneous, Next: Extending, Prev: Options, Up: Top
-
- Miscellaneous Rules
- *******************
-
- There are a few rules and variables that didn't fit anywhere else.
-
- * Menu:
-
- * Tags:: Interfacing to etags and mkid
- * Suffixes:: Handling new file extensions
- * Built:: Built sources
-
- File: automake.info, Node: Tags, Next: Suffixes, Up: Miscellaneous
-
- Interfacing to `etags'
- ======================
-
- `automake' will generate rules to generate `TAGS' files for use with
- GNU Emacs under some circumstances.
-
- If any C source code or headers are present, then a `tags' target
- will be generated for the directory.
-
- At the topmost directory of a multi-directory package, a `tags'
- target file will be generated which, when run, will generate a `TAGS'
- file that includes by reference all `TAGS' files from subdirectories.
-
- Also, if the variable `ETAGS_ARGS' is defined, a `tags' target will
- be generated. This variable is intended for use in directories which
- contain taggable source that `etags' does not understand.
-
- Here is how Automake generates tags for its source, and for nodes in
- its Texinfo file:
-
- ETAGS_ARGS = automake.in --lang=none \
- --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
-
- If you add filenames to ETAGS_ARGS, you will probably also want to
- set TAGS_DEPENDENCIES. The contents of this variable are added
- directly to the dependencies for the `tags' target.
-
- Automake will also generate an `ID' target which will run `mkid' on
- the source. This is only supported on a directory-by-directory basis.
-
- File: automake.info, Node: Suffixes, Next: Built, Prev: Tags, Up: Miscellaneous
-
- Handling new file extensions
- ============================
-
- It is sometimes useful to introduce a new implicit rule to handle a
- file type that Automake does not know about. If this is done, you must
- notify GNU Make of the new suffixes. This can be done by putting a list
- of new suffixes in the `SUFFIXES' variable.
-
- File: automake.info, Node: Built, Prev: Suffixes, Up: Miscellaneous
-
- Built sources
- =============
-
- FIXME write this
-
- File: automake.info, Node: Extending, Next: Distributing, Prev: Miscellaneous, Up: Top
-
- When Automake Isn't Enough
- **************************
-
- Sometimes `automake' isn't enough. Then you just lose.
-
- Actually, `automake's implicit copying semantics means that many
- problems can be worked around by simply adding some `make' targets and
- rules to `Makefile.in'. `automake' will ignore these additions.
-
- There are some caveats to doing this. Although you can overload a
- target already used by `automake', it is often inadvisable,
- particularly in the topmost directory of a non-flat package. However,
- various useful targets have a `-local' version you can specify in your
- `Makefile.in'. Automake will supplement the standard target with these
- user-supplied targets.
-
- The targets that support a local version are `all', `info', `dvi',
- `check', `install-data', `install-exec', and `uninstall'. Note that
- there are no `uninstall-exec-local' or `uninstall-data-local' targets;
- just use `uninstall-local'. It doesn't make sense to uninstall just
- data or just executables.
-
- For instance, here is how to install a file in `/etc':
-
- install-data-local:
- $(INSTALL_DATA) $(srcdir)/afile /etc/afile
-
- Some targets also have a way to run another target, called a "hook",
- after their work is done. The hook is named after the principal target,
- with `-hook' appended. The targets allowing hooks are `install-data',
- `install-exec', `dist', and `distcheck'.
-
- For instance, here is how to create a hard link to an installed
- program:
-
- install-exec-hook:
- ln $(bindir)/program $(bindir)/proglink
-
- File: automake.info, Node: Distributing, Next: Examples, Prev: Extending, Up: Top
-
- Distributing `Makefile.in's
- ***************************
-
- Automake places no restrictions on the distribution of the resulting
- `Makefile.in's. We still encourage software authors to distribute
- their work under terms like those of the GPL, but doing so is not
- required to use Automake.
-
- Some of the files that can be automatically installed via the
- `--add-missing' switch do fall under the GPL; examine each file to see.
-
- File: automake.info, Node: Examples, Next: Future, Prev: Distributing, Up: Top
-
- Some example packages
- *********************
-
- Here are some examples of how Automake can be used.
-
- * Menu:
-
- * Hello:: The simplest GNU program
- * Tricky:: A trickier example
- * Automake:: Automake's own use
- * Textutils:: A deep hierarchy
-
- File: automake.info, Node: Hello, Next: Tricky, Up: Examples
-
- The simplest GNU program
- ========================
-
- `hello' is renowned for its classic simplicity and versatility.
- What better place to begin a tour? The below shows what could be used
- as the Hello distribution's `Makefile.am'.
-
- bin_PROGRAMS = hello
- hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h
- hello_LDADD = @ALLOCA@
- info_TEXINFOS = hello.texi
- hello_TEXINFOS = gpl.texi
-
- EXTRA_DIST = testdata
-
- check-local: hello
- @echo expect no output from diff
- ./hello > test.out
- diff -c $(srcdir)/testdata test.out
- rm -f test.out
-
- Of course, Automake also requires some minor changes to
- `configure.in'. The new `configure.in' would read:
-
- dnl Process this file with autoconf to produce a configure script.
- AC_INIT(hello.c)
- AM_INIT_AUTOMAKE(hello, 1.3)
- AC_PROG_CC
- AC_PROG_CPP
- AC_PROG_INSTALL
- AC_STDC_HEADERS
- AC_HAVE_HEADERS(string.h fcntl.h sys/file.h)
- AC_ALLOCA
- AC_OUTPUT(Makefile)
-
- If Hello were really going to use Automake, the `version.c' file
- would probably be deleted, or changed so as to be automatically
- generated.
-
- File: automake.info, Node: Tricky, Next: Automake, Prev: Hello, Up: Examples
-
- A tricker example
- =================
-
- Here is another, trickier example. It shows how to generate two
- programs (`ctags' and `etags') from the same source file (`etags.c').
- The difficult part is that each compilation of `etags.c' requires
- different `cpp' flags.
-
- bin_PROGRAMS = etags ctags
- ctags_SOURCES =
- ctags_LDADD = ctags.o
- ctags_DEPENDENCIES = ctags.o
-
- etags.o:
- $(COMPILE) -DETAGS_REGEXPS etags.c
-
- ctags.o:
- $(COMPILE) -DCTAGS -o ctags.o etags.c
-
- Note that `ctags_SOURCES' is defined to be empty - that way no
- implicit value is substituted. The implicit value, however, is used to
- generate `etags' from `etags.o'.
-
- `ctags_LDADD' is used to get `ctags.o' into the link line, while
- `ctags_DEPENDENCIES' exists to make sure that `ctags.o' gets built in
- the first place.
-
- This is a somewhat pathological example.
-
- File: automake.info, Node: Automake, Next: Textutils, Prev: Tricky, Up: Examples
-
- Automake uses itself
- ====================
-
- Automake, of course, uses itself to generate its `Makefile.in'.
- Since Automake is a shallow package, it has more than one
- `Makefile.am'. Here is the top-level `Makefile.am':
-
- ## Process this file with automake to create Makefile.in
-
- AUTOMAKE_OPTIONS = gnits
- MAINT_CHARSET = latin1
- PERL = @PERL@
-
- SUBDIRS = tests
-
- bin_SCRIPTS = automake
- info_TEXINFOS = automake.texi
-
- pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
- compile.am data.am depend.am \
- dist-vars.am footer.am header.am header-vars.am \
- kr-vars.am libraries-vars.am \
- libraries.am library.am mans-vars.am \
- program.am programs.am remake-hdr.am \
- remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \
- tags-clean.am \
- texi-version.am texinfos-vars.am texinfos.am \
- libraries-clean.am programs-clean.am data-clean.am \
- COPYING INSTALL texinfo.tex \
- ansi2knr.c ansi2knr.1 \
- aclocal.m4
-
- ## These must all be executable when installed.
- pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs
-
- # The following requires a fixed version of the Emacs 19.30 etags.
- ETAGS_ARGS = automake.in --lang=none \
- --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
-
- ## `test -x' is not portable. So we use Perl instead. If Perl
- ## doesn't exist, then this test is meaningless anyway.
- # Check to make sure some installed files are executable.
- installcheck-local:
- $(PERL) -e "exit ! -x '$(pkgdatadir)/config.guess';"
- $(PERL) -e "exit ! -x '$(pkgdatadir)/config.sub';"
- $(PERL) -e "exit ! -x '$(pkgdatadir)/install-sh';"
- $(PERL) -e "exit ! -x '$(pkgdatadir)/mdate-sh';"
- $(PERL) -e "exit ! -x '$(pkgdatadir)/mkinstalldirs';"
-
- # Some simple checks:
- # * syntax check with perl4 and perl5.
- # * make sure the scripts don't use 'true'
- # * expect no instances of '${...}'
- # These are only really guaranteed to work on my machine.
- maintainer-check: automake check
- $(PERL) -c -w automake
- @if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \
- echo "can't use 'true' in GNU Makefile" 1>&2; \
- exit 1; \
- else :; fi
- @if test `fgrep '$${' $(srcdir)/[a-z]*.am | wc -l` -ne 0; then \
- echo "found too many uses of '\$${'" 1>&2; \
- exit 1; \
- fi
- if $(SHELL) -c 'perl4.036 -v' >/dev/null 2>&1; then \
- perl4.036 -c -w automake; \
- else :; fi
-
- # Tag before making distribution. Also, don't make a distribution if
- # checks fail. Also, make sure the NEWS file is up-to-date.
- cvs-dist: maintainer-check
- @if sed 1q NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
- echo "NEWS not updated; not releasing" 1>&2; \
- exit 1; \
- fi
- cvs tag `echo "Release-$(VERSION)" | sed 's/\./-/g'`
- $(MAKE) dist
-
- As you can see, Automake defines many of its own rules, to make the
- maintainer's job easier. For instance the `cvs-dist' rule
- automatically tags the current version in the CVS repository, and then
- makes a standard distribution.
-
- Automake consists primarily of one program, `automake', and a number
- of auxiliary scripts. Automake also installs a number of programs
- which are possibly installed via the `--add-missing' option; these
- scripts are listed in the `pkgdata_SCRIPTS' variable.
-
- Automake also has a `tests' subdirectory, as indicated in the
- `SUBDIRS' variable above. Here is `tests/Makefile.am':
-
- ## Process this file with automake to create Makefile.in
-
- AUTOMAKE_OPTIONS = gnits
-
- TESTS = mdate.test vtexi.test acoutput.test instexec.test checkall.test \
- acoutnoq.test acouttbs.test libobj.test proginst.test acoutqnl.test \
- confincl.test spelling.test prefix.test badprog.test depend.test
-
- EXTRA_DIST = defs
-
- This is where all the tests are really run. `defs' is an
- initialization file used by each test script; it is explicitly mentioned
- because `automake' has no way of automatically finding it.
-
- File: automake.info, Node: Textutils, Prev: Automake, Up: Examples
-
- A deep hierarchy
- ================
-
- The GNU textutils are a collection of programs for manipulating text
- files. They are distributed as a deep package. The textutils have only
- recently been modified to use Automake; the examples come from a
- prerelease.
-
- Here is the top-level `Makefile.am':
-
- SUBDIRS = lib src doc man
-
- In the `lib' directory, a library is built which is used by each
- textutil. Here is `lib/Makefile.am':
-
- noinst_LIBRARIES = tu
-
- EXTRA_DIST = rx.c regex.c
-
- tu_SOURCES = error.h getline.h getopt.h linebuffer.h \
- long-options.h md5.h regex.h rx.h xstrtod.h xstrtol.h xstrtoul.h \
- error.c full-write.c getline.c getopt.c getopt1.c \
- linebuffer.c long-options.c md5.c memchr.c safe-read.c \
- xmalloc.c xstrtod.c xstrtol.c xstrtoul.c
-
- tu_LIBADD = @REGEXOBJ@ @LIBOBJS@ @ALLOCA@
-
- The `src' directory contains the source for all the textutils - 23
- programs in all. The `Makefile.am' for this directory also includes
- some simple checking code, and constructs a `version.c' file on the fly:
-
- bin_PROGRAMS = cat cksum comm csplit cut expand fmt fold head join md5sum \
- nl od paste pr sort split sum tac tail tr unexpand uniq wc
-
- noinst_HEADERS = system.h version.h
- DISTCLEANFILES = stamp-v version.c
-
- INCLUDES = -I$(top_srcdir)/lib
-
- LDADD = version.o ../lib/libtu.a
-
- $(PROGRAMS): version.o ../lib/libtu.a
-
- AUTOMAKE_OPTIONS = ansi2knr
-
- version.c: stamp-v
- stamp-v: Makefile
- rm -f t-version.c
- echo '#include <config.h>' > t-version.c
- echo '#include "version.h"' >> t-version.c
- echo 'const char *version_string = "'GNU @PACKAGE@ @VERSION@'";' \
- >> t-version.c
- if cmp -s version.c t-version.c; then \
- rm t-version.c; \
- else \
- mv t-version.c version.c; \
- fi
- echo timestamp > $@
-
- check: md5sum
- ./md5sum \
- --string="" \
- --string="a" \
- --string="abc" \
- --string="message digest" \
- --string="abcdefghijklmnopqrstuvwxyz" \
- --string="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" \
- --string="12345678901234567890123456789012345678901234567890123456789012345678901234567890" \
- | diff -c $(srcdir)/md5-test.rfc -
-
- The `doc' directory builds the info documentation for the textutils:
-
- info_TEXINFOS = textutils.texi
-
- And, last, the `man' directory installs the man pages for all the
- textutils:
-
- man_MANS = cat.1 cksum.1 comm.1 csplit.1 cut.1 expand.1 fmt.1 fold.1 head.1 \
- join.1 md5sum.1 nl.1 od.1 paste.1 pr.1 sort.1 split.1 sum.1 tac.1 tail.1 \
- tr.1 unexpand.1 uniq.1 wc.1
-
- You can now see how easy it is to handle even a largish project using
- Automake.
-
- File: automake.info, Node: Future, Next: Variables, Prev: Examples, Up: Top
-
- Some ideas for the future
- *************************
-
- Here are some things that might happen in the future:
-
- * HTML support.
-
- * The output will be cleaned up. For instance, only variables which
- are actually used will appear in the generated `Makefile.in'.
-
- * There will be support for automatically recoding a distribution.
- The intent is to allow a maintainer to use whatever character set
- is most convenient locally, but for all distributions to be
- Unicode or ISO 10646 with the UTF-8 encoding.
-
- File: automake.info, Node: Variables, Next: Configure variables, Prev: Future, Up: Top
-
- Index of Variables
- ******************
-
- * Menu:
-
- * _LDADD: A Program.
- * _LIBADD: A Library.
- * _SOURCES: A Program.
- * _TEXINFOS: Texinfo.
- * AUTOMAKE_OPTIONS <1>: Options.
- * AUTOMAKE_OPTIONS <2>: Dependencies.
- * AUTOMAKE_OPTIONS: ANSI.
- * BUILT_SOURCES: Sources.
- * CLEANFILES: Clean.
- * DATA <1>: Uniform.
- * DATA: Data.
- * DEJATOOL: Tests.
- * DISTCLEANFILES: Clean.
- * ELCFILES: Emacs Lisp.
- * ETAGS_ARGS: Tags.
- * EXPECT: Tests.
- * EXTRA_DIST: Dist.
- * EXTRA_PROGRAMS: A Program.
- * HEADERS <1>: Headers.
- * HEADERS: Uniform.
- * info_TEXINFOS: Texinfo.
- * LDADD: A Program.
- * LIBADD: A Library.
- * LIBRARIES: Uniform.
- * LISP <1>: Uniform.
- * LISP: Emacs Lisp.
- * lisp_LISP: Emacs Lisp.
- * MAINTAINERCLEANFILES: Clean.
- * man_MANS: Man pages.
- * MANS <1>: Man pages.
- * MANS: Uniform.
- * MOSTLYCLEANFILES: Clean.
- * noinst_LISP: Emacs Lisp.
- * PROGRAMS: Uniform.
- * RUNTEST: Tests.
- * RUNTESTFLAGS: Tests.
- * SCRIPTS <1>: Scripts.
- * SCRIPTS: Uniform.
- * SOURCES: A Program.
- * SUBDIRS <1>: Top level.
- * SUBDIRS: Depth.
- * SUFFIXES: Suffixes.
- * TAGS_DEPENDENCIES: Tags.
- * TESTS: Tests.
- * TESTS_ENVIRONMENT: Tests.
- * TEXINFOS <1>: Texinfo.
- * TEXINFOS: Uniform.
-
- File: automake.info, Node: Configure variables, Next: Targets, Prev: Variables, Up: Top
-
- Index of Configure Variables and Macros
- ***************************************
-
- * Menu:
-
- * AC_ARG_PROGRAM: Requirements.
- * AC_CANONICAL_HOST: Optional.
- * AC_CANONICAL_SYSTEM: Optional.
- * AC_CHECK_TOOL: Optional.
- * AC_CONFIG_AUX_DIR: Optional.
- * AC_CONFIG_HEADER: Optional.
- * AC_DECL_YYTEXT: Optional.
- * AC_FUNC_ALLOCA: Optional.
- * AC_FUNC_FNMATCH: Optional.
- * AC_FUNC_GETLOADAVG: Optional.
- * AC_FUNC_MEMCMP: Optional.
- * AC_OUTPUT: Requirements.
- * AC_PATH_XTRA: Optional.
- * AC_PROG_CXX: Optional.
- * AC_PROG_INSTALL: Requirements.
- * AC_PROG_LEX: Optional.
- * AC_PROG_MAKE_SET: Requirements.
- * AC_PROG_RANLIB: Optional.
- * AC_PROG_YACC: Optional.
- * AC_REPLACE_FUNCS: Optional.
- * AC_REPLACE_GNU_GETOPT: Optional.
- * AC_STRUCT_ST_BLOCKS: Optional.
- * ALL_LINGUAS: Optional.
- * AM_C_PROTOTYPES <1>: ANSI.
- * AM_C_PROTOTYPES: Optional.
- * AM_FUNC_FNMATCH: Optional.
- * AM_FUNC_STRTOD: Optional.
- * AM_INIT_AUTOMAKE: Requirements.
- * AM_PROG_INSTALL: Requirements.
- * AM_WITH_REGEX: Optional.
- * jm_MAINTAINER_MODE: Optional.
- * LIBOBJS: Optional.
- * PACKAGE <1>: Dist.
- * PACKAGE <2>: Uniform.
- * PACKAGE: Requirements.
- * ud_GNU_GETTEXT: Optional.
- * VERSION <1>: Requirements.
- * VERSION: Dist.
- * YACC: Optional.
-
- File: automake.info, Node: Targets, Prev: Configure variables, Up: Top
-
- Index of Targets
- ****************
-
- * Menu:
-
- * all: Extending.
- * check: Extending.
- * dist <1>: Dist.
- * dist: Dependencies.
- * dist-hook: Extending.
- * dist-shar: Options.
- * dist-tarZ: Options.
- * dist-zip: Options.
- * distcheck: Dist.
- * dvi: Extending.
- * id: Tags.
- * info <1>: Options.
- * info: Extending.
- * install: Install.
- * install-data <1>: Extending.
- * install-data: Install.
- * install-data-hook: Extending.
- * install-data-local: Install.
- * install-exec <1>: Extending.
- * install-exec: Install.
- * install-exec-hook: Extending.
- * install-exec-local: Install.
- * install-info: Options.
- * install-man <1>: Options.
- * install-man: Man pages.
- * installdirs: Install.
- * tags: Tags.
- * uninstall <1>: Extending.
- * uninstall: Install.
-
-
-