help-make
[Top][All Lists]
Advanced

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

Re: include ... why not search in same directory ?


From: Markus Mauhart
Subject: Re: include ... why not search in same directory ?
Date: Thu, 17 Apr 2003 20:33:37 +0200

"Paul D. Smith" <address@hidden> wrote ...
>
> %% "Markus Mauhart" <address@hidden> writes:
>
>   mm> OTOH I wouldnt be surprised when "in the current directory"
>   mm> originally ment "in the current makefile's directory".
>
> It didn't.  It always meant what the code actually does.

ok

>   mm> So why doesnt look make 1st inside the current makefile's own
>   mm> directory as it is the case with the C-preprocessor ?  It's very
>   mm> hard to work around this behaviour cause there is no builtin
>   mm> variable $(__FILE__) which could be used for ...
>
>   mm>     include $(dir $(__FILE__))/2.mk.
>
> You can use the $(MAKEFILES) variable, if you have GNU make 3.80.

you mean ...

include $(dir $word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))/2.mk.

?

this can only be used up to the 1st include; then one needs file-local
variables, that is with a kind of unique name ... IMHO a very expensive
and unreadable instrumentarium.

>   mm> Any chance that this will be changed ?
>
> If you mean the search order for include files

yes - not really changing the existing order, but insert the
makefile's current directory on top of the search list.

> , then no.  This behavior has been around forever and make is too basic
> a tool to introduce these kinds of major incompatibilities with previous
> versions.

Understandable; allthough I'm not convinced that this fix of a mis-feature
would have to introduce more major incompatibilities than many other
changes that happened through make's history.


Regards,
Markus.







reply via email to

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