Go to the first, previous, next, last section, table of contents.

Creating Output Files

Every Autoconf-generated configure script must finish by calling AC_OUTPUT. It is the macro that creates the `Makefile's and optional other files resulting from configuration. The only other required macro is AC_INIT (see section Finding configure Input).

Macro: AC_OUTPUT ([file...] [,extra-cmds] [,init-cmds])
Create output files. The file... argument is a whitespace-separated list of output files; it may be empty. This macro creates each file `file' by copying an input file (by default named `file.in'), substituting the output variable values. See section Substitutions in Makefiles, for more information on using output variables. See section Setting Output Variables, for more information on creating them. This macro creates the directory that the file is in if it doesn't exist (but not the parents of that directory). Usually, `Makefile's are created this way, but other files, such as `.gdbinit', can be specified as well.

If AC_CONFIG_HEADER, AC_LINK_FILES, or AC_CONFIG_SUBDIRS has been called, this macro also creates the files named as their arguments.

A typical call to AC_OUTPUT looks like this:

AC_OUTPUT(Makefile src/Makefile man/Makefile X/Imakefile)

You can override an input file name by appending it to file, separated by a colon. For example,

AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk)

If you pass extra-cmds, those commands will be inserted into `config.status' to be run after all its other processing. If init-cmds are given, they are inserted just before extra-cmds, with shell variable, command, and backslash substitutions performed on them in configure. You can use init-cmds to pass variables from configure to the extra-cmds.

If you run make on subdirectories, you should run it using the make variable MAKE. Most versions of make set MAKE to the name of the make program plus any options it was given. (But many do not include in it the values of any variables set on the command line, so those are not passed on automatically.) Some old versions of make do not set this variable. The following macro allows you to use it even with those versions.

Macro: AC_PROG_MAKE_SET
If make predefines the variable MAKE, define output variable SET_MAKE to be empty. Otherwise, define SET_MAKE to contain `MAKE=make'. Calls AC_SUBST for SET_MAKE.

To use this macro, place a line like this in each `Makefile.in' that runs MAKE on other directories:

@SET_MAKE@

Go to the first, previous, next, last section, table of contents.