在windows下可以使用MinGW的make,安装方法网上有很多,不做阐述,一些按照linux下编写makefile可能会在Windows下出错,以下为我遇到一些可以用来解决的方法:
1.
process_begin: CreateProcess(NULL, pwd, ...) failed.
显示这条一般是在makefile中使用了"$(shell pwd)",但是shell是linux下的,Windows中没有shell,因此无法执行这条命令,解决方法也很简单,用windows下的类似程序替代,pwd的作用是打印当前路径,可以使用cmd下的"echo %cd%"来替代,但是要先告诉make用cmd来执行,根据make手册,使用SHELL变量来指定shell,如下:
SHELL=cmd
SUBDIRS=$(shell echo %cd%)
上面的代码可以起到与"$(shell pwd)"相同的效果。
make手册地址:https://www.gnu.org/software/make/manual/html_node/index.html
其中描述如何使用设置SHELL的页:https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html#Choosing-the-Shell
其他用到$(shell )的代码同理,可以在指定SHELL后,用windows下的类似程序进行替代