如何获得类似的效果?
PYTHON3_OK = $(shell python3 --version 2> /dev/null | wc -l)
ifeq ($(PYTHON3_OK), 0)
$(error package 'python3' not found)
错误始终显示
答案 0 :(得分:0)
计算输出线的数量是反模式。怎么样
PYTHON3_OK := $(shell python3 --version 2>&1)
ifeq ('$(PYTHON3_OK)','')
$(error package 'python3' not found)
endif
或者当然更标准
PYTHON3_OK := $(shell type -P python3)
ifeq ('$(PYTHON3_OK)','')
$(error package 'python3' not found)
endif