我尝试在Windows中使用类似curl、rm、start等命令的makefile指令,使用了如下的makefile处理器:http://gnuwin32.sourceforge.net/packages/make.htm。然而似乎不可能实现,我的命令集非常有限。有哪些方法可以扩展我的命令集呢?我将非常感激任何帮助,谢谢!
either: Use WSL, which offers you a choice of Linux distros in which both make
and the standard Unix utilities are natively available - you then need neither cmd.exe
nor PowerShell.
and/or: Use PowerShell Core and invoke your commands as follows:
pwsh -noprofile -command <your command>
SHELL := pwsh -NoProfile
at the top of the MakeFile
, after which you can invoke PowerShell (Core) commands directly.gcc
提供 -DTMSTMP=1553521024.52
时,Powershell 无法正确解析命令行,导致你得到完全难以理解的错误信息“找不到 .52 文件”。我放弃了使用 Powershell 来完成这样的任务,因为它与 Unix shell 差异太大,使得兼容性成为一个没有价值的目标。 - Vroomfondel.PHONY: psStuff
psStuff:
powershell <your command>
powershell curl google.de
powershell rm -r folder
powershell start yourwebsite.de
SHELL
变量设置为powershell
(可能带有适当的路径)是否可行? - MadScientistmake
的 Windows 版本中完全忽略了 SHELL
。 - mklement0