简体   繁体   English

Makefile:Shell命令问题

[英]Makefile : Shell command issue

I am trying to run a make file that is related to a open source project in the github but i getting error during on run it 我正在尝试运行与github中的开源项目相关的make文件,但是在运行时出现错误

It is first line of this make file and it cause an error 这是该make文件的第一行,它会导致错误

NDK_PATH=$(shell dirname `which ndk-build`)

and the error is : 错误是:

-bash: shell: command not found

what is the mean of shell ? shell是什么意思? shell command not found in Linux !! Linux中找不到shell命令!

The shell function does command expansion in the make file. shell函数在make文件中进行命令扩展。 You can refer the shell function manual in makefile for more information. 您可以参考makefile中shell函数手册以获取更多信息。

For your case NDK_PATH=$(shell dirname 'which ndk-build') in the makefile, the NDK_PATH should store the directory name where ndk-build command locates. 对于您的情况, NDK_PATH=$(shell dirname 'which ndk-build') ,NDK_PATH应该存储ndk-build命令所在的目录名称。

You are not allowed to execute NDK_PATH=$(shell dirname 'which ndk-build') in your terminal, which will result in the error you post. 您不允许在NDK_PATH=$(shell dirname 'which ndk-build')中执行NDK_PATH=$(shell dirname 'which ndk-build') ,这将导致您发布错误。

I have the same problem, and solved it like as followings, 我有同样的问题,并按照以下方式解决了这个问题,

you can try this instead 你可以试试看

NDK_BIN := $(shell which ndk-build)
NDK_PATH := $(shell dirname $(NDK_BIN))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM