lundi 17 juillet 2017

makefile: % pattern in prerequisite $(variable)

I have something like this that works:

target1.PREREQUISITES = file11 file12 file13
target2.PREREQUISITES = file21 file22 file23

$(myDir)target1.sfx : $(target1.PREREQUISITES)
    <same recipe here>

$(myDir)target2.sfx : $(target2.PREREQUISITES)
    <same recipe here>

and this is what I want to do but it not working:

target1.PREREQUISITES = file11 file12 file13
target2.PREREQUISITES = file21 file22 file23

$(myDir)%.sfx : $(%.PREREQUISITES)
    <commun recipe here>

It always says that there is nothing to do because the target is up to date.

I have the feeling that the problem could be what is done in each make phase, I mean, what is done first the % or $. Should it be working just fine?

Aucun commentaire:

Enregistrer un commentaire