我正在尝试在makefile中运行,就像这样,我是一个编写makefile的新手。
EXECUTABLES = emcc em++ emcmake emconfigure emmake
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)), \
@echo "Emsdk binaries are already added to path", \
$(if [! -d "${HOME}/.wasm/emsdk"]), \
@echo "Emsdk is not installed consider running bash install_requirements first",\
@source "${HOME}/.wasm/emsdk/emsdk_env.sh"))但是它抛出错误,说出像这样的insufficient number of arguments (1) to function `if'. Stop.。我是不是遗漏了什么?
发布于 2021-12-01 21:03:22
我不确定你作业的这一部分是什么意思:
$(if [! -d "${HOME}/.wasm/emsdk"]), \但这绝对是不正确的语法。您只用一个参数关闭了if函数,而它至少需要两个参数。
也许你真的想在这里使用$(shell ...)?但我不明白这会做什么;make的if函数不会查看退出代码。
https://stackoverflow.com/questions/70191005
复制相似问题