admin 管理员组文章数量: 1184232
在windows上尝试makefile的可以试一试。
注意需要下载好mingw、配置好gcc路径,才能成功使用make
方法一:
从官网下载 make.exe Make for Windows
官网首页:https://www.gnu/software/make/
下载地址:
https://gnuwin32.sourceforge
点击框中的下载,下载后安装。把安装路径添加到环境变量 PATH 中.
[注: 系统环境变量路径:C:\Program Files (x86)\GnuWin32\bin]
在终端,执行以下命令,将出现Make版本信息:
C:\Users\dell>make -v
GNU Make 4.4.1
Built for Windows32
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu/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.
方法二:
1.命令行安装chocolatey,使用choco install 安装make 命令
用管理员权限启动cmd.exe,输入以下指令安装chocolatey
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
之后就可以用类似linux中apt-get的方式安装各种工具,此处用choco install安装make工具
choco install make
在终端,执行以下命令,将出现Make版本信息:
C:\Users\dell>make -v
GNU Make 4.4.1
Built for Windows32
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu/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.
之后找到Makefile路径,使用make命令即可
make
或
make -f MakeFileOtherName.xx
版权声明:本文标题:MinGW:Windows下命令行使用make 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1764850975a3323659.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论