【发布时间】:2020-09-10 10:20:47
【问题描述】:
我需要从make目标调用一个函数,这个函数会被多次调用,
define generate_file
if [ "${RQM_SETUP}" = "ci" ]; then
echo "$1" > $(2).txt
else
echo "It is Not Setup";
fi
endef
all:
$(call generate_file,John Doe,101)
$(call generate_file,Peter Pan,102)
现在我陷入了这个错误:
bash-5.0# make
if [ "" = "ci" ]; then
/bin/sh: syntax error: unexpected end of file (expecting "fi")
make: *** [Makefile:10: all] Error 2
【问题讨论】: