diff options
author | Paul Smith <psmith@gnu.org> | 2022-09-11 10:56:08 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-09-11 10:56:08 -0400 |
commit | 86fc644dcc99c1bbf4764d9b324b723f7ea5ce04 (patch) | |
tree | 6851898fa9b4a020a7d7f720b0a8324d7f7894e4 /doc | |
parent | 02b3a6ad46b827684b923bf619009ac06297ece9 (diff) | |
download | make-git-86fc644dcc99c1bbf4764d9b324b723f7ea5ce04.tar.gz |
Support the MAKE_TMPDIR environment variable
Allow build systems to choose an alternative location for make to
store its temporary files.
* NEWS: Announce the new environment variable.
* doc/make.texi (Temporary Files): Provide documentation.
* src/misc.c (get_tmpdir): Split into a new function. Compute the
temporary directory and store it in a static location.
* tests/scripts/features/jobserver: Add a test of MAKE_TMPDIR.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/make.texi | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/doc/make.texi b/doc/make.texi index 47595bbd..920e6460 100644 --- a/doc/make.texi +++ b/doc/make.texi @@ -309,6 +309,7 @@ How to Run @code{make} an alternate compiler and other things. * Testing:: How to proceed past some errors, to test compilation. +* Temporary Files:: Where @code{make} keeps its temporary files. * Options Summary:: Summary of Options Using Implicit Rules @@ -8773,6 +8774,7 @@ determines that some target is not already up to date. an alternate compiler and other things. * Testing:: How to proceed past some errors, to test compilation. +* Temporary Files:: Where @code{make} keeps its temporary files. * Options Summary:: Summary of Options @end menu @@ -9164,7 +9166,7 @@ overridden. This is to use the @code{override} directive, which is a line that looks like this: @samp{override @var{variable} = @var{value}} (@pxref{Override Directive, ,The @code{override} Directive}). -@node Testing, Options Summary, Overriding, Running +@node Testing, Temporary Files, Overriding, Running @section Testing the Compilation of a Program @cindex testing compilation @cindex compilation, testing @@ -9202,7 +9204,35 @@ program, perhaps to find several independent problems so that you can correct them all before the next attempt to compile. This is why Emacs' @kbd{M-x compile} command passes the @samp{-k} flag by default. -@node Options Summary, , Testing, Running +@node Temporary Files, Options Summary, Testing, Running +@section Temporary Files +@cindex temporary files + +In some situations, @code{make} will need to create its own temporary files. +These files must not be disturbed while @code{make} is running, including all +recursively-invoked instances of @code{make}. + +@cindex @code{MAKE_TMPDIR} +If the environment variable @code{MAKE_TMPDIR} is set then all temporary files +created by @code{make} will be placed there. + +@cindex @code{TMPDIR} +@cindex @code{TMP} +@cindex @code{TEMP} +If @code{MAKE_TMPDIR} is not set, then the standard location for temporary +files for the current operating system will be used. For POSIX systems this +will be the location set in the @code{TMPDIR} environment variable, or else +the system's default location (e.g., @file{/tmp}) is used. On Windows, +first @code{TMP} then @code{TEMP} will be checked, then @code{TMPDIR}, and +finally the system default temporary file location will be used. + +Note that this directory must already exist or @code{make} will fail: +@code{make} will not attempt to create it. + +These variables @emph{cannot} be set from within a makefile: GNU @code{make} +must have access to this location before it begins reading the makefiles. + +@node Options Summary, , Temporary Files, Running @section Summary of Options @cindex options @cindex flags |