@menu
* Complete:: A simple example, start to finish
* Hello:: A classic program
-* etags:: Building etags and ctags
+* true:: Building true and false
@end menu
you're done!
-@node Hello, etags, Complete, Examples
+@node Hello, true, Complete, Examples
@section A classic program
@cindex Example, GNU Hello
@end example
-@node etags, , Hello, Examples
-@section Building etags and ctags
+@node true, , Hello, Examples
+@section Building true and false
-@cindex Example, ctags and etags
-@cindex ctags Example
-@cindex etags Example
+@cindex Example, false and true
+@cindex false Example
+@cindex true Example
Here is another, trickier example. It shows how to generate two
-programs (@code{ctags} and @code{etags}) from the same source file
-(@file{etags.c}). The difficult part is that each compilation of
-@file{etags.c} requires different @code{cpp} flags.
+programs (@code{true} and @code{false}) from the same source file
+(@file{true.c}). The difficult part is that each compilation of
+@file{true.c} requires different @code{cpp} flags.
@example
-bin_PROGRAMS = etags ctags
-ctags_SOURCES =
-ctags_LDADD = ctags.o
+bin_PROGRAMS = true false
+false_SOURCES =
+false_LDADD = false.o
-etags.o: etags.c
- $(COMPILE) -DETAGS_REGEXPS -c etags.c
+true.o: true.c
+ $(COMPILE) -DEXIT_CODE=0 -c true.c
-ctags.o: etags.c
- $(COMPILE) -DCTAGS -o ctags.o -c etags.c
+false.o: true.c
+ $(COMPILE) -DEXIT_CODE=1 -o false.o -c true.c
@end example
-Note that there is no @code{etags_SOURCES} definition. Automake will
-implicitly assume that there is a source file named @file{etags.c}, and
-define rules to compile @file{etags.o} and link @file{etags}. The
-@code{etags.o: etags.c} rule supplied by the above @file{Makefile.am},
-will override the Automake generated rule to build @file{etags.o}.
+Note that there is no @code{true_SOURCES} definition. Automake will
+implicitly assume that there is a source file named @file{true.c}, and
+define rules to compile @file{true.o} and link @file{true}. The
+@code{true.o: true.c} rule supplied by the above @file{Makefile.am},
+will override the Automake generated rule to build @file{true.o}.
-@code{ctags_SOURCES} is defined to be empty---that way no implicit value
+@code{false_SOURCES} is defined to be empty---that way no implicit value
is substituted. Because we have not listed the source of
-@file{ctags}, we have to tell Automake how to link the program. This is
-the purpose of the @code{ctags_LDADD} line. A @code{ctags_DEPENDENCIES}
-variable, holding the dependencies of the @file{ctags} target will be
+@file{false}, we have to tell Automake how to link the program. This is
+the purpose of the @code{false_LDADD} line. A @code{false_DEPENDENCIES}
+variable, holding the dependencies of the @file{false} target will be
automatically generated by Automake from the contant of
-@code{ctags_LDADD}.
+@code{false_LDADD}.
The above rules won't work if your compiler doesn't accept both
@samp{-c} and @samp{-o}. The simplest fix for this is to introduce a
bogus dependency (to avoid problems with a parallel @code{make}):
@example
-etags.o: etags.c ctags.o
- $(COMPILE) -DETAGS_REGEXPS -c etags.c
+true.o: true.c false.o
+ $(COMPILE) -DEXIT_CODE=0 -c true.c
-ctags.o: etags.c
- $(COMPILE) -DCTAGS -c etags.c && mv etags.o ctags.o
+false.o: true.c
+ $(COMPILE) -DEXIT_CODE=1 -c true.c && mv true.o false.o
@end example
Also, these explicit rules do not work if the de-ANSI-fication feature
more work:
@example
-etags._o: etags._c ctags.o
- $(COMPILE) -DETAGS_REGEXPS -c etags.c
+true._o: true._c false.o
+ $(COMPILE) -DEXIT_CODE=0 -c true.c
-ctags._o: etags._c
- $(COMPILE) -DCTAGS -c etags.c && mv etags._o ctags.o
+false._o: true._c
+ $(COMPILE) -DEXIT_CODE=1 -c true.c && mv true._o false.o
@end example
As it turns out, there is also a much easier way to do this same task.
Some of the above techniques are useful enough that we've kept the
-example in the manual. However if you were to build @code{etags} and
-@code{ctags} in real life, you would probably use per-program
+example in the manual. However if you were to build @code{true} and
+@code{false} in real life, you would probably use per-program
compilation flags, like so:
@example
-bin_PROGRAMS = ctags etags
+bin_PROGRAMS = false true
-ctags_SOURCES = etags.c
-ctags_CPPFLAGS = -DCTAGS
+false_SOURCES = true.c
+false_CPPFLAGS = -DEXIT_CODE=1
-etags_SOURCES = etags.c
-etags_CPPFLAGS = -DETAGS_REGEXPS
+true_SOURCES = true.c
+true_CPPFLAGS = -DEXIT_CODE=0
@end example
-In this case Automake will cause @file{etags.c} to be compiled twice,
+In this case Automake will cause @file{true.c} to be compiled twice,
with different flags. De-ANSI-fication will work automatically. In
this instance, the names of the object files would be chosen by
-automake; they would be @file{ctags-etags.o} and @file{etags-etags.o}.
+automake; they would be @file{false-true.o} and @file{true-true.o}.
(The name of the object files rarely matters.)
* Requirements:: Configuration requirements
* Optional:: Other things Automake recognizes
* Invoking aclocal:: Auto-generating aclocal.m4
+* aclocal options:: aclocal command line arguments
+* Macro search path:: Modifying aclocal's search path
* Macros:: Autoconf macros supplied with Automake
* Extending aclocal:: Writing your own aclocal macros
@end menu
@end table
-@node Invoking aclocal, Macros, Optional, configure
+@node Invoking aclocal, aclocal options, Optional, configure
@section Auto-generating aclocal.m4
@cindex Invoking aclocal
* Macro search path:: How aclocal finds .m4 files
@end menu
-@node aclocal options, Macro search path, Invoking aclocal, Invoking aclocal
+@node aclocal options, Macro search path, Invoking aclocal, configure
@section aclocal options
@cindex aclocal, Options
Print the version number of Automake and exit.
@end table
-@node Macro search path, , aclocal options, Invoking aclocal
+@node Macro search path, Macros, aclocal options, configure
@section Macro search path
@cindex Macro search path
copy Automake on your account and want @command{aclocal} to look for
macros installed at other places on the system.
-@node Macros, Extending aclocal, Invoking aclocal, configure
+@node Macros, Extending aclocal, Macro search path, configure
@section Autoconf macros supplied with Automake
Automake ships with several Autoconf macros that you can use from your