aboutsummaryrefslogtreecommitdiff
path: root/landing.html
blob: 7b235f97a41ed573fc35f58edcf31998250395cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<!DOCTYPE html>
<html lang="en-us">
  
  <head>
  <meta charset="UTF-8">
  <title>xmake</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="theme-color" content="#157878">
  <meta name="description" content="A cross-platform build utility based on Lua">
  <meta name="keywords" content="make,makefile,build,lua,cross-compile,linux" /> 

  <link rel="stylesheet" href="/assets/css/normalize.css">
  <link rel='stylesheet' href="/assets/css/opensans.css" type='text/css'>
  <link rel="stylesheet" href="/assets/css/cayman.css">

  <!-- baidu stats -->
    <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?eb3c91c672a001d78a113bfb8e42017a";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    </script>
</head>


  <body>
    <section class="page-header">
  <h1 class="project-name">xmake</h1>
  <h2 class="project-tagline">A cross-platform build utility based on Lua</h2>
  <a href="/#/home" class="btn">GET STARTED</a>
  <br><br>
  <iframe src="https://ghbtns.com/github-btn.html?user=tboox&repo=xmake&type=star&count=true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
    <span class="donate" style="width: 100px">
      <img src="/assets/img/patreon.png">
      <a href="/pages/donation.html#donate">Support us</a>
    </span>
  <br><br>
  <ul id="translations">
      <li><a href="/cn/" class="nav-link">中文</a></li>
      <li class="delimiter">|</li>
      <li><a href="/" class="nav-link">English</a></li>
    </ul>
</section>



    <section class="main-content">
      
      <h2 id="installation">Installation</h2>

<h4 id="via-curl">via curl</h4>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>bash &lt;<span class="o">(</span>curl -fsSL https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh<span class="o">)</span>
</code></pre>
</div>

<h4 id="via-wget">via wget</h4>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>bash &lt;<span class="o">(</span>wget https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh -O -<span class="o">)</span>
</code></pre>
</div>

<h4 id="via-powershell">via powershell</h4>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>Invoke-Expression <span class="o">(</span>Invoke-Webrequest <span class="s1">'https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.ps1'</span> -UseBasicParsing<span class="o">)</span>.Content
</code></pre>
</div>

<h2 id="simple-description">Simple description</h2>

<p><img src="/assets/img/index/showcode1.png" width="40%" /></p>

<h2 id="package-dependences">Package dependences</h2>

<p><img src="/assets/img/index/add_require.png" width="70%" /></p>

<p>An official xmake package repository: <a href="https://github.com/tboox/xmake-repo">xmake-repo</a></p>

<h2 id="build-project">Build project</h2>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake
</code></pre>
</div>

<h2 id="run-target">Run target</h2>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake run console
</code></pre>
</div>

<h2 id="debug-target">Debug target</h2>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake run -d console
</code></pre>
</div>

<h2 id="configure-platform">Configure platform</h2>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f -p <span class="o">[</span>windows|linux|macosx|android|iphoneos ..] -a <span class="o">[</span>x86|arm64 ..] -m <span class="o">[</span>debug|release]
<span class="gp">$ </span>xmake
</code></pre>
</div>

<h2 id="menu-configuration">Menu configuration</h2>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f --menu
</code></pre>
</div>

<p><img src="/assets/img/index/menuconf.png" width="80%" /></p>

<h2 id="package-management">Package management</h2>

<p><img src="/assets/img/index/package_manage.png" width="80%" /></p>

<h2 id="support-platforms">Support platforms</h2>

<ul>
  <li>Windows (x86, x64)</li>
  <li>Macosx (i386, x86_64)</li>
  <li>Linux (i386, x86_64, cross-toolchains …)</li>
  <li>Android (armv5te, armv6, armv7-a, armv8-a, arm64-v8a)</li>
  <li>iPhoneOS (armv7, armv7s, arm64, i386, x86_64)</li>
  <li>WatchOS (armv7k, i386)</li>
  <li>Mingw (i386, x86_64)</li>
</ul>

<h2 id="support-languages">Support Languages</h2>

<ul>
  <li>C/C++</li>
  <li>Objc/Objc++</li>
  <li>Swift</li>
  <li>Assembly</li>
  <li>Golang</li>
  <li>Rust</li>
  <li>Dlang</li>
  <li>Cuda</li>
</ul>

<h2 id="support-projects">Support Projects</h2>

<ul>
  <li>Static Library</li>
  <li>Shared Library</li>
  <li>Console</li>
  <li>Cuda Program</li>
  <li>Qt Application</li>
  <li>WDK Driver (umdf/kmdf/wdm)</li>
  <li>WinSDK Application</li>
</ul>

<h2 id="builtin-plugins">Builtin Plugins</h2>

<h4 id="macros-script-plugin">Macros script plugin</h4>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake m -b                        <span class="c"># start to record</span>
<span class="gp">$ </span>xmake f -p iphoneos -m debug
<span class="gp">$ </span>xmake 
<span class="gp">$ </span>xmake f -p android --ndk<span class="o">=</span>~/files/android-ndk-r16b
<span class="gp">$ </span>xmake
<span class="gp">$ </span>xmake m -e                        <span class="c"># stop to record</span>
<span class="gp">$ </span>xmake m .                         <span class="c"># playback commands</span>
</code></pre>
</div>

<h4 id="run-the-custom-lua-script-plugin">Run the custom lua script plugin</h4>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake l ./test.lua
<span class="gp">$ </span>xmake l -c <span class="s2">"print('hello xmake!')"</span>
<span class="gp">$ </span>xmake l lib.detect.find_tool gcc
</code></pre>
</div>

<h4 id="generate-ide-project-file-pluginmakefile-vs2002---vs2017--">Generate IDE project file plugin(makefile, vs2002 - vs2017 .. )</h4>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake project -k vs2017 -m <span class="s2">"debug,release"</span>
</code></pre>
</div>

<h4 id="generate-doxygen-document-plugin">Generate doxygen document plugin</h4>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake doxygen <span class="o">[</span>srcdir]
</code></pre>
</div>

<h2 id="more-plugins">More Plugins</h2>

<p>Please download and install from the plugins repository <a href="https://github.com/tboox/xmake-plugins">xmake-plugins</a>.</p>

<h2 id="ideeditor-integration">IDE/Editor Integration</h2>

<ul>
  <li><a href="https://github.com/tboox/xmake-vscode">xmake-vscode</a></li>
</ul>

<p><img src="https://raw.githubusercontent.com/tboox/xmake-vscode/master/res/problem.gif" width="60%" /></p>

<ul>
  <li><a href="https://github.com/tboox/xmake-sublime">xmake-sublime</a></li>
</ul>

<p><img src="https://raw.githubusercontent.com/tboox/xmake-sublime/master/res/problem.gif" width="60%" /></p>

<ul>
  <li><a href="https://github.com/tboox/xmake-idea">xmake-idea</a></li>
</ul>

<p><img src="https://raw.githubusercontent.com/tboox/xmake-idea/master/res/problem.gif" width="60%" /></p>

<ul>
  <li><a href="https://github.com/luzhlon/xmake.vim">xmake.vim</a> (third-party, thanks <a href="https://github.com/luzhlon">@luzhlon</a>)</li>
</ul>

<h2 id="more-examples">More Examples</h2>

<p>Debug and release modes:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_rules</span><span class="p">(</span><span class="s2">"mode.debug"</span><span class="p">,</span> <span class="s2">"mode.release"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"console"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span> 
    <span class="k">if</span> <span class="n">is_plat</span><span class="p">(</span><span class="s2">"windows"</span><span class="p">,</span> <span class="s2">"mingw"</span><span class="p">)</span> <span class="k">then</span>
        <span class="n">add_defines</span><span class="p">(</span><span class="s2">"XXX"</span><span class="p">)</span>
    <span class="k">end</span>
</code></pre>
</div>

<p>Custom script:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"static"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.cpp"</span><span class="p">)</span>
    <span class="n">after_build</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">target</span><span class="p">)</span>
        <span class="nb">print</span><span class="p">(</span><span class="s2">"build %s ok!"</span><span class="p">,</span> <span class="n">target</span><span class="p">:</span><span class="n">targetfile</span><span class="p">())</span>
    <span class="k">end</span><span class="p">)</span>
</code></pre>
</div>

<p>Extension Modules:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"shared"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
    <span class="n">on_load</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">target</span><span class="p">)</span>
        <span class="n">import</span><span class="p">(</span><span class="s2">"lib.detect.find_package"</span><span class="p">)</span>
        <span class="n">target</span><span class="p">:</span><span class="n">add</span><span class="p">(</span><span class="n">find_package</span><span class="p">(</span><span class="s2">"zlib"</span><span class="p">))</span>
    <span class="k">end</span><span class="p">)</span>
</code></pre>
</div>

<h2 id="project-examples">Project Examples</h2>

<p>Some projects using xmake:</p>

<ul>
  <li><a href="https://github.com/tboox/tbox">tbox</a></li>
  <li><a href="https://github.com/tboox/gbox">gbox</a></li>
  <li><a href="https://github.com/tboox/vm86">vm86</a></li>
  <li><a href="https://github.com/tboox/awesome-xmake">more</a></li>
</ul>

<h2 id="example-video">Example Video</h2>

<p><a href="https://asciinema.org/a/133693">
<img src="https://asciinema.org/a/133693.png" width="60%" />
</a></p>

<h2 id="contacts">Contacts</h2>

<ul>
  <li>Email:<a href="mailto:waruqi@gmail.com">waruqi@gmail.com</a></li>
  <li>Homepage:<a href="http://www.tboox.org">tboox.org</a></li>
  <li>Community:<a href="https://www.reddit.com/r/tboox/">/r/tboox on reddit</a></li>
  <li>ChatRoom:<a href="https://t.me/tbooxorg">Char on telegram</a>, <a href="https://gitter.im/tboox/tboox?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge">Chat on gitter</a></li>
  <li>Source Code:<a href="https://github.com/tboox/xmake">Github</a>, <a href="https://gitee.com/tboox/xmake">Gitee</a></li>
</ul>


      <footer class="site-footer">
  <span class="site-footer-owner">Copyright (c) 2015-2018 <a href="http://www.tboox.org">tboox.org</a>.</span>
  <span class="site-footer-power">
    <span>
        <!--Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="http://pages.coding.me">Coding Pages</a>.-->
        Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://pages.github.com/">Github Pages</a>.
    </span>
    <span>
        Theme designed by <a href="https://github.com/pietromenna/jekyll-cayman-theme">cayman</a>.
    </span>
</span>
</footer>


    </section>

  </body>
</html>