[EMAIL PROTECTED] on 2000.08.15 11:00:39
>%% "Noel L Yap" <[EMAIL PROTECTED]> writes:
>
> nly> If a MAKEFILE macro existed that was set to the current
> nly> makefile's filename (eg some/path/Makefile), modular makefiles
> nly> would be easier to support. For example, one could have the
> nly> following directory/file structure:
>
> nly> project/Makefile
> nly> project/component0/Makefile
> nly> project/component0/component0.mk
>
> nly> where project/Makefile contains:
> nly> include component0/component0.mk
>
> nly> project/component0/Makefile contains:
> nly> include component0.mk
>
> nly> and project/component0/component0.mk has something like:
> nly> component0.D:=$(dir $(MAKEFILE))
>
> nly> $(component0.D)/target: $(component0.D)/dependency
> nly> # build the stuff
>
> nly> Any comments?
>
>Can't you do this much more simply with the already-existing CURDIR
>variable, or even $(shell pwd)?
No. The problem solved by such a macro (the way I see it defined) would be to
know where the included makefile is in relation to the including makefile. So,
in the example above, MAKEFILE within component0.mk would be
"component0/component0.mk" when building from the project directory, but it
would be "component0.mk" when building from the project/component0 directory. I
don't see how these values can be derived from either $(CURDIR) or $(shell pwd).
>I have had requests for a variable like this, but I don't see a need for
>it for this particular situation.
Please reread the above again. If you can show me how to do the above without
such a macro, I'd be happier.
>The problem is, what exactly would the variable contain? Just the
>"main" makefile? What about included makefiles? What about the
>contents of MAKEFILES?
I see it containing the current, included makefile or the main makefile.
Noel
This communication is for informational purposes only. It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan & Co. Incorporated, its
subsidiaries and affiliates.