在dmake中的shell命令添加“/ S”

我正在用MinGW系统编译Xindy。 dmake总是死于一个错误,我已经缩小到了Makefile中的几行。 试试在这个上运行dmake:

 SHELL = /bin/sh some-target: target=`echo info-recursive | sed s/-recursive//`; 

如果使用常规的Windows CMD而不是MinGW shell,则必须更改SHELLvariables的位置以指向“C:/MinGW/msys/1.0/sh.exe”之类的内容。 无论如何,上述失败与:

 CreateProcess failed (2). dmake: Error executing 'bin/sh /S /c "target=`echo info-recursive | sed s/-recursive//`;"': No such file or directory dmake: Error code -1, while making 'some-target' 

Sed和sh安装,他们工作正常。 当我尝试运行给定的命令作为单独的错误消息的输出,我得到这个:

 $ /bin/sh /S /c "target=`echo info-recursive | sed s/-recursive//`;" /bin/sh: /S: No such file or directory 

所以看起来,dmake(或者其他)在shell参数中join了'/ S / c',bash认为它是一个文件名,然后在找不到它时失败。

有没有人有这方面的经验或知道我可以解决这个问题?

dmake源代码的简要检查表明问题在于$(SHELL)被设置得太晚,并且在启动时仍为空( macros.mk ,第37行):

 11 .IF $(SHELL) == $(NULL) ... 15 SHELL *:= $(COMSPEC) ... ... 35 .IF $(SHELL) == $(COMSPEC) 36 .IF $(COMSPEC:lf) == cmd.exe 37 SHELLFLAGS *:= $(SWITCHAR)S $(SWITCHAR)c 

您可以通过在dmake命令行调用中添加SHELL="C:/MinGW/msys/1.0/sh.exe"来解决此问题。

(我已经多年没有使用过dmake了,所以可能会在这里弄错,但是如果你能得到一个看起来像自动配置的makefile与dmake一起工作的话,我会留下深刻的印象,这个IIRC有一些不同的味道。找到一个GNU 制造或类似的。)