Check if a program exists from a Makefile

后端 未结 12 1108
时光取名叫无心
时光取名叫无心 2020-12-12 20:20

How can I check if a program is callable from a Makefile?

(That is, the program should exist in the path or otherwise be callable.)

It could be used to chec

12条回答
  •  渐次进展
    2020-12-12 20:22

    is this what you did?

    check: PYTHON-exists
    PYTHON-exists: ; @which python > /dev/null
    mytarget: check
    .PHONY: check PYTHON-exists
    

    credit to my coworker.

提交回复
热议问题