This example is obsolete, the new GNU Hello is no longer suitable as an introductory example, and we distribute amhello instead.
2006-10-15 Alexandre Duret-Lutz <[EMAIL PROTECTED]> * doc/automake.texi (Examples): Introduce the example, and point to Hello World. (Hello): Remove this obsolete node. Index: doc/automake.texi =================================================================== RCS file: /cvs/automake/automake/doc/automake.texi,v retrieving revision 1.155 diff -u -r1.155 automake.texi --- doc/automake.texi 15 Oct 2006 16:37:22 -0000 1.155 +++ doc/automake.texi 15 Oct 2006 16:45:43 -0000 @@ -164,7 +164,6 @@ Some example packages * Complete:: A simple example, start to finish -* Hello:: A classic program * true:: Building true and false Scanning @file{configure.ac} @@ -2127,9 +2126,21 @@ @node Examples @chapter Some example packages +This section contains two small examples. + +The first example (@pxref{Complete}) assumes you have an existing +project already using Autoconf, with handcrafted @file{Makefile}s, and +that you want to convert it to using Automake. If you are discovering +both tools, it is probably better that you look at the Hello World +example presented earlier (@pxref{Hello World}). + +The second example (@pxref{true}) shows how two programs can be built +from the same file, using different compilation parameters. It +contains some technical digressions that are probably best skipped on +first read. + @menu * Complete:: A simple example, start to finish -* Hello:: A classic program * true:: Building true and false @end menu @@ -2201,124 +2212,6 @@ you're done! [EMAIL PROTECTED] Hello [EMAIL PROTECTED] A classic program - [EMAIL PROTECTED] Example, GNU Hello [EMAIL PROTECTED] Hello example [EMAIL PROTECTED] GNU Hello, example - [EMAIL PROTECTED]://prep.ai.mit.edu/pub/gnu/hello-1.3.tar.gz, GNU hello} is -renowned for its classic simplicity and versatility. This section shows -how Automake could be used with the GNU Hello package. The examples -below are from the latest beta version of GNU Hello, but with all of the -maintainer-only code stripped out, as well as all copyright comments. - -Of course, GNU Hello is somewhat more featureful than your traditional -two-liner. GNU Hello is internationalized, does option processing, and -has a manual and a test suite. - [EMAIL PROTECTED] @file{configure.ac}, from GNU Hello [EMAIL PROTECTED] GNU Hello, @file{configure.ac} [EMAIL PROTECTED] Hello, @file{configure.ac} - -Here is the @file{configure.ac} from GNU Hello. [EMAIL PROTECTED] note:} The calls to @code{AC_INIT} and @code{AM_INIT_AUTOMAKE} -in this example use a deprecated syntax. For the current approach, -see the description of @code{AM_INIT_AUTOMAKE} in @ref{Public macros}. - [EMAIL PROTECTED] FIXME: This definitely requires an update, e.g., to GNU Hello 2.1.1. - [EMAIL PROTECTED] -dnl Process this file with autoconf to produce a configure script. -AC_INIT(src/hello.c) -AM_INIT_AUTOMAKE(hello, 1.3.11) -AM_CONFIG_HEADER(config.h) - -dnl Set of available languages. -ALL_LINGUAS="de fr es ko nl no pl pt sl sv" - -dnl Checks for programs. -AC_PROG_CC -AC_ISC_POSIX - -dnl Checks for libraries. - -dnl Checks for header files. -AC_STDC_HEADERS -AC_HAVE_HEADERS(string.h fcntl.h sys/file.h sys/param.h) - -dnl Checks for library functions. -AC_FUNC_ALLOCA - -dnl Check for st_blksize in struct stat -AC_ST_BLKSIZE - -dnl internationalization macros -AM_GNU_GETTEXT -AC_OUTPUT([Makefile doc/Makefile intl/Makefile po/Makefile.in \ - src/Makefile tests/Makefile tests/hello], - [chmod +x tests/hello]) [EMAIL PROTECTED] example - -The @samp{AM_} macros are provided by Automake (or the Gettext library); -the rest are standard Autoconf macros. - - -The top-level @file{Makefile.am}: - [EMAIL PROTECTED] -EXTRA_DIST = BUGS ChangeLog.O -SUBDIRS = doc intl po src tests [EMAIL PROTECTED] example - -As you can see, all the work here is really done in subdirectories. - -The @file{po} and @file{intl} directories are automatically generated -using @command{gettextize}; they will not be discussed here. - [EMAIL PROTECTED] Texinfo file handling example [EMAIL PROTECTED] Example, handling Texinfo files - -In @file{doc/Makefile.am} we see: - [EMAIL PROTECTED] -info_TEXINFOS = hello.texi -hello_TEXINFOS = gpl.texi [EMAIL PROTECTED] example - -This is sufficient to build, install, and distribute the GNU Hello -manual. - [EMAIL PROTECTED] Regression test example [EMAIL PROTECTED] Example, regression test - -Here is @file{tests/Makefile.am}: - [EMAIL PROTECTED] -TESTS = hello -EXTRA_DIST = hello.in testdata [EMAIL PROTECTED] example - -The script @file{hello} is generated by @command{configure}, and is the -only test case. @samp{make check} will run this test. - [EMAIL PROTECTED] @code{INCLUDES}, example usage [EMAIL PROTECTED] INCLUDES - -Last we have @file{src/Makefile.am}, where all the real work is done: [EMAIL PROTECTED] FIXME: As all the Hello World excerpts in this manual, this [EMAIL PROTECTED] shows deprecated features (here: $(INCLUDES)). - [EMAIL PROTECTED] -bin_PROGRAMS = hello -hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h system.h -hello_LDADD = $(INTLLIBS) $(ALLOCA) -localedir = $(datadir)/locale -INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\" [EMAIL PROTECTED] example - - @node true @section Building true and false -- Alexandre Duret-Lutz