autogen.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>xmake</title>
  6. <link rel="icon" href="/assets/img/favicon.ico">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  8. <meta name="description" content="Description">
  9. <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  10. <link href="/assets/npm/github-markdown/github-markdown.min.css" rel="stylesheet">
  11. <style>
  12. .markdown-body {
  13. box-sizing: border-box;
  14. min-width: 200px;
  15. max-width: 980px;
  16. margin: 0 auto;
  17. padding: 45px;
  18. }
  19. @media (max-width: 767px) {
  20. .markdown-body {
  21. padding: 15px;
  22. }
  23. }
  24. </style>
  25. </head>
  26. <body>
  27. <article class="markdown-body">
  28. <h4>This is a mirror page, please see the original page: </h4><a href="https://xmake.io/#/features/autogen">https://xmake.io/#/features/autogen</a>
  29. <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>
  30. </br>
  31. <script type="text/javascript" charset="UTF-8" src="https://cdn.wwads.cn/js/makemoney.js" async></script>
  32. <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CE7I52QU&placement=xmakeio" id="_carbonads_js"></script>
  33. <style>
  34. #carbonads {
  35. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
  36. Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
  37. }
  38. #carbonads {
  39. display: flex;
  40. max-width: 330px;
  41. background-color: hsl(0, 0%, 98%);
  42. box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, .1);
  43. }
  44. #carbonads a {
  45. color: inherit;
  46. text-decoration: none;
  47. }
  48. #carbonads a:hover {
  49. color: inherit;
  50. }
  51. #carbonads span {
  52. position: relative;
  53. display: block;
  54. overflow: hidden;
  55. }
  56. #carbonads .carbon-wrap {
  57. display: flex;
  58. }
  59. .carbon-img {
  60. display: block;
  61. margin: 0;
  62. line-height: 1;
  63. }
  64. .carbon-img img {
  65. display: block;
  66. }
  67. .carbon-text {
  68. font-size: 13px;
  69. padding: 10px;
  70. line-height: 1.5;
  71. text-align: left;
  72. }
  73. .carbon-poweredby {
  74. display: block;
  75. padding: 8px 10px;
  76. 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);
  77. text-align: center;
  78. text-transform: uppercase;
  79. letter-spacing: .5px;
  80. font-weight: 600;
  81. font-size: 9px;
  82. line-height: 1;
  83. }
  84. </style>
  85. <h1 id="autogeneration">Autogeneration</h1>
  86. <p>Xmake supports the autogeneration of project files, including it&#39;s own! While it won&#39;t work for every project (as is the nature of these things), it should work for basic and medium complexity projects. You do not need to write any "make-like" file (<code>xmake.lua</code>, <code>makefile</code>, <code>CMakeLists.txt</code>, etc.).</p>
  87. <p>The fool will scan all of the source files and generate an <code>xmake.lua</code> automatically based on your product structure. Xmake will try to detect a <code>main</code> function in the source files to distinguish between the source code for libraries and executable programs.</p>
  88. <p>If autogeneration succeeds, you should still look through the generated <code>xmake.lua</code> and make any changes you need, and make sure everything worked well.</p>
  89. <p>Currently, projects that use directories in multiple levels are <em>not</em> supported. Appologies.</p>
  90. <h2 id="usecases">Use cases</h2>
  91. <ol>
  92. <li>Temporarily quickly compile and run some scattered test code</li>
  93. <li>A starting point to porting and compiling open source code</li>
  94. <li>Quickly create a new Xmake project based on existing code</li>
  95. </ol>
  96. <h2 id="howtouseit">How to use it</h2>
  97. <p>Execute Xmake directly in the directory with the source code (no xmake.lua), and follow the prompts:</p>
  98. <pre><code class="lang-bash">$ xmake
  99. note: xmake.lua not found, try generating it (pass -y or --confirm=y/n/d to skip confirm)?
  100. please input: n (y/n)
  101. y
  102. </code></pre>
  103. <p>In addition, when there are other build system identification files (such as <code>CMakeLists.txt</code>), the process of automatically generating an <code>xmake.lua</code> file will not be triggered. Instead, it will attemp to <a href="#Automatically detect build system and compile">automatically detect build system and compile</a> the code. If you want to force trigger the process of automatically generating <code>xmake.lua</code> file, you can run:</p>
  104. <pre><code class="lang-bash">$ xmake f -y
  105. </code></pre>
  106. <h3 id="compileopensourcelibraries">Compile open source libraries</h3>
  107. <p>Although this approach has some limitations, but it is already sufficient to generate for existing libraries.</p>
  108. <p>For example, if you download the source code for zlib-1.2.10 and want to compile it, you only need to enter the zlib source directory and run the following command:</p>
  109. <pre><code class="lang-bash">$ cd zlib-1.2.10
  110. $ xmake
  111. note: xmake.lua not found, try generating it (pass -y or --confirm=y/n/d to skip confirm)?
  112. please input: n (y/n)
  113. y
  114. </code></pre>
  115. <p>It&#39;s done! the output results:</p>
  116. <pre><code>target(zlib-1.2): static
  117. [+]: ./adler32.c
  118. [+]: ./compress.c
  119. [+]: ./crc32.c
  120. [+]: ./deflate.c
  121. [+]: ./gzclose.c
  122. [+]: ./gzlib.c
  123. [+]: ./gzread.c
  124. [+]: ./gzwrite.c
  125. [+]: ./infback.c
  126. [+]: ./inffast.c
  127. [+]: ./inflate.c
  128. [+]: ./inftrees.c
  129. [+]: ./trees.c
  130. [+]: ./uncompr.c
  131. [+]: ./zutil.c
  132. xmake.lua generated, scan ok!👌
  133. checking for the architecture ... x86_64
  134. checking for the Xcode SDK version for macosx ... 10.12
  135. checking for the target minimal version ... 10.12
  136. checking for the c compiler (cc) ... xcrun -sdk macosx clang
  137. checking for the c++ compiler (cxx) ... xcrun -sdk macosx clang
  138. checking for the objc compiler (mm) ... xcrun -sdk macosx clang
  139. checking for the objc++ compiler (mxx) ... xcrun -sdk macosx clang++
  140. checking for the swift compiler (sc) ... xcrun -sdk macosx swiftc
  141. checking for the assember (as) ... xcrun -sdk macosx clang
  142. checking for the linker (ld) ... xcrun -sdk macosx clang++
  143. checking for the static library archiver (ar) ... xcrun -sdk macosx ar
  144. checking for the static library extractor (ex) ... xcrun -sdk macosx ar
  145. checking for the shared library linker (sh) ... xcrun -sdk macosx clang++
  146. checking for the debugger (dd) ... xcrun -sdk macosx lldb
  147. checking for the golang compiler (go) ... go
  148. configure
  149. {
  150. ex = "xcrun -sdk macosx ar"
  151. , sh = "xcrun -sdk macosx clang++"
  152. , host = "macosx"
  153. , ar = "xcrun -sdk macosx ar"
  154. , buildir = "build"
  155. , as = "xcrun -sdk macosx clang"
  156. , plat = "macosx"
  157. , xcode_dir = "/Applications/Xcode.app"
  158. , arch = "x86_64"
  159. , mxx = "xcrun -sdk macosx clang++"
  160. , go = "go"
  161. , target_minver = "10.12"
  162. , ccache = "ccache"
  163. , mode = "release"
  164. , clean = true
  165. , cxx = "xcrun -sdk macosx clang"
  166. , cc = "xcrun -sdk macosx clang"
  167. , dd = "xcrun -sdk macosx lldb"
  168. , kind = "static"
  169. , ld = "xcrun -sdk macosx clang++"
  170. , xcode_sdkver = "10.12"
  171. , sc = "xcrun -sdk macosx swiftc"
  172. , mm = "xcrun -sdk macosx clang"
  173. }
  174. configure ok!
  175. clean ok!
  176. [00%]: cache compiling.release ./adler32.c
  177. [06%]: cache compiling.release ./compress.c
  178. [13%]: cache compiling.release ./crc32.c
  179. [20%]: cache compiling.release ./deflate.c
  180. [26%]: cache compiling.release ./gzclose.c
  181. [33%]: cache compiling.release ./gzlib.c
  182. [40%]: cache compiling.release ./gzread.c
  183. [46%]: cache compiling.release ./gzwrite.c
  184. [53%]: cache compiling.release ./infback.c
  185. [60%]: cache compiling.release ./inffast.c
  186. [66%]: cache compiling.release ./inflate.c
  187. [73%]: cache compiling.release ./inftrees.c
  188. [80%]: cache compiling.release ./trees.c
  189. [86%]: cache compiling.release ./uncompr.c
  190. [93%]: cache compiling.release ./zutil.c
  191. [100%]: archiving.release libzlib-1.2.a
  192. build ok!👌
  193. </code></pre><p>Xmake will scan the current directory to detect all source codes and it do not found main function. As such, detect that it is a static library, and thus it will build it as a static library (with an output/artifact of <code>libzlib-1.2.a</code>).</p>
  194. <p>We did not write any make-like files (Xmake.lua, ..) and did not use the makefile of zlib project. Isn&#39;t that neat? It is compiled directly and a <code>xmake.lua</code> file was generated which we can edit this xmake.lua to build more complicated project.</p>
  195. <p>The content of the generated xmake.lua:</p>
  196. <pre><code class="lang-lua">-- define target
  197. target("zlib-1.2")
  198. -- set kind
  199. set_kind("static")
  200. -- add files
  201. add_files("./adler32.c")
  202. add_files("./compress.c")
  203. add_files("./crc32.c")
  204. add_files("./deflate.c")
  205. add_files("./gzclose.c")
  206. add_files("./gzlib.c")
  207. add_files("./gzread.c")
  208. add_files("./gzwrite.c")
  209. add_files("./infback.c")
  210. add_files("./inffast.c")
  211. add_files("./inflate.c")
  212. add_files("./inftrees.c")
  213. add_files("./trees.c")
  214. add_files("./uncompr.c")
  215. add_files("./zutil.c")
  216. </code></pre>
  217. <p>As you can see, it&#39;s pretty human readable.</p>
  218. <h3 id="compileandruntestingcodefast">Compile and run testing code... fast!</h3>
  219. <p>Let&#39;s say you want to write a simple program, with one source file (<code>main.c</code>), solely to print "Hello, world!" to stdout.</p>
  220. <pre><code class="lang-c">/* main.c */
  221. #include <stdio.h>
  222. #include <stdlib.h>
  223. int main(int argc, char *argv[]) {
  224. printf("Hello, world!");
  225. return EXIT_SUCCESS;
  226. }
  227. </code></pre>
  228. <p>If we use GCC to compile and run it, need run two commands:</p>
  229. <pre><code class="lang-bash">$ gcc ./main.c -o main
  230. $ ./main
  231. </code></pre>
  232. <p>If we use xmake to run it, only need to run:</p>
  233. <pre><code class="lang-bash">$ xmake run
  234. </code></pre>
  235. <p>Or even:</p>
  236. <pre><code class="lang-bash">$ xmake r
  237. </code></pre>
  238. <p>As we expect, we see...</p>
  239. <pre><code>Hello, world!
  240. </code></pre><p>...printed to the console! Even if we have a lot of source files, you only need to run one command:</p>
  241. <pre><code class="lang-bash">$ xmake run
  242. </code></pre>
  243. <p>How easy and convenient!</p>
  244. <h3 id="multilanguagesupport">Multi-language support</h3>
  245. <p>This feature of autogeneration of project files not only supports C/C++, also supports Objective-C and Swift, and it will support Go in future. For example, if you download the <code>fmdb</code> library, an iOS library which wraps SQLite:</p>
  246. <pre><code># Files:
  247. .
  248. ├── FMDB.h
  249. ├── FMDatabase.h
  250. ├── FMDatabase.m
  251. ├── FMDatabaseAdditions.h
  252. ├── FMDatabaseAdditions.m
  253. ├── FMDatabasePool.h
  254. ├── FMDatabasePool.m
  255. ├── FMDatabaseQueue.h
  256. ├── FMDatabaseQueue.m
  257. ├── FMResultSet.h
  258. └── FMResultSet.m
  259. </code></pre><p>You can see that there aren&#39;t any make-like files in the project directory. "Whatever will we do?" I think you know. We can use Xmake to build it directly as a iOS static library:</p>
  260. <pre><code class="lang-bash">$ xmake f -p iphoneos; xmake
  261. </code></pre>
  262. <p>The output is:</p>
  263. <pre><code>xmake.lua not found, scanning files ..
  264. target(FMDB): static
  265. [+]: ./FMDatabase.m
  266. [+]: ./FMDatabaseAdditions.m
  267. [+]: ./FMDatabasePool.m
  268. [+]: ./FMDatabaseQueue.m
  269. [+]: ./FMResultSet.m
  270. xmake.lua generated, scan ok!👌
  271. checking for the architecture ... armv7
  272. checking for the Xcode SDK version for iphoneos ... 10.1
  273. checking for the target minimal version ... 10.1
  274. checking for the c compiler (cc) ... xcrun -sdk iphoneos clang
  275. checking for the c++ compiler (cxx) ... xcrun -sdk iphoneos clang
  276. checking for the objc compiler (mm) ... xcrun -sdk iphoneos clang
  277. checking for the objc++ compiler (mxx) ... xcrun -sdk iphoneos clang++
  278. checking for the assember (as) ... gas-preprocessor.pl xcrun -sdk iphoneos clang
  279. checking for the linker (ld) ... xcrun -sdk iphoneos clang++
  280. checking for the static library archiver (ar) ... xcrun -sdk iphoneos ar
  281. checking for the static library extractor (ex) ... xcrun -sdk iphoneos ar
  282. checking for the shared library linker (sh) ... xcrun -sdk iphoneos clang++
  283. checking for the swift compiler (sc) ... xcrun -sdk iphoneos swiftc
  284. configure
  285. {
  286. ex = "xcrun -sdk iphoneos ar"
  287. , ccache = "ccache"
  288. , host = "macosx"
  289. , ar = "xcrun -sdk iphoneos ar"
  290. , buildir = "build"
  291. , as = "/usr/local/share/xmake/tools/utils/gas-preprocessor.pl xcrun -sdk iphoneos clang"
  292. , arch = "armv7"
  293. , mxx = "xcrun -sdk iphoneos clang++"
  294. , cxx = "xcrun -sdk iphoneos clang"
  295. , target_minver = "10.1"
  296. , xcode_dir = "/Applications/Xcode.app"
  297. , clean = true
  298. , sh = "xcrun -sdk iphoneos clang++"
  299. , cc = "xcrun -sdk iphoneos clang"
  300. , ld = "xcrun -sdk iphoneos clang++"
  301. , mode = "release"
  302. , kind = "static"
  303. , plat = "iphoneos"
  304. , xcode_sdkver = "10.1"
  305. , sc = "xcrun -sdk iphoneos swiftc"
  306. , mm = "xcrun -sdk iphoneos clang"
  307. }
  308. configure ok!
  309. clean ok!
  310. [00%]: cache compiling.release ./FMDatabase.m
  311. [20%]: cache compiling.release ./FMDatabaseAdditions.m
  312. [40%]: cache compiling.release ./FMDatabasePool.m
  313. [60%]: cache compiling.release ./FMDatabaseQueue.m
  314. [80%]: cache compiling.release ./FMResultSet.m
  315. [100%]: archiving.release libFMDB.a
  316. build ok!👌
  317. </code></pre><p>and of course we also get a <code>libFMDB.a</code> static library.</p>
  318. <h3 id="compilemultipleexecutablesatthesametime">Compile multiple executables at the same time</h3>
  319. <p>Let&#39;s say you downloaded the "sixth public release of the Independent JPEG Group&#39;s free JPEG software", and wanted to build it. You could do it yourself, or you could run:</p>
  320. <pre><code class="lang-bash">xmake
  321. </code></pre>
  322. <p>The output results are:</p>
  323. <pre><code>xmake.lua not found, scanning files ..
  324. target(jpeg-6b): static
  325. [+]: ./cdjpeg.c
  326. [+]: ./example.c
  327. [+]: ./jcapimin.c
  328. [+]: ./jcapistd.c
  329. [+]: ./jccoefct.c
  330. [+]: ./jccolor.c
  331. [+]: ./jcdctmgr.c
  332. [+]: ./jchuff.c
  333. [+]: ./jcinit.c
  334. [+]: ./jcmainct.c
  335. [+]: ./jcmarker.c
  336. [+]: ./jcmaster.c
  337. [+]: ./jcomapi.c
  338. [+]: ./jcparam.c
  339. [+]: ./jcphuff.c
  340. [+]: ./jcprepct.c
  341. [+]: ./jcsample.c
  342. [+]: ./jctrans.c
  343. [+]: ./jdapimin.c
  344. [+]: ./jdapistd.c
  345. [+]: ./jdatadst.c
  346. [+]: ./jdatasrc.c
  347. [+]: ./jdcoefct.c
  348. [+]: ./jdcolor.c
  349. [+]: ./jddctmgr.c
  350. [+]: ./jdhuff.c
  351. [+]: ./jdinput.c
  352. [+]: ./jdmainct.c
  353. [+]: ./jdmarker.c
  354. [+]: ./jdmaster.c
  355. [+]: ./jdmerge.c
  356. [+]: ./jdphuff.c
  357. [+]: ./jdpostct.c
  358. [+]: ./jdsample.c
  359. [+]: ./jdtrans.c
  360. [+]: ./jerror.c
  361. [+]: ./jfdctflt.c
  362. [+]: ./jfdctfst.c
  363. [+]: ./jfdctint.c
  364. [+]: ./jidctflt.c
  365. [+]: ./jidctfst.c
  366. [+]: ./jidctint.c
  367. [+]: ./jidctred.c
  368. [+]: ./jmemansi.c
  369. [+]: ./jmemmgr.c
  370. [+]: ./jmemname.c
  371. [+]: ./jmemnobs.c
  372. [+]: ./jquant1.c
  373. [+]: ./jquant2.c
  374. [+]: ./jutils.c
  375. [+]: ./rdbmp.c
  376. [+]: ./rdcolmap.c
  377. [+]: ./rdgif.c
  378. [+]: ./rdppm.c
  379. [+]: ./rdrle.c
  380. [+]: ./rdswitch.c
  381. [+]: ./rdtarga.c
  382. [+]: ./transupp.c
  383. [+]: ./wrbmp.c
  384. [+]: ./wrgif.c
  385. [+]: ./wrppm.c
  386. [+]: ./wrrle.c
  387. [+]: ./wrtarga.c
  388. target(ansi2knr): binary
  389. [+]: ./ansi2knr.c
  390. target(cjpeg): binary
  391. [+]: ./cjpeg.c
  392. target(ckconfig): binary
  393. [+]: ./ckconfig.c
  394. target(djpeg): binary
  395. [+]: ./djpeg.c
  396. target(jpegtran): binary
  397. [+]: ./jpegtran.c
  398. target(rdjpgcom): binary
  399. [+]: ./rdjpgcom.c
  400. target(wrjpgcom): binary
  401. [+]: ./wrjpgcom.c
  402. xmake.lua generated, scan ok!👌
  403. checking for the architecture ... x86_64
  404. checking for the Xcode SDK version for macosx ... 10.12
  405. checking for the target minimal version ... 10.12
  406. checking for the c compiler (cc) ... xcrun -sdk macosx clang
  407. checking for the c++ compiler (cxx) ... xcrun -sdk macosx clang
  408. checking for the objc compiler (mm) ... xcrun -sdk macosx clang
  409. checking for the objc++ compiler (mxx) ... xcrun -sdk macosx clang++
  410. checking for the swift compiler (sc) ... xcrun -sdk macosx swiftc
  411. checking for the assember (as) ... xcrun -sdk macosx clang
  412. checking for the linker (ld) ... xcrun -sdk macosx clang++
  413. checking for the static library archiver (ar) ... xcrun -sdk macosx ar
  414. checking for the static library extractor (ex) ... xcrun -sdk macosx ar
  415. checking for the shared library linker (sh) ... xcrun -sdk macosx clang++
  416. checking for the debugger (dd) ... xcrun -sdk macosx lldb
  417. checking for the golang compiler (go) ... go
  418. configure
  419. {
  420. ex = "xcrun -sdk macosx ar"
  421. , sh = "xcrun -sdk macosx clang++"
  422. , host = "macosx"
  423. , ar = "xcrun -sdk macosx ar"
  424. , buildir = "build"
  425. , as = "xcrun -sdk macosx clang"
  426. , plat = "macosx"
  427. , xcode_dir = "/Applications/Xcode.app"
  428. , arch = "x86_64"
  429. , mxx = "xcrun -sdk macosx clang++"
  430. , go = "go"
  431. , target_minver = "10.12"
  432. , ccache = "ccache"
  433. , mode = "release"
  434. , clean = true
  435. , cxx = "xcrun -sdk macosx clang"
  436. , cc = "xcrun -sdk macosx clang"
  437. , dd = "xcrun -sdk macosx lldb"
  438. , kind = "static"
  439. , ld = "xcrun -sdk macosx clang++"
  440. , xcode_sdkver = "10.12"
  441. , sc = "xcrun -sdk macosx swiftc"
  442. , mm = "xcrun -sdk macosx clang"
  443. }
  444. configure ok!
  445. clean ok!
  446. [00%]: cache compiling.release ./cdjpeg.c
  447. [00%]: cache compiling.release ./example.c
  448. [00%]: cache compiling.release ./jcapimin.c
  449. [00%]: cache compiling.release ./jcapistd.c
  450. [00%]: cache compiling.release ./jccoefct.c
  451. [00%]: cache compiling.release ./jccolor.c
  452. [01%]: cache compiling.release ./jcdctmgr.c
  453. [01%]: cache compiling.release ./jchuff.c
  454. [01%]: cache compiling.release ./jcinit.c
  455. [01%]: cache compiling.release ./jcmainct.c
  456. [01%]: cache compiling.release ./jcmarker.c
  457. [02%]: cache compiling.release ./jcmaster.c
  458. [02%]: cache compiling.release ./jcomapi.c
  459. [02%]: cache compiling.release ./jcparam.c
  460. [02%]: cache compiling.release ./jcphuff.c
  461. [02%]: cache compiling.release ./jcprepct.c
  462. [03%]: cache compiling.release ./jcsample.c
  463. [03%]: cache compiling.release ./jctrans.c
  464. [03%]: cache compiling.release ./jdapimin.c
  465. [03%]: cache compiling.release ./jdapistd.c
  466. [03%]: cache compiling.release ./jdatadst.c
  467. [04%]: cache compiling.release ./jdatasrc.c
  468. [04%]: cache compiling.release ./jdcoefct.c
  469. [04%]: cache compiling.release ./jdcolor.c
  470. [04%]: cache compiling.release ./jddctmgr.c
  471. [04%]: cache compiling.release ./jdhuff.c
  472. [05%]: cache compiling.release ./jdinput.c
  473. [05%]: cache compiling.release ./jdmainct.c
  474. [05%]: cache compiling.release ./jdmarker.c
  475. [05%]: cache compiling.release ./jdmaster.c
  476. [05%]: cache compiling.release ./jdmerge.c
  477. [06%]: cache compiling.release ./jdphuff.c
  478. [06%]: cache compiling.release ./jdpostct.c
  479. [06%]: cache compiling.release ./jdsample.c
  480. [06%]: cache compiling.release ./jdtrans.c
  481. [06%]: cache compiling.release ./jerror.c
  482. [07%]: cache compiling.release ./jfdctflt.c
  483. [07%]: cache compiling.release ./jfdctfst.c
  484. [07%]: cache compiling.release ./jfdctint.c
  485. [07%]: cache compiling.release ./jidctflt.c
  486. [07%]: cache compiling.release ./jidctfst.c
  487. [08%]: cache compiling.release ./jidctint.c
  488. [08%]: cache compiling.release ./jidctred.c
  489. [08%]: cache compiling.release ./jmemansi.c
  490. [08%]: cache compiling.release ./jmemmgr.c
  491. [08%]: cache compiling.release ./jmemname.c
  492. [09%]: cache compiling.release ./jmemnobs.c
  493. [09%]: cache compiling.release ./jquant1.c
  494. [09%]: cache compiling.release ./jquant2.c
  495. [09%]: cache compiling.release ./jutils.c
  496. [09%]: cache compiling.release ./rdbmp.c
  497. [10%]: cache compiling.release ./rdcolmap.c
  498. [10%]: cache compiling.release ./rdgif.c
  499. [10%]: cache compiling.release ./rdppm.c
  500. [10%]: cache compiling.release ./rdrle.c
  501. [10%]: cache compiling.release ./rdswitch.c
  502. [11%]: cache compiling.release ./rdtarga.c
  503. [11%]: cache compiling.release ./transupp.c
  504. [11%]: cache compiling.release ./wrbmp.c
  505. [11%]: cache compiling.release ./wrgif.c
  506. [11%]: cache compiling.release ./wrppm.c
  507. [12%]: cache compiling.release ./wrrle.c
  508. [12%]: cache compiling.release ./wrtarga.c
  509. [12%]: archiving.release libjpeg-6b.a
  510. [12%]: cache compiling.release ./wrjpgcom.c
  511. [25%]: linking.release wrjpgcom
  512. [25%]: cache compiling.release ./ansi2knr.c
  513. [37%]: linking.release ansi2knr
  514. [37%]: cache compiling.release ./jpegtran.c
  515. [50%]: linking.release jpegtran
  516. [50%]: cache compiling.release ./djpeg.c
  517. [62%]: linking.release djpeg
  518. [62%]: cache compiling.release ./ckconfig.c
  519. [75%]: linking.release ckconfig
  520. [75%]: cache compiling.release ./rdjpgcom.c
  521. [87%]: linking.release rdjpgcom
  522. [87%]: cache compiling.release ./cjpeg.c
  523. [100%]: linking.release cjpeg
  524. build ok!👌
  525. </code></pre><p>In addition to a static library, we also compiled some other executable programs.</p>
  526. <pre><code>target(ansi2knr): binary
  527. [+]: ./ansi2knr.c
  528. target(cjpeg): binary
  529. [+]: ./cjpeg.c
  530. target(ckconfig): binary
  531. [+]: ./ckconfig.c
  532. target(djpeg): binary
  533. [+]: ./djpeg.c
  534. target(jpegtran): binary
  535. [+]: ./jpegtran.c
  536. target(rdjpgcom): binary
  537. [+]: ./rdjpgcom.c
  538. target(wrjpgcom): binary
  539. [+]: ./wrjpgcom.c
  540. </code></pre><p>Neat!</p>
  541. <h3 id="manualconfiguration">Manual configuration</h3>
  542. <p>If we want to add some manual configuration options. we need add them before compiling. For example:</p>
  543. <pre><code class="lang-bash"># Specify our options
  544. $ xmake f --cxflags="--cxx-flag" --ldflags="--link-flag" --includedirs="include/" --linkdirs="lib/"
  545. # Build!
  546. $ xmake
  547. </code></pre>
  548. </article>
  549. </body>
  550. </html>