|
From: | Miguel Guedes |
Subject: | Expandable dependencies variables |
Date: | Mon, 05 Nov 2012 16:35:18 +0000 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 |
Hello List!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_2Now, how would one setup a generic Makefile such that for each target defined in $(BINARIES) the dependencies $($<_OBJECTS) are added automatically? Perhaps I'm being too ambitious and this isn't possible at all?
I've read up on the .SECONDEXPANSION special rule but I don't think that would allow for what I'm after.
Many thanks! Miguel
[Prev in Thread] | Current Thread | [Next in Thread] |