help-make
[Top][All Lists]
Advanced

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

Re: setting a make "include" path right from the get-go


From: John Dill
Subject: Re: setting a make "include" path right from the get-go
Date: Tue, 9 Dec 2008 10:10:53 -0500

> perhaps i'm just being thick, but i don't see how this solves the
> problem. sure, that "magic" macro would work fine. but where would a
> makefile get its definition? it could get it via including a handy
> makefile of macros. and where would it find that handy makefile of
> macros to include? oh ...

I have a library of make macros that I use, and I simply set an environment
variable to the root of the source tree.  Then in the makefiles that use the
library, I have something like

include $(MXL)/assert.mi

> i would still like the ability to define something like
> --include-dir at the top level, and have that option propagate
> throughout my build to be used by all subsequent sub-makes. can't
> that be done?

I don't see a difference between using an environment variable and using a
--include-dir parameter except that --include-dir has to be used for each
invocation, while the environment variable is set once for a static utility
makefile library.

> p.s. as a top-level solution, i can set up the alias
>
> alias mymake="make -I..."
>
> and tell everyone to use "mymake" from now on, so that's how i could
> get my includes into that top-level makefile. but it's the subsequent
> propagation through all submakes that is still an issue.

making a script to invoke 'make' with the right directories would be better
than an alias imo.

> perhaps i should just set an environment variable and have everyone
> do:
>
> include ${MKFILESDIR}/handy.mak
>
> but i still consider that aesthetically unpleasant. i want people to
> need to say nothing other than:
>
> include handy.mak

That's what I do, and I don't find it aesthetically unpleasant ;)  In fact,
it lets me know that you are using a make utility library from the name of
the environment variable, for example I use MXL (Make eXtension Library).  I
do find MKFILESDIR aesthetically unpleasant though ;)

These are all imo, of course.





reply via email to

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