shell - Makefile 没有检测到 Python
问题描述
我的 Makefile 中有以下内容,
dosomething:
ifeq (, $(shell which python))
$(error "Python not installed, please download and install Python to create database")
else
cd myfolder; python myfile.py
endif
当我运行时make dosomething
,它会抛出错误,告诉我下载并安装 python。但是当我which python
在我的外壳里做的时候,它说/usr/bin/python
不知道这里发生了什么
解决方案
我猜缩进的行以制表符开头?如果是这样,那么ifeq
,else
和endif
指令将被视为命令的一部分并传递给 shell 执行。
为确保make
评估这些指令,请删除前导选项卡...
dosomething:
ifeq (, $(shell which python))
$(error "Python not installed, please download and install Python to create database")
else
cd myfolder; python myfile.py
endif
推荐阅读
- c++ - 具有双精度类型值的数组实现的 C++ 堆栈
- google-cloud-firestore - 在 FireStore 中如何知道客户端是否正在收听特定文档
- javascript - 对唯一的有界数组进行排序的最有效方法?
- wordpress - 错误:对不起,您不能创建资源。[woocommerce_rest_cannot_create]
- wordpress - 是否可以在 Elementor 产品页面中显示特定的产品属性?
- mysql - How do I do a MySQL JOIN on conditions based on mathematical operations across two tables?
- c# - 在 Xamarin Shell 中的标签栏页面之间滑动
- flutter - Flutter 如何在 FCM backgroundHandler 静态方法中访问 Provider Context?
- reactjs - 将 translation.json 文件添加到在 doke 中运行的 React 应用程序的最佳方法是什么
- amazon-web-services - 如何计算保留一个月的 RDS 快照定价?