[erlang-questions] "dynamic" include?

Eric Merritt <>
Fri Oct 26 05:36:42 CEST 2007


Sinan sets up include paths correctly during build as well so you just
don't have to worry about where you includes are.


On 10/25/07, Roberto Saccon <> wrote:
> when you use CEAN and all your third party code is in CEAN, then you
> have a bit less trouble with location of headerfiles.
>
> You could also programmatically set your include directories in the
> Makefile or use an Escript to compile, then you don't have to hardcode
> those paths in your src files.
>
>
> On 10/25/07, YC <> wrote:
> > Hi all -
> >
> > is it possible to include programmatically generated path?
> >
> > i.e.
> >
> > instead of
> >
> > -include("../../foo.hrl").
> >
> > write
> >
> > -include(dynamic_determine("foo.hrl")).
> >
> > I suspect not (the above don't compile for me), but the idea is that you
> > might not know for sure where the file would be, and rely on the vm to
> > figure it out via the code:which() mechanism.  For example, yaws can be
> > installed locally or globally, and if you need access to yaws hrl files,
> you
> > can't depend on it exist @ a particular location (assuming your code
> branch
> > has no relation with yaws' code branch), and it's a pain if one has to
> > modify the source if the locations differ.
> >
> > What's the best practice to deal with such situation?  Any thoughts are
> > appreicated, thanks.
> > yc
> >
> >
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://www.erlang.org/mailman/listinfo/erlang-questions
> >
>
>
> --
> Roberto Saccon
> http://rsaccon.com
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list