help-make
[Top][All Lists]
Advanced

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

Re: Multiple instance of target but with potentially different dependenc


From: AB
Subject: Re: Multiple instance of target but with potentially different dependencies
Date: Mon, 22 Oct 2012 19:13:55 -0700

Hi Yannick:
Instead of generating a Makefile every time, perhaps you could try creating
an harness that is data driven. The client make file basically includes
this harness, and sets up the data for the harness. The harness based on
the data that you have specified can set up the rules and recipes (pattern
rules, rules created using Make's for loop, etc) with the customization
needed across platforms. This way you are not dependent on bash to generate
any Makfiles, and you have all your rules which is data driven as specified
by the client Makefile.

Hope this helps.

AB

On Thu, Oct 18, 2012 at 9:25 AM, Koehler, Yannick (HP Networking) <
address@hidden> wrote:

> Hi,
>
>   I am looking for advance make usage help, we are building a software
> based on a set of modules.  The same modules exist in many variance of our
> product and we use a single make to build all variances.  So for example we
> have a linux and windows platform and both need the module A and module B.
>  And module B depends on module A.
>
>                moduleB: moduleA
>
>   Since we have these modules for each platform it looks like this:
>
>                platformA: platformA.moduleA platformA.moduleB
>                platformB: platformB.moduleA platformB.moduleB
>
>                platformA.moduleB: platformA.moduleA
>                platformB.moduleB: platformB.moduleA
>
> Since the module dependency isn't tie to the platform, but tie to the
> module, we built a script to generate the make on the fly for the module
> dependency:
>
>                $(platform).moduleA: $(platform).moduleB
>
> This in turn works fine but we are now dependent on bash to generate the
> makefile.  Also, we have more platform than what is being describe here,
> and we now are starting to get platform that do not have the same module
> and therefore the module dependency is getting complex to manage.  For
> example let's say that moduleB doesn't exists in platformB, and it does on
> platformA, and on platformA the moduleB is still dependent on
> platformA.moduleA we then have to manually specify the rules:
>
>
>                platformA: platformA.moduleA platformA.moduleB
>                platformB: platformB.moduleA
>
>                platformA.moduleB: platformA.moduleA
>
> And we do not benefit anymore from our bash script.  Considering the
> amount of platform and modules this is tedious and I was looking for an
> alternative way to specify those complex relation without depending on bash
> for example.
>
> You could also see platformA as platformTypeA, platformTypeB where
>
>                platformA: platformTypeA platformTypeB
>                platformB: platformTypeB
>
>                platformTypeA: platformA.moduleA platformA.moduleB
>                platformTypeB: platformB.moduleA
>
> Then basically I want to express that moduleB depends on moduleA, only
> when the platformTypeA is involved, in the case of platformTypeB, the same
> moduleB has no dependency over moduleA.  This platformtype specific
> dependency are known inside the module, so the moduleB's makefile know to
> not link with moduleA when on platformTypeB.
>
> The approach I took may be totally wrong, so I am open to creative
> suggestions.  We did think about always putting the dependency in there and
> simply do nothing at compile time inside moduleA for platformTypeB but that
> was not intuitive when creating new module the developer need to be teach
> about this and it also doesn't provide a clear dependency graph, we also
> then end-up having 2 locations for managing dependency, one for satisfying
> Makefile syntax and behavior and another one to go around it.
>
> --
> Yannick Koehler
>
> _______________________________________________
> Help-make mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-make
>


reply via email to

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