| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>xmake</title>
- <link rel="icon" href="/assets/img/favicon.ico">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
- <meta name="description" content="Description">
- <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <link href="/assets/npm/github-markdown/github-markdown.min.css" rel="stylesheet">
- <style>
- .markdown-body {
- box-sizing: border-box;
- min-width: 200px;
- max-width: 980px;
- margin: 0 auto;
- padding: 45px;
- }
- @media (max-width: 767px) {
- .markdown-body {
- padding: 15px;
- }
- }
- </style>
- </head>
- <body>
- <article class="markdown-body">
- <h4>This is a mirror page, please see the original page: </h4><a href="https://xmake.io/#/guide/installation">https://xmake.io/#/guide/installation</a>
- <div id="wwads-panel" class="wwads-cn wwads-vertical wwads-sticky" data-id="239" style="max-width:180px;bottom:20px;right:20px;width:200px;height:260px;background:#fff;position:fixed"></div>
- </br>
- <script type="text/javascript" charset="UTF-8" src="https://cdn.wwads.cn/js/makemoney.js" async></script>
- <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CE7I52QU&placement=xmakeio" id="_carbonads_js"></script>
- <style>
- #carbonads {
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
- Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
- }
- #carbonads {
- display: flex;
- max-width: 330px;
- background-color: hsl(0, 0%, 98%);
- box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, .1);
- }
- #carbonads a {
- color: inherit;
- text-decoration: none;
- }
- #carbonads a:hover {
- color: inherit;
- }
- #carbonads span {
- position: relative;
- display: block;
- overflow: hidden;
- }
- #carbonads .carbon-wrap {
- display: flex;
- }
- .carbon-img {
- display: block;
- margin: 0;
- line-height: 1;
- }
- .carbon-img img {
- display: block;
- }
- .carbon-text {
- font-size: 13px;
- padding: 10px;
- line-height: 1.5;
- text-align: left;
- }
- .carbon-poweredby {
- display: block;
- padding: 8px 10px;
- background: repeating-linear-gradient(-45deg, transparent, transparent 5px, hsla(0, 0%, 0%, .025) 5px, hsla(0, 0%, 0%, .025) 10px) hsla(203, 11%, 95%, .4);
- text-align: center;
- text-transform: uppercase;
- letter-spacing: .5px;
- font-weight: 600;
- font-size: 9px;
- line-height: 1;
- }
- </style>
- <h2 id="master">Master</h2>
- <p>!> Note! Xmake is not recommended to install under root!</p>
- <h4 id="viacurl">via curl</h4>
- <pre><code class="lang-bash">curl -fsSL https://xmake.io/shget.text | bash
- </code></pre>
- <p>If you want to install a specific version and branch, you can append the version number and branch parameters later</p>
- <pre><code class="lang-bash">curl -fsSL https://xmake.io/shget.text | bash -s dev
- curl -fsSL https://xmake.io/shget.text | bash -s v2.7.7
- </code></pre>
- <h4 id="viawget">via wget</h4>
- <pre><code class="lang-bash">wget https://xmake.io/shget.text -O - | bash
- </code></pre>
- <h4 id="viapowershell">via powershell</h4>
- <pre><code class="lang-powershell">Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content
- </code></pre>
- <p>If you want to install a specific version and branch, you can append the version number and branch parameters later</p>
- <pre><code class="lang-powershell">Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content dev
- Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content v2.7.7
- </code></pre>
- <p>!> If the ps script execution prompt fails, you can try to execute in administrator mode.</p>
- <h2 id="windows">Windows</h2>
- <h3 id="viainstaller">via installer</h3>
- <ol>
- <li>Download the Xmake windows installer from <a href="https://github.com/xmake-io/xmake/releases">Releases</a></li>
- <li>Run xmake-[version].[win32|win64].exe</li>
- </ol>
- <p>!> Releases/xmake-[version].[win32|win64].zip has not installer, we need unzip it and add PATH environment variables by ourself.</p>
- <p>In addition, the installation package with <code>xmake-tinyc-xxx.exe</code>, which integrates the tinyc compiler environment, and comes with libc and winapi header files. By installing this package, you can compile c programs normally without msvc.<br>This is very useful for users who want to write some c tests or algorithm codes temporarily, but don't want to install msvc, but the installation package will be slightly larger than 2-3M.</p>
- <h3 id="viascoop">via scoop</h3>
- <pre><code class="lang-bash">scoop install xmake
- </code></pre>
- <h3 id="viawinget">via winget</h3>
- <pre><code class="lang-bash">winget install xmake
- </code></pre>
- <h2 id="msysmingw">Msys/Mingw</h2>
- <h3 id="mingw64">mingw64</h3>
- <pre><code class="lang-bash">pacman -Sy mingw-w64-x86_64-xmake
- </code></pre>
- <h3 id="mingw32">mingw32</h3>
- <pre><code class="lang-bash">pacman -Sy mingw-w64-i686-xmake
- </code></pre>
- <h2 id="macos">MacOS</h2>
- <pre><code class="lang-bash">brew install xmake
- </code></pre>
- <h2 id="archlinux">Arch Linux</h2>
- <pre><code class="lang-bash">sudo pacman -Sy xmake
- </code></pre>
- <h2 id="alpinelinux">Alpine Linux</h2>
- <pre><code class="lang-bash">sudo apk add xmake
- </code></pre>
- <h2 id="ubuntu">Ubuntu</h2>
- <h3 id="viaapt">via apt</h3>
- <pre><code class="lang-bash">sudo add-apt-repository ppa:xmake-io/xmake
- sudo apt update
- sudo apt install xmake
- </code></pre>
- <p>Also, Xmake has recently been added to the official Debian repositories: <a href="https://packages.debian.org/sid/xmake">https://packages.debian.org/sid/xmake</a></p>
- <h2 id="fedorarhelopensusecentos">Fedora/RHEL/OpenSUSE/CentOS</h2>
- <p>For Fedora 39 and above, you can install directly from the official repositories using the following command:</p>
- <pre><code class="lang-bash">sudo dnf install xmake
- </code></pre>
- <p>We can also install from the Copr repository:</p>
- <pre><code class="lang-bash">sudo dnf copr enable waruqi/xmake
- sudo dnf install xmake
- </code></pre>
- <h2 id="gentoo">Gentoo</h2>
- <ol>
- <li>Refer to <a href="https://wiki.gentoo.org/wiki/Project:GURU/Information_for_End_Users">here</a> to add GURU to your system repository</li>
- <li>Install dev-util/xmake</li>
- </ol>
- <pre><code class="lang-bash">sudo emerge -a --autounmask dev-util/xmake
- </code></pre>
- <h2 id="otherlinux">Other Linux</h2>
- <p>Download xmake <code>xmake-x.x.x.gz.run</code> install package from <a href="https://github.com/xmake-io/xmake/releases">Releases</a> </p>
- <pre><code class="lang-bash">sudo chmod 777 ./xmake-x.x.x.gz.run
- ./xmake-x.x.x.gz.run
- </code></pre>
- <h2 id="freebsd">FreeBSD</h2>
- <p>Due to package name conflicts, only xmake-io can be used as the package name.</p>
- <pre><code class="lang-bash">pkg install xmake-io
- </code></pre>
- <h2 id="termuxandroid">Termux (Android)</h2>
- <pre><code class="lang-bash">pkg install xmake
- </code></pre>
- <h2 id="bundlepackage">Bundle package</h2>
- <p>If you don't want to install, we also provide another Bundle packaging format, which does not require user installation, a single executable file, can be run and used after downloading, and is easy to distribute.</p>
- <p>It will build all Lua scripts into the Xmake executable file, without the need for additional installation and configuration of any environment variables.</p>
- <p>We can get them from <a href="https://github.com/xmake-io/xmake/releases">Releases</a>, and there are currently some Bundle packages as follows.</p>
- <pre><code>xmake-bundle-v2.9.8.arm64.exe
- xmake-bundle-v2.9.8.cosmocc
- xmake-bundle-v2.9.8.linux.x86_64
- xmake-bundle-v2.9.8.macos.arm64
- xmake-bundle-v2.9.8.macos.x86_64
- xmake-bundle-v2.9.8.win32.exe
- xmake-bundle-v2.9.8.win64.exe
- </code></pre><p>Among them, the package with the <code>.cosmocc</code> suffix provides the ability to run across platforms, but the support for Windows is still relatively weak, and it is not recommended to use it on Windows.</p>
- <p>The others are single executable files for specific platforms, and users can download and use them as needed according to their own systems.</p>
- <h2 id="sourcecompilationandinstallation">Source compilation and installation</h2>
- <h3 id="installation">Installation</h3>
- <p>!> Note! Xmake is not recommended to install under root!</p>
- <pre><code class="lang-bash">git clone --recursive https://github.com/xmake-io/xmake.git
- cd ./xmake
- # On macOS, you may need to run: export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
- ./configure
- make
- ./scripts/get.sh __local__ __install_only__
- source ~/.xmake/profile
- </code></pre>
- <p>If you think the source of github is too slow, you can pull it through the mirror source of gitee or gitlab: </p>
- <pre><code class="lang-bash">git clone --recursive https://gitee.com/tboox/xmake.git
- git clone --recursive https://gitlab.com/tboox/xmake.git
- </code></pre>
- <p>!> Since the current Xmake source maintains dependencies via git submodule, it is necessary to add the <code>--recursive</code> parameter to pull all submodules at the same time. Please do not download the tar.gz source directly, because github does not automatically package submodules. Code.</p>
- <p>If you forget to add <code>--recursive</code> when git clone, you can also execute <code>git submodule update --init</code> to pull all submodules, for example:</p>
- <pre><code class="lang-bash">git clone https://github.com/xmake-io/xmake.git
- cd ./xmake
- git submodule update --init
- ./configure
- make
- ./scripts/get.sh __local__ __install_only__
- </code></pre>
- <p>!> <code>./get.sh __local__</code> is installed to <code>~/.local/xmake</code>, and then loaded by <code>source ~/.xmake/profile</code>, so after the installation, the current terminal fails to execute Xmake, If the prompt is not found, manually execute <code>source ~/.xmake/profile</code>, and the next time you open the terminal, you don't need it.</p>
- <h3 id="sourcecompilationinwindowsplatform">Source compilation in Windows platform</h3>
- <pre><code class="lang-bash">git clone --recursive https://github.com/xmake-io/xmake.git
- cd ./xmake/core
- xmake
- </code></pre>
- <h3 id="onlyupdatetheluascript">Only update the lua script</h3>
- <p>This developer needs to debug the Xmake source locally:</p>
- <pre><code class="lang-bash">./scripts/get.sh __local__ __install_only__
- </code></pre>
- <h3 id="rootinstallation">Root installation</h3>
- <p>Xmake is not recommended for root installation, because this is very insecure. If the user has to download the root, if the prompt Xmake fails to run, please pass the <code>--root</code> parameter as prompted or set <code>XMAKE_ROOT=y</code>. The environment variable is forcibly enabled, provided that the user needs to pay attention to the risk of incorrect operating system file files under root.</p>
- <h3 id="dependencyissues">Dependency issues</h3>
- <ol>
- <li>If you encounter problems with readline, please install readline-devel or libreadline-dev dependencies. This is optional. It is only needed when the <code>xmake lua</code> command executes REPL.</li>
- <li>If you want to speed up compilation, you can install ccache, Xmake will automatically detect and use, which is also optional.</li>
- </ol>
- <h2 id="otherinstallationmethods">Other installation methods</h2>
- <p>!> This is also the source code compilation and installation, but the installation path will be written directly to <code>/usr/</code>, which requires root privileges, so unless special circumstances, this installation method is not recommended, it is recommended to use the <code>./get. Sh __local__</code> way to install, the installation path of the two installation methods is different, do not mix.</p>
- <p>Compile and install via make:</p>
- <pre><code class="lang-bash">./configure
- make
- sudo make install
- </code></pre>
- <p>Install to other specified directories:</p>
- <pre><code class="lang-bash">sudo make install PREFIX=/usr/local
- </code></pre>
- <h2 id="updateupgrade">Update Upgrade</h2>
- <p>Starting with v2.2.3, the <code>xmake update</code> command has been added to quickly update and upgrade itself. The default is to upgrade to the latest version. Of course, you can also specify to upgrade or roll back to a version:</p>
- <pre><code class="lang-bash">xmake update 2.7.1
- </code></pre>
- <p>We can also specify an update to the master/dev branch version:</p>
- <pre><code class="lang-bash">xmake update master
- xmake update dev
- </code></pre>
- <p>Update from the specified git source</p>
- <pre><code class="lang-bash">xmake update github:xmake-io/xmake#master
- xmake update gitee:tboox/xmake#dev # gitee mirror
- </code></pre>
- <p>If just update the xmake lua script changes, you can add <code>-s/--scriptonly</code> to quickly update the lua script.</p>
- <pre><code class="lang-bash">xmake update -s dev
- </code></pre>
- <p>Finally, if we want to uninstall Xmake, we're sorry to see you go! Still, it is supported: <code>xmake update --uninstall</code>.</p>
- </article>
- </body>
- </html>
|