Win10/GNUmake4.1: paths in .INCLUDE_DIRS not searched

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Win10/GNUmake4.1: paths in .INCLUDE_DIRS not searched

Jannick
Hi,

 

'.INCLUDE_DIRS += C:\mypath' does not make GNUmake to look for included
makefiles (using 'include') in C:\mypath.

 

I checked that

*       C:\mypath is added to .INCLUDE_DIRS (with 'make -p')

*       GNUmake does not look for the includes (with 'make -d')    

 

This issue arises when centrally administered makefile scripts should be
included (using 'include') into local makefiles which is I guess something
commonly used. As a current workaround I am using 'make -IC:\mypath' which
does the job.

 

Any ideas to solve this - or am I missing something here which might well
be?

 

Many thanks,

J.

 

Living on Win10 / using GNUmake 4.1 (built for Win32).

_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make
Reply | Threaded
Open this post in threaded view
|

Re: Win10/GNUmake4.1: paths in .INCLUDE_DIRS not searched

Eli Zaretskii
> From: "Jannick" <[hidden email]>
> Date: Fri, 6 May 2016 14:25:27 +0200
>
> '.INCLUDE_DIRS += C:\mypath' does not make GNUmake to look for included
> makefiles (using 'include') in C:\mypath.
>
> I checked that
>
> *       C:\mypath is added to .INCLUDE_DIRS (with 'make -p')
>
> *       GNUmake does not look for the includes (with 'make -d')    

AFAIK, .INCLUDE_DIRS is a read-only variable: modifying its value
doesn't affect Make.  The value is created at startup, and no
assignment to it can change the results of that.

> As a current workaround I am using 'make -IC:\mypath' which does the
> job.

AFAIK, that's the only way of changing the default Make include path.

(This is not Windows specific in any way, AFAIK.)

_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make
Reply | Threaded
Open this post in threaded view
|

RE: Win10/GNUmake4.1: paths in .INCLUDE_DIRS not searched

Jannick
Hi Eli,

 

Many thanks for the quick reply!

 

I had a look around in the code and the default include paths are set in
read.c (http://git.savannah.gnu.org/cgit/make.git/tree/read.c#n106). Given
that I am working on a Windows machine, only the current directory ('.')
comes through as default include directory in the standard Make version.
Here some options I can see right now:

 

*       Invoking Make like 'Make -IC:/path/to/make/lib' (as already
discussed)

*       Compile an additional hard coded path (like 'C:/path/to/make/lib')
into Make (running build_w32.bat with some tweaks to use mingw32-gcc instead
of gcc) with

 

-DINCLUDEDIR="\".\",\" C:/path/to/makelib\""

 

*       Calling targets like '$(MAKE) -IC:/path/to/make/lib mytarget' within
the makefile which includes IncludeMe.make (in C:/path/to/make/lib) by using
'-include IncludeMe.make' (where the leading '-' makes Make ignore the
include error in the first run at least).

 

To me the second option appears the most elegant one, but still has the
disadvantage of a hard-coded path. Would it be possible that the default
include path is (1) an environment or (2) a Make variable? If you want me to
file a feature request somewhere, could you please pass on where to do that?

 

Many thanks again,

J.

_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make
Reply | Threaded
Open this post in threaded view
|

Re: Win10/GNUmake4.1: paths in .INCLUDE_DIRS not searched

Eli Zaretskii
> From: "Jannick" <[hidden email]>
> Cc: <[hidden email]>
> Date: Sat, 7 May 2016 02:29:05 +0200
>
> Would it be possible that the default include path is (1) an environment or (2) a Make variable? If you want me
> to file a feature request somewhere, could you please pass on where to do that?

Before we consider taking the value from an environment variable, IMO
we should augment the default value to include the default places
where MinGW is installed.

Feature requests are better submitted as Savannah bug reports, see

  http://savannah.gnu.org/bugs/?func=additem&group=make

Thanks.

_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make
Reply | Threaded
Open this post in threaded view
|

RE: Win10/GNUmake4.1: paths in .INCLUDE_DIRS not searched

Jannick
> Would it be possible that the default include path is (1) an
> environment or (2) a Make variable? If you want me to file a feature
request somewhere, could you please pass on where to do that?

Before we consider taking the value from an environment variable, IMO we
should augment the default value to include the default places where MinGW
is installed.

Feature requests are better submitted as Savannah bug reports, see

  http://savannah.gnu.org/bugs/?func=additem&group=make

Thanks.
---

A feature request re (1) and (2) is posted
(http://savannah.gnu.org/bugs/index.php?47880) including a patch which might
serve a starting point for the implementation of option (1) above; here the
Windows environment variable MAKELIBPATH is used. Just as a side remark: The
standard installation path of MinGW is C:\MinGW to where I think some users
might have restricted access only, if at all.

Separately attached an enhanced version of build_w32.bat (incl. .diff
against the current Savannah git version) allowing for MinGW compilation, as
well. This is useful if - as here - MinGW and Cygwin exist in tandem on the
system. Please note that the script includes the definition of hard coded
explicit include paths (-D INCLUDEDIR = ...).  

Thanks,
J.

_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make

build_w32.diff (4K) Download Attachment
build_w32.bat.txt (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Win10/GNUmake4.1: paths in .INCLUDE_DIRS not searched

Rakesh Sharma-6
In reply to this post by Jannick
Jannick <thirdedition <at> gmx.net> writes:

> Here some options I can see right now:
>
> *       Invoking Make like 'Make -IC:/path/to/make/lib' (as already
> discussed)
>
> *       Compile an additional hard coded path (like 'C:/path/to/make/lib')
> into Make (running build_w32.bat with some tweaks to use mingw32-gcc
instead
> of gcc) with
>
> -DINCLUDEDIR="\".\",\" C:/path/to/makelib\""
>
> *       Calling targets like '$(MAKE) -IC:/path/to/make/lib mytarget'
within
> the makefile which includes IncludeMe.make (in C:/path/to/make/lib) by
using
> '-include IncludeMe.make' (where the leading '-' makes Make ignore the
> include error in the first run at least).
>


Just check this which might answer what you're looking for...

    http://lists.gnu.org/archive/html/help-make/2016-01/msg00015.html

R.





_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make