[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Expandable dependencies variables
From: |
Michael Ludwig |
Subject: |
Re: Expandable dependencies variables |
Date: |
Fri, 9 Nov 2012 23:37:36 +0100 |
User-agent: |
Mutt/1.5.21+52 (c26dbc7021f4) (2011-07-01) |
Miguel Guedes schrieb am 05.11.2012 um 16:35 (+0000):
> Is it possible to set dependencies in variables and then have GNU Make
> expand these dependencies? For instance, let's say we have a project
> that builds two binaries, foo and bar. Each of foo and bar have their
> own dependencies as defined below:
>
>
> BINARIES := foo bar
>
> FOO_OBJECTS := foo_obj_1 foo_obj_2
> BAR_OBJECTS := bar_obj_1 bar_obj_2
>
>
> Now, how would one setup a generic Makefile such that for each target
> defined in $(BINARIES) the dependencies $($<_OBJECTS) are added
> automatically?
I don't know whether it's possible to solve this using Make - but you
could possibly use a makro language like m4 or a template and a Perl
script to achieve what you want.
Michael