!> Note! xmake is not recommended to install under root!
bash <(curl -fsSL https://xmake.io/shget.text)
bash <(wget https://xmake.io/shget.text -O -)
Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content
!> If the ps script execution prompt fails, you can try to execute in administrator mode.
!> Releases/xmake-[version].[win32|win64].zip has not installer, we need unzip it and add PATH environment variables by ourself.
In addition, the installation package with xmake-tinyc-xxx.exe
, 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.
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.
scoop install xmake
winget install xmake
pacman -Sy mingw-w64-x86_64-xmake
pacman -Sy mingw-w64-i686-xmake
brew install xmake
yaourt xmake
sudo add-apt-repository ppa:xmake-io/xmake
sudo apt update
sudo apt install xmake
Download deb package to install it:
.deb
install package from Releasesdpkg -i xmake-xxxx.deb
sudo dnf copr enable waruqi/xmake
sudo dnf install xmake
Download xmake xmake-x.x.x.gz.run
install package from Releases
sudo chmod 777 ./xmake-x.x.x.gz.run
./xmake-x.x.x.gz.run
We need source compilation and installation and use gmake
instead of make.
pkg install xmake
!> Note! xmake is not recommended to install under root!
git clone --recursive https://github.com/xmake-io/xmake.git
cd ./xmake
make build
./scripts/get.sh __local__ __install_only__
source ~/.xmake/profile
If you think the source of github is too slow, you can pull it through the mirror source of gitee or gitlab:
git clone --recursive https://gitee.com/tboox/xmake.git
git clone --recursive https://gitlab.com/tboox/xmake.git
!> Since the current xmake source maintains dependencies via git submodule, it is necessary to add the --recursive
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.
If you forget to add --recursive
when git clone, you can also execute git submodule update --init
to pull all submodules, for example:
git clone https://github.com/xmake-io/xmake.git
cd ./xmake
git submodule update --init
make build
./scripts/get.sh __local__ __install_only__
!> ./get.sh __local__
is installed to ~/.local/xmake
, and then loaded by source ~/.xmake/profile
, so after the installation, the current terminal fails to execute xmake, If the prompt is not found, manually execute source ~/.xmake/profile
, and the next time you open the terminal, you don't need it.
./scripts/get.sh __uninstall__
This developer needs to debug the xmake source locally:
./scripts/get.sh __local__ __install_only__
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 --root
parameter as prompted or set XMAKE_ROOT=y
. 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.
xmake lua
command executes REPL.!> This is also the source code compilation and installation, but the installation path will be written directly to /usr/
, which requires root privileges, so unless special circumstances, this installation method is not recommended, it is recommended to use the ./get. Sh __local__
way to install, the installation path of the two installation methods is different, do not mix.
Compile and install via make:
make build; sudo make install
Install to other specified directories:
sudo make install prefix=/usr/local
Uninstall:
sudo make uninstall
Starting with v2.2.3, the xmake update
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:
xmake update 2.2.4
We can also specify an update to the master/dev branch version:
xmake update master
xmake update dev
Update from the specified git source
xmake update github:xmake-io/xmake#master
xmake update gitee:tboox/xmake#dev # gitee mirror
If just update the xaake lua script changes, you can add -s/--scriptonly
to quickly update the lua script.
xmake update -s dev
Finally, if we want to uninstall xmake, it is also supported: xmake update --uninstall