How to assign the output of a command to a Makefile variable

后端 未结 7 1120
生来不讨喜
生来不讨喜 2020-12-02 05:11

I need to execute some make rules conditionally, only if the Python installed is greater than a certain version (say 2.5).

I thought I could do something like execut

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 05:29

    Wrapping the assignment in an eval is working for me.

    # dependency on .PHONY prevents Make from 
    # thinking there's `nothing to be done`
    set_opts: .PHONY
      $(eval DOCKER_OPTS = -v $(shell mktemp -d -p /scratch):/output)
    

提交回复
热议问题