如何安装和使用“make"在 Windows 中? [英] How to install and use "make" in Windows?

查看:29
本文介绍了如何安装和使用“make"在 Windows 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照某人的说明将其存储库克隆到我的机器上.我想要的很简单:能够使用 make 命令作为设置代码环境的一部分,但我使用的是 Windows.网上查了一下,只能找到一个make.exe文件,一个make-4.1.tar.gz文件(不知道下一步怎么办) 以及有关如何下载 MinGW 的说明(适用于 GNU;但在安装后我没有发现任何提及make"的内容).

I'm following the instructions of someone whose repository I cloned to my machine. What I want is simple: to be able to use the make command as part of setting up the code environment, but I'm using Windows. I searched online, but I could only find a make.exe file, a make-4.1.tar.gz file (I don't know what to do with it next) and instructions for how to download MinGW (for GNU; but after installing it I didn't find any mention of "make").

如何在没有 GNU 编译器或相关软件包的情况下在 Windows 中使用 make?

How do I use make in Windows without a GNU compiler or related packages?

推荐答案

make 是一个 GNU 命令,因此在 Windows 上获得它的唯一方法是安装一个类似于 GNUWin32.无论如何,有几种方法可以实现:

make is a GNU command so the only way you can get it on Windows is installing a Windows version like the one provided by GNUWin32. Anyway, there are several options for getting that:

  1. 最简单的选择是使用 Chocolatey.首先你需要安装这个包管理器.安装后,您 simlpy 需要安装 make(您可能需要在提升的/管理员命令提示符下运行它):

  1. The most simple choice is using Chocolatey. First you need to install this package manager. Once installed you simlpy need to install make (you may need to run it in an elevated/admin command prompt) :

choco install make

  • 其他推荐选项是安装适用于 Linux 的 Windows 子系统(WSL/WSL2),因此您将在 Windows 10 中嵌入您选择的 Linux 发行版,您可以在其中安装 makegcc 和构建 C 程序所需的所有工具.

  • Other recommended option is installing a Windows Subsystem for Linux (WSL/WSL2), so you'll have a Linux distribution of your choice embedded in Windows 10 where you'll be able to install make, gccand all the tools you need to build C programs.

    对于较旧的 Windows 版本(带有 msvcrt.dll 的 MS Windows 2000/XP/2003/Vista/2008/7),您可以使用 GnuWin32.

    For older Windows versions (MS Windows 2000 / XP / 2003 / Vista / 2008 / 7 with msvcrt.dll) you can use GnuWin32.

    一个过时的替代方案是 MinGw,但是该项目似乎已被放弃,因此最好选择之前的选择之一.

    An outdated alternative was MinGw, but the project seems to be abandoned so it's better to go for one of the previous choices.

    这篇关于如何安装和使用“make"在 Windows 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆