为什么 GNU make 进程挂起?

Why does GNU make process hangs up?

TL;DR:

全新Windows10 安装,我安装了ARM DS-5 v5.26.2 开发工具。我正在使用它的 make.exe 来构建我们的项目,无论是从 Cygwin 命令行还是从 Eclipse IDE 的构建设置。

我们的 Makefile 包含以下行:

uname_result := $(shell uname -s)

但是每当 make 到达这条线时,它就会卡住。这发生在 bash 终端以及 Window 的命令提示符上。

更新 3:

经过更多故障排除后,问题似乎出在 DS-5 的 make 实用程序本身。我将 make 添加到我的 Cygwin 安装中,并使用了那个,现在我的构建 运行 OK。

现在的问题是为什么 ARM 的版本不能在我的 Win 10 机器上运行,而它以前在 Win 7 上运行良好。


长版:

在工作电脑上使用 Windows 7 两年后,我刚刚在工作电脑上全新安装了 Windows 10。在过去的两天里,我正在经历重新安装我们的工具并恢复体形的过程。不幸的是,我现在受困于 make 让我头疼。

我们使用 ARM 的 DS-5 工具集开发嵌入式固件。该项目是一个 Makefile 项目,因此我们不使用内置的 Eclipse 构建器。为了在 Eclipse 环境之外构建项目,我安装了 Cygwin 以方便使用 bash CLI。 makeclang 都是 DS-5 安装的一部分。

当我在项目的 Makefile 表单 CLI 上 运行 make 时,执行会无限期地卡住。

[...去除一个长篇大论继问题揭露过程...]

追查问题根源,发现问题出在这一行:

uname_result := $(shell uname -s 2>NUL)

为了简化,我验证了问题出在shell命令本身。我用以下命令做了一个非常简单的 Makefile,但也卡住了:

uname_result := $(shell ls)

当使用 make -d 处理 makefile 时,当它到达该行时,我得到以下信息:

CreateProcess(C:\cygwin64\bin\ls.exe,ls,...)
Main thread handle = 000000000000009C

为什么make不能执行shell命令?在迁移之前,这个完全相同的脚本曾经工作得很好。

更新 1 及更多信息:

我的系统上只有一个make.exe,放在C:\DS-5_v5.26.2\bin

我创建了一个简化的 makefile,Makefile.tmp:

.PHONY: help
help:
    echo ====================== TESTING ======================
    uname_result := $(shell ls)

我从 Cygwin 的 bash CLI 处理这个 makefile:

$ /cygdrive/c/DS-5_v5.26.2/bin/make -d -f Makefile.tmp help

我在 return:

中得到大量诊断
GNU Make 4.1
Built for Windows32
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
find_and_set_shell() path search set default_shell = C:/cygwin64/bin/sh.exe
Reading makefiles...
Reading makefile 'Makefile.tmp'...
Updating makefiles....
 Considering target file 'Makefile.tmp'.
  Looking for an implicit rule for 'Makefile.tmp'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.o'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.c'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.cc'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.C'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.cpp'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.p'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.f'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.F'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.m'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.r'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.s'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.S'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.mod'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.sh'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp,v'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'RCS/Makefile.tmp,v'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'RCS/Makefile.tmp'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 's.Makefile.tmp'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'SCCS/s.Makefile.tmp'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.o'.
  Looking for a rule with intermediate file 'Makefile.tmp.o'.
   Avoiding implicit rule recursion.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.c'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.cc'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.C'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.cpp'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.p'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.f'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.F'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.m'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.r'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.s'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.S'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.mod'.
   Trying pattern rule with stem 'Makefile.tmp.o'.
   Trying implicit prerequisite 'Makefile.tmp.o,v'.
   Trying pattern rule with stem 'Makefile.tmp.o'.
   Trying implicit prerequisite 'RCS/Makefile.tmp.o,v'.
   Trying pattern rule with stem 'Makefile.tmp.o'.
   Trying implicit prerequisite 'RCS/Makefile.tmp.o'.
   Trying pattern rule with stem 'Makefile.tmp.o'.
   Trying implicit prerequisite 's.Makefile.tmp.o'.
   Trying pattern rule with stem 'Makefile.tmp.o'.
   Trying implicit prerequisite 'SCCS/s.Makefile.tmp.o'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.c'.
   Looking for a rule with intermediate file 'Makefile.tmp.c'.
    Avoiding implicit rule recursion.
    Avoiding implicit rule recursion.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.y'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.l'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.w'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.w'.
    Trying pattern rule with stem 'Makefile.tmp.c'.
    Trying implicit prerequisite 'Makefile.tmp.c,v'.
    Trying pattern rule with stem 'Makefile.tmp.c'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.c,v'.
    Trying pattern rule with stem 'Makefile.tmp.c'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.c'.
    Trying pattern rule with stem 'Makefile.tmp.c'.
    Trying implicit prerequisite 's.Makefile.tmp.c'.
    Trying pattern rule with stem 'Makefile.tmp.c'.
    Trying implicit prerequisite 'SCCS/s.Makefile.tmp.c'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.y'.
    Looking for a rule with intermediate file 'Makefile.tmp.y'.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Trying pattern rule with stem 'Makefile.tmp.y'.
     Trying implicit prerequisite 'Makefile.tmp.y,v'.
     Trying pattern rule with stem 'Makefile.tmp.y'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.y,v'.
     Trying pattern rule with stem 'Makefile.tmp.y'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.y'.
     Trying pattern rule with stem 'Makefile.tmp.y'.
     Trying implicit prerequisite 's.Makefile.tmp.y'.
     Trying pattern rule with stem 'Makefile.tmp.y'.
     Trying implicit prerequisite 'SCCS/s.Makefile.tmp.y'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.l'.
    Looking for a rule with intermediate file 'Makefile.tmp.l'.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Trying pattern rule with stem 'Makefile.tmp.l'.
     Trying implicit prerequisite 'Makefile.tmp.l,v'.
     Trying pattern rule with stem 'Makefile.tmp.l'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.l,v'.
     Trying pattern rule with stem 'Makefile.tmp.l'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.l'.
     Trying pattern rule with stem 'Makefile.tmp.l'.
     Trying implicit prerequisite 's.Makefile.tmp.l'.
     Trying pattern rule with stem 'Makefile.tmp.l'.
     Trying implicit prerequisite 'SCCS/s.Makefile.tmp.l'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.w'.
    Looking for a rule with intermediate file 'Makefile.tmp.w'.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Trying pattern rule with stem 'Makefile.tmp.w'.
     Trying implicit prerequisite 'Makefile.tmp.w,v'.
     Trying pattern rule with stem 'Makefile.tmp.w'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.w,v'.
     Trying pattern rule with stem 'Makefile.tmp.w'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.w'.
     Trying pattern rule with stem 'Makefile.tmp.w'.
     Trying implicit prerequisite 's.Makefile.tmp.w'.
     Trying pattern rule with stem 'Makefile.tmp.w'.
     Trying implicit prerequisite 'SCCS/s.Makefile.tmp.w'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Rejecting impossible implicit prerequisite 'Makefile.tmp.w'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.cc'.
   Looking for a rule with intermediate file 'Makefile.tmp.cc'.
    Avoiding implicit rule recursion.
    Avoiding implicit rule recursion.
    Trying pattern rule with stem 'Makefile.tmp.cc'.
    Trying implicit prerequisite 'Makefile.tmp.cc,v'.
    Trying pattern rule with stem 'Makefile.tmp.cc'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.cc,v'.
    Trying pattern rule with stem 'Makefile.tmp.cc'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.cc'.
    Trying pattern rule with stem 'Makefile.tmp.cc'.
    Trying implicit prerequisite 's.Makefile.tmp.cc'.
    Trying pattern rule with stem 'Makefile.tmp.cc'.
    Trying implicit prerequisite 'SCCS/s.Makefile.tmp.cc'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.C'.
   Looking for a rule with intermediate file 'Makefile.tmp.C'.
    Avoiding implicit rule recursion.
    Avoiding implicit rule recursion.
    Trying pattern rule with stem 'Makefile.tmp.C'.
    Trying implicit prerequisite 'Makefile.tmp.C,v'.
    Trying pattern rule with stem 'Makefile.tmp.C'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.C,v'.
    Trying pattern rule with stem 'Makefile.tmp.C'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.C'.
    Trying pattern rule with stem 'Makefile.tmp.C'.
    Trying implicit prerequisite 's.Makefile.tmp.C'.
    Trying pattern rule with stem 'Makefile.tmp.C'.
    Trying implicit prerequisite 'SCCS/s.Makefile.tmp.C'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.cpp'.
   Looking for a rule with intermediate file 'Makefile.tmp.cpp'.
    Avoiding implicit rule recursion.
    Avoiding implicit rule recursion.
    Trying pattern rule with stem 'Makefile.tmp.cpp'.
    Trying implicit prerequisite 'Makefile.tmp.cpp,v'.
    Trying pattern rule with stem 'Makefile.tmp.cpp'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.cpp,v'.
    Trying pattern rule with stem 'Makefile.tmp.cpp'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.cpp'.
    Trying pattern rule with stem 'Makefile.tmp.cpp'.
    Trying implicit prerequisite 's.Makefile.tmp.cpp'.
    Trying pattern rule with stem 'Makefile.tmp.cpp'.
    Trying implicit prerequisite 'SCCS/s.Makefile.tmp.cpp'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.p'.
   Looking for a rule with intermediate file 'Makefile.tmp.p'.
    Avoiding implicit rule recursion.
    Avoiding implicit rule recursion.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.web'.
    Trying pattern rule with stem 'Makefile.tmp.p'.
    Trying implicit prerequisite 'Makefile.tmp.p,v'.
    Trying pattern rule with stem 'Makefile.tmp.p'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.p,v'.
    Trying pattern rule with stem 'Makefile.tmp.p'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.p'.
    Trying pattern rule with stem 'Makefile.tmp.p'.
    Trying implicit prerequisite 's.Makefile.tmp.p'.
    Trying pattern rule with stem 'Makefile.tmp.p'.
    Trying implicit prerequisite 'SCCS/s.Makefile.tmp.p'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.web'.
    Looking for a rule with intermediate file 'Makefile.tmp.web'.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Trying pattern rule with stem 'Makefile.tmp.web'.
     Trying implicit prerequisite 'Makefile.tmp.web,v'.
     Trying pattern rule with stem 'Makefile.tmp.web'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.web,v'.
     Trying pattern rule with stem 'Makefile.tmp.web'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.web'.
     Trying pattern rule with stem 'Makefile.tmp.web'.
     Trying implicit prerequisite 's.Makefile.tmp.web'.
     Trying pattern rule with stem 'Makefile.tmp.web'.
     Trying implicit prerequisite 'SCCS/s.Makefile.tmp.web'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.f'.
   Looking for a rule with intermediate file 'Makefile.tmp.f'.
    Avoiding implicit rule recursion.
    Avoiding implicit rule recursion.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.F'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.r'.
    Trying pattern rule with stem 'Makefile.tmp.f'.
    Trying implicit prerequisite 'Makefile.tmp.f,v'.
    Trying pattern rule with stem 'Makefile.tmp.f'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.f,v'.
    Trying pattern rule with stem 'Makefile.tmp.f'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.f'.
    Trying pattern rule with stem 'Makefile.tmp.f'.
    Trying implicit prerequisite 's.Makefile.tmp.f'.
    Trying pattern rule with stem 'Makefile.tmp.f'.
    Trying implicit prerequisite 'SCCS/s.Makefile.tmp.f'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.F'.
    Looking for a rule with intermediate file 'Makefile.tmp.F'.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Trying pattern rule with stem 'Makefile.tmp.F'.
     Trying implicit prerequisite 'Makefile.tmp.F,v'.
     Trying pattern rule with stem 'Makefile.tmp.F'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.F,v'.
     Trying pattern rule with stem 'Makefile.tmp.F'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.F'.
     Trying pattern rule with stem 'Makefile.tmp.F'.
     Trying implicit prerequisite 's.Makefile.tmp.F'.
     Trying pattern rule with stem 'Makefile.tmp.F'.
     Trying implicit prerequisite 'SCCS/s.Makefile.tmp.F'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.r'.
    Looking for a rule with intermediate file 'Makefile.tmp.r'.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Trying pattern rule with stem 'Makefile.tmp'.
     Rejecting impossible implicit prerequisite 'Makefile.tmp.l'.
     Trying pattern rule with stem 'Makefile.tmp.r'.
     Trying implicit prerequisite 'Makefile.tmp.r,v'.
     Trying pattern rule with stem 'Makefile.tmp.r'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.r,v'.
     Trying pattern rule with stem 'Makefile.tmp.r'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.r'.
     Trying pattern rule with stem 'Makefile.tmp.r'.
     Trying implicit prerequisite 's.Makefile.tmp.r'.
     Trying pattern rule with stem 'Makefile.tmp.r'.
     Trying implicit prerequisite 'SCCS/s.Makefile.tmp.r'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Rejecting impossible implicit prerequisite 'Makefile.tmp.F'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.m'.
   Looking for a rule with intermediate file 'Makefile.tmp.m'.
    Avoiding implicit rule recursion.
    Avoiding implicit rule recursion.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.ym'.
    Trying pattern rule with stem 'Makefile.tmp.m'.
    Trying implicit prerequisite 'Makefile.tmp.m,v'.
    Trying pattern rule with stem 'Makefile.tmp.m'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.m,v'.
    Trying pattern rule with stem 'Makefile.tmp.m'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.m'.
    Trying pattern rule with stem 'Makefile.tmp.m'.
    Trying implicit prerequisite 's.Makefile.tmp.m'.
    Trying pattern rule with stem 'Makefile.tmp.m'.
    Trying implicit prerequisite 'SCCS/s.Makefile.tmp.m'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.ym'.
    Looking for a rule with intermediate file 'Makefile.tmp.ym'.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Trying pattern rule with stem 'Makefile.tmp.ym'.
     Trying implicit prerequisite 'Makefile.tmp.ym,v'.
     Trying pattern rule with stem 'Makefile.tmp.ym'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.ym,v'.
     Trying pattern rule with stem 'Makefile.tmp.ym'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.ym'.
     Trying pattern rule with stem 'Makefile.tmp.ym'.
     Trying implicit prerequisite 's.Makefile.tmp.ym'.
     Trying pattern rule with stem 'Makefile.tmp.ym'.
     Trying implicit prerequisite 'SCCS/s.Makefile.tmp.ym'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Rejecting impossible implicit prerequisite 'Makefile.tmp.r'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.s'.
   Looking for a rule with intermediate file 'Makefile.tmp.s'.
    Avoiding implicit rule recursion.
    Avoiding implicit rule recursion.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.S'.
    Trying pattern rule with stem 'Makefile.tmp.s'.
    Trying implicit prerequisite 'Makefile.tmp.s,v'.
    Trying pattern rule with stem 'Makefile.tmp.s'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.s,v'.
    Trying pattern rule with stem 'Makefile.tmp.s'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.s'.
    Trying pattern rule with stem 'Makefile.tmp.s'.
    Trying implicit prerequisite 's.Makefile.tmp.s'.
    Trying pattern rule with stem 'Makefile.tmp.s'.
    Trying implicit prerequisite 'SCCS/s.Makefile.tmp.s'.
    Trying pattern rule with stem 'Makefile.tmp'.
    Trying implicit prerequisite 'Makefile.tmp.S'.
    Looking for a rule with intermediate file 'Makefile.tmp.S'.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Avoiding implicit rule recursion.
     Trying pattern rule with stem 'Makefile.tmp.S'.
     Trying implicit prerequisite 'Makefile.tmp.S,v'.
     Trying pattern rule with stem 'Makefile.tmp.S'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.S,v'.
     Trying pattern rule with stem 'Makefile.tmp.S'.
     Trying implicit prerequisite 'RCS/Makefile.tmp.S'.
     Trying pattern rule with stem 'Makefile.tmp.S'.
     Trying implicit prerequisite 's.Makefile.tmp.S'.
     Trying pattern rule with stem 'Makefile.tmp.S'.
     Trying implicit prerequisite 'SCCS/s.Makefile.tmp.S'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Rejecting impossible implicit prerequisite 'Makefile.tmp.S'.
   Trying pattern rule with stem 'Makefile.tmp'.
   Trying implicit prerequisite 'Makefile.tmp.mod'.
   Looking for a rule with intermediate file 'Makefile.tmp.mod'.
    Avoiding implicit rule recursion.
    Avoiding implicit rule recursion.
    Trying pattern rule with stem 'Makefile.tmp.mod'.
    Trying implicit prerequisite 'Makefile.tmp.mod,v'.
    Trying pattern rule with stem 'Makefile.tmp.mod'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.mod,v'.
    Trying pattern rule with stem 'Makefile.tmp.mod'.
    Trying implicit prerequisite 'RCS/Makefile.tmp.mod'.
    Trying pattern rule with stem 'Makefile.tmp.mod'.
    Trying implicit prerequisite 's.Makefile.tmp.mod'.
    Trying pattern rule with stem 'Makefile.tmp.mod'.
    Trying implicit prerequisite 'SCCS/s.Makefile.tmp.mod'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Rejecting impossible implicit prerequisite 'Makefile.tmp.c'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Rejecting impossible implicit prerequisite 'Makefile.tmp.cc'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Rejecting impossible implicit prerequisite 'Makefile.tmp.C'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Rejecting impossible implicit prerequisite 'Makefile.tmp.cpp'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Rejecting impossible implicit prerequisite 'Makefile.tmp.p'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Rejecting impossible implicit prerequisite 'Makefile.tmp.f'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Rejecting impossible implicit prerequisite 'Makefile.tmp.F'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Rejecting impossible implicit prerequisite 'Makefile.tmp.m'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Rejecting impossible implicit prerequisite 'Makefile.tmp.r'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Rejecting impossible implicit prerequisite 'Makefile.tmp.s'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Rejecting impossible implicit prerequisite 'Makefile.tmp.S'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Rejecting impossible implicit prerequisite 'Makefile.tmp.mod'.
  Trying pattern rule with stem 'Makefile.tmp'.
  Trying implicit prerequisite 'Makefile.tmp.sh'.
  Looking for a rule with intermediate file 'Makefile.tmp.sh'.
   Avoiding implicit rule recursion.
   Trying pattern rule with stem 'Makefile.tmp.sh'.
   Trying implicit prerequisite 'Makefile.tmp.sh,v'.
   Trying pattern rule with stem 'Makefile.tmp.sh'.
   Trying implicit prerequisite 'RCS/Makefile.tmp.sh,v'.
   Trying pattern rule with stem 'Makefile.tmp.sh'.
   Trying implicit prerequisite 'RCS/Makefile.tmp.sh'.
   Trying pattern rule with stem 'Makefile.tmp.sh'.
   Trying implicit prerequisite 's.Makefile.tmp.sh'.
   Trying pattern rule with stem 'Makefile.tmp.sh'.
   Trying implicit prerequisite 'SCCS/s.Makefile.tmp.sh'.
  No implicit rule found for 'Makefile.tmp'.
  Finished prerequisites of target file 'Makefile.tmp'.
 No need to remake target 'Makefile.tmp'.
Updating goal targets....
Considering target file 'help'.
 File 'help' does not exist.
 Finished prerequisites of target file 'help'.
Must remake target 'help'.
CreateProcess(C:\cygwin64\bin\ls.exe,ls,...)
Main thread handle = 000000000000008C

但重要的可能是第一部分和最后一部分:

GNU Make 4.1
Built for Windows32
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
find_and_set_shell() path search set default_shell = C:/cygwin64/bin/sh.exe
Reading makefiles...
Reading makefile 'Makefile.tmp'...
Updating makefiles....
 Considering target file 'Makefile.tmp'.
  Looking for an implicit rule for 'Makefile.tmp'.
  Trying pattern rule with stem 'Makefile.tmp'.
. . . . 
. . . . 
   Trying implicit prerequisite 'SCCS/s.Makefile.tmp.sh'.
  No implicit rule found for 'Makefile.tmp'.
  Finished prerequisites of target file 'Makefile.tmp'.
 No need to remake target 'Makefile.tmp'.
Updating goal targets....
Considering target file 'help'.
 File 'help' does not exist.
 Finished prerequisites of target file 'help'.
Must remake target 'help'.
CreateProcess(C:\cygwin64\bin\ls.exe,ls,...)
Main thread handle = 000000000000008C

因此,如您所见,它既不执行 echo 命令也不执行 ls 命令。如果我注释掉 shell 命令,我会看到 TESTING 消息回显到终端。

显然,DS-5 的 make.exe 是为 Windows 打造的。从 Cygwin bash 调用它应该有问题吗?如果是这样,为什么它在 Win 7 机器上运行良好?

更新 2 及更多信息:

我重复了测试,这次 运行ning 来自 Windows' CMD 提示。我用 dir 命令替换了 bshell 行中的 ls 命令。令人惊讶的是,同样的行为也在 CMD 上发生了!

所以,显然,问题 makeshell 函数调用。

在与 ARM 支持联系后,我得到了以下回复:

With regards to the problem you are seeing this is a known issue with GNU 
make version 4.1 supplied by ARM with DS5.  This version of make was shipped 
with DS5 versions 5.23 to 5.26. DS5-5.22 used make 3.81, and DS5-5.27 and 
later have used make 4.2 - neither of which suffer from this defect.

There are three possible workarounds in your case:
1 - Avoid using the "shell" command in your make script - this is probably 
not ideal!
2 - Upgrade your DS-5 version to 5.27 or later - this may or may not be an 
option for you.
3 - Download[*] a different version of GNU make and use it in place of the 
version 3.81 that was supplied with your current version of DS-5.

[*] - Although make is freely available under GPL, unfortunately there are 
legal implications involved with its redistribution which is why I can't 
simply email you an alternative version of make.

感谢 ARM 的 Alex 对此的支持。