MAKE - possible to access the dependency list of another target?

icarus4586

Senior member
Jun 10, 2004
219
0
0
I've got two targets in a makefile that should always have the same dependency list, but since I may want to build them separately, they do need to be separate targets. Is there a way to have one access the dependency list of the other, so that I don't have to manually keep the two in sync?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Can't you use a variable to hold the dependency list and just have them both use the variable?
 

icarus4586

Senior member
Jun 10, 2004
219
0
0
Yeah, I could, that is better than nothing...

But the way it's set up, there's one "platform makefile" that has all the rules for all the targets. Then there are individual makefiles in different directories, depending on what you're building. The individual makefiles have the dependency lists, and the platform makefile gets called in from there (it uses patterns for the targets, so it's general purpose). I'd like to only modify the one platform makefile to do this. While adding a variable would be better than changing it twice in each individual makefile, it would be nicer to be able to add a target to the platform makefile and just reference the other target's dependency list...