完整的错误提示是:
/usr/bin/sh: -c: line 1: syntax error near unexpected token `('
/usr/bin/sh: -c: line 1: `D:/Program Files (x86)/mingw64/bin/make --no-print-directory main-build && D:/Program Files (x86)/mingw64/bin/make --no-print-directory post-build'
make: *** [makefile:66: all] Error 2
对应的makefile语句是:
# All Target
all:
+@$(MAKE) --no-print-directory main-build && $(MAKE) --no-print-directory post-build
这个提示看上去是说有语法错误,错误的 `(' 符号,
用ChatGPT分析:
按ChatGPT的建议,在git bash终端直接执行下列命令:
"D:/Program Files (x86)/mingw64/bin/make" --no-print-directory main-build && "D:/Program Files (x86)/mingw64/bin/make" --no-print-directory post-build
然后执行通过了,没有错误:
原来是Program Files (x86)这个目录名导致的,既然这样,把原来makefile里的相关语句修改一下就可以了:
# All Target
all:
+@"$(MAKE)" --no-print-directory main-build && "$(MAKE)" --no-print-directory post-build
最后,贴上ChatGPT的回答: