diff options
author | Paul Smith <psmith@gnu.org> | 2021-05-30 18:47:50 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2021-09-03 12:08:11 -0400 |
commit | b9c4fc441b2d66312a592bf4eab67ef7fbe4c645 (patch) | |
tree | 51d517f6cb9b6398eed3abdc53259cddce51b786 /doc | |
parent | 65b73ce4342cdfa2486be406e9df5f9effb7fd7c (diff) | |
download | make-git-b9c4fc441b2d66312a592bf4eab67ef7fbe4c645.tar.gz |
[SV 60412] Allow -I- to throw out the current directory path
Accept a "-" directory value to the -I option to clear the set of
directories to be searched up to that point, including the default
directories.
* NEWS: Announce the change.
* doc/make.texi (Summary of Options): Add documentation.
* src/read.c (construct_include_path): Check for '-' and if found,
clear the list of directories to be searched.
* tests/scripts/options/dash-I: Add tests for -I-.
* tests/scripts/variables/INCLUDE_DIRS: Add tests for -I-.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/make.texi | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/doc/make.texi b/doc/make.texi index db4d7e7a..411fb692 100644 --- a/doc/make.texi +++ b/doc/make.texi @@ -1281,6 +1281,16 @@ hierarchy.}) @file{/usr/gnu/include}, @file{/usr/local/include}, @file{/usr/include}. +The @code{.INCLUDE_DIRS} variable will contain the current list of +directories that make will search for included files. @xref{Special +Variables, ,Other Special Variables}. + +You can avoid searching in these default directories by adding the +command line option @code{-I} with the special value @code{-} (e.g., +@code{-I-}) to the command line. This will cause @code{make} to +forget any already-set include directories, including the default +directories. + If an included makefile cannot be found in any of these directories it is not an immediately fatal error; processing of the makefile containing the @code{include} continues. Once it has finished reading @@ -6676,6 +6686,8 @@ Supports dynamically loadable objects for creating custom extensions. @item .INCLUDE_DIRS Expands to a list of directories that @code{make} searches for included makefiles (@pxref{Include, , Including Other Makefiles}). +Note that modifying this variable's value does not change the list of +directories which are searched. @vindex .EXTRA_PREREQS @r{(prerequisites not added to automatic variables)} @item .EXTRA_PREREQS @@ -9058,7 +9070,11 @@ Ignore all errors in recipes executed to remake files. Specifies a directory @var{dir} to search for included makefiles. @xref{Include, ,Including Other Makefiles}. If several @samp{-I} options are used to specify several directories, the directories are -searched in the order specified. +searched in the order specified. If the directory @var{dir} is a +single dash (@code{-}) then any already-specified directories up to +that point (including the default directory paths) will be discarded. +You can examine the current list of directories to be searched via the +@code{.INCLUDE_DIRS} variable. @item -j [@var{jobs}] @cindex @code{-j} |