bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Suggestion: Modernization of the include path


From: Christian Hujer
Subject: Suggestion: Modernization of the include path
Date: Sun, 31 May 2020 19:23:29 +0530

Hello everyone,


I suggest that
a) $HOME/.local/include is effectively added to the include_directories, as if it were inserted in default_include_directories before /usr/gnu/include.
b) Change function src/read.c/eval_makefile() to loop over .INCLUDE_DIRS instead of include_directories when searching for another Makefile.

Rationale for a):
The $HOME/.local directory tree is a directory tree for user-installed software established beside /usr and /usr/local.
By supporting $HOME/.local/include as a default include directory, users of make could share modules by "installing" them into their $HOME/.local/include directory without needing administrator privileges (required for installing in /usr/include or /usr/local/include or /usr/gnu/include), and without appending -I ~/.local/include to each of their make calls which would be inconvenient.

This feature looks portable:
* The entry $HOME/.local/include can be assumed on all POSIXy systems.
  No harm is done if that directory is part of the include path but doesn't exist.
  This assumes that the mechanism that scans the include paths for include files will continue to silently ignore non-existent directories.
* On Windows, there is a corresponding directory, I can create a VM if the details are needed.
* On Amiga OS, the variable $HOME is optional and usually only set if something like MuFS or GNU is used in an extended configuration.
  Make could check if $HOME is set and include the entry based on that condition.

Rationale for b):
INCLUDE_DIRS+=${HOME}/.local/include has no effect and does not print any error message, which is not friendly towards users of make.
Something should either work, or when it doesn't, it should print an error message.


Best regards,
--
Christian Hujer
CEO/CTO
Nelkinda Software Craft Pvt Ltd
📧 Christian Hujer | 🐦 @nelkinda | 🌐 http://nelkinda.com
☏ 🇮🇳 ✆ +91 77 2003 6661


reply via email to

[Prev in Thread] Current Thread [Next in Thread]