autoconf: Build Directories
1
1 4.8.4 Build Directories
1 -----------------------
1
1 You can support compiling a software package for several architectures
1 simultaneously from the same copy of the source code. The object files
1 for each architecture are kept in their own directory.
1
1 To support doing this, `make' uses the `VPATH' variable to find the
1 files that are in the source directory. GNU Make can do this. Most
1 other recent `make' programs can do this as well, though they may have
11 difficulties and it is often simpler to recommend GNU `make' (⇒
VPATH and Make). Older `make' programs do not support `VPATH'; when
1 using them, the source code must be in the same directory as the object
1 files.
1
1 If you are using GNU Automake, the remaining details in this section
1 are already covered for you, based on the contents of your
1 `Makefile.am'. But if you are using Autoconf in isolation, then
1 supporting `VPATH' requires the following in your `Makefile.in':
1
1 srcdir = @srcdir@
1 VPATH = @srcdir@
1
11 Do not set `VPATH' to the value of another variable (⇒Variables
listed in VPATH.
1
1 `configure' substitutes the correct value for `srcdir' when it
1 produces `Makefile'.
1
1 Do not use the `make' variable `$<', which expands to the file name
1 of the file in the source directory (found with `VPATH'), except in
1 implicit rules. (An implicit rule is one such as `.c.o', which tells
1 how to create a `.o' file from a `.c' file.) Some versions of `make'
1 do not set `$<' in explicit rules; they expand it to an empty value.
1
1 Instead, Make command lines should always refer to source files by
1 prefixing them with `$(srcdir)/'. For example:
1
1 time.info: time.texinfo
1 $(MAKEINFO) '$(srcdir)/time.texinfo'
1