MinGW:Windows下命令行使用make

        在windows上尝试makefile的可以试一试。

        注意需要下载好mingw、配置好gcc路径,才能成功使用make

方法一:

从官网下载 make.exe Make for Windows

官网首页:https://www.gnu.org/software/make/

下载地址:

https://gnuwin32.sourceforge.net

点击框中的下载,下载后安装。把安装路径添加到环境变量 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.org/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.org/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.org/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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值