Can't assign variable inside recipe

前端 未结 2 934
长情又很酷
长情又很酷 2020-12-15 03:05

How do I make this work? It errors out with \"make: somevariable: Command not found\"

sometarget:
    somevariable = somevalue

Full example

2条回答
  •  星月不相逢
    2020-12-15 03:44

    I found a solution using the eval function:

    $(eval variablename=whatever)
    

    This works :)

    (although I may now try to find an easier build system ;))

    Thanks everyone for reading and also of course @eriktous for writing!

提交回复
热议问题