首页 > 解决方案 > Makefile 找不到 shell 命令

问题描述

在我的 Makefile 中,我试图使用 find 命令获取目录的绝对路径。这是Makefile的片段

PATH := $(shell find /home/ -type d -path "*/name" -print -quit)
all: create

create:
       mkdir -p otherPathName

当我删除 PATH := $(shell .... ) 行时,Makefile 工作正常,但是当它被包含时,我得到了这个错误

make: mkdir: Command not found
Makefile:22: recipe for target 'create' failed
make: *** [create] Error 127

对于 Makefile 中的进一步操作,从“find”接收的绝对路径是必要的,但我不知道如何修复此错误。

标签: linuxmakefile

解决方案


推荐阅读