我使用的windows的gitbash命令行终端。未安装时,发现系统没有make命令。
make -h
bash: make: command not found
- 使用windows的包管理工具winget安装:
winget.exe install gnuwin32.make
2. 将安装的make的bin目录添加到环境变量:
setx PATH "%PATH%;/c/Program Files (x86)/GnuWin32/bin"
- 重启终端,使上面的配置生效,测试make命令是否可用:
make -h
Usage: make [options] [target] ...
Options:
-b, -m Ignored for compatibility.
-B, --always-make Unconditionally make all targets.
-C DIRECTORY, --directory=DIRECTORY