index.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <html>
  2. <head>
  3. <meta charset="utf-8"/>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  6. <meta name="description" content=""/>
  7. <meta name="author" content="Maxim Sokhatsky"/>
  8. <title>MAD</title>
  9. <link rel="stylesheet" href="https://n2o.dev/blank.css"/>
  10. <link rel="stylesheet" href="https://n2o.dev/zima.css"/>
  11. </head>
  12. <body>
  13. <nav>
  14. <a href="https://n2o.dev">DEV</a>
  15. <a href="https://mad.n2o.space" style="background:#ededed;">MAD</a>
  16. </nav>
  17. <header>
  18. <a href="https://github.com/synrc/mad">
  19. <img src="https://synrc.space/images/Synrc Neo.svg?v=1"/></a>
  20. <h1>MAD</h1>
  21. </header>
  22. <aside>
  23. <article>
  24. <section>
  25. <h3>SYNOPSIS</h3>
  26. <div>MAD is a small and fast build tool for Erlang.
  27. Here is example of config file of MAD itself:</div><br/>
  28. <figure>
  29. <code>
  30. {deps_dir,"deps"}.
  31. {erl_opts,[nowarn_export_all]}.
  32. {deps,[{sh,".*",{git,
  33. "git://github.com/synrc/sh",
  34. {branch, "master"}}}]}.
  35. </code>
  36. </figure><br/>
  37. </section>
  38. <section>
  39. <a name="install"></a><h3>INSTALL</h3>
  40. <div>Place MAD binary into <b>$PATH</b> or
  41. <b>/usr/local/bin</b>. E.g. using curl:</div><br/>
  42. <figure>
  43. <code> $ curl -fsSL \
  44. https://git.io/fpYm4 \
  45. > mad &#38;&#38; chmod +x mad \
  46. &#38;&#38; sudo cp mad /usr/local/bin</code>
  47. </figure><br/>
  48. <div>
  49. APR 2018 © <a href="https://github.com/5HT">Namdak Tonpa</a> ISC<br/>
  50. VER 6.9 6.8 6.7
  51. </div>
  52. </section>
  53. </article>
  54. </aside><main>
  55. <section>
  56. <h3>HELP</h3>
  57. <p> MAD accepts a list of words.
  58. This list of words contains special words aka delimiters or commands.
  59. Words between commands are arguments for the nearest command from left.
  60. </p>
  61. <figure><code>
  62. MAD Manage Dependencies 5.4-14-g7810b8d
  63. invoke = mad | mad list
  64. list = [] | command [options] list
  65. command = app [zero|nitro] <name> | deps | clean | compile | strip
  66. | bundle [beam|script] <name> | man | get <repo> | up [name]
  67. | start | stop | attach | repl | static <min>
  68. </min></repo></name></name></code></figure>
  69. <div>
  70. <ul><li><b><a href="man/mad.htm">mad</a></b> — MAD Main Module</li><li><b><a href="man/mad_local.htm">mad_local</a></b> — MAD POSIX Profile</li></ul>
  71. </div>
  72. </section>
  73. <section>
  74. <a name="app"></a><h3>APP</h3>
  75. <p>Create predefined sample application.
  76. MAD has built-in two sample applications: <b>zero</b> and <b>nitro</b>.
  77. Here is bluepring of <b>zero</b> application:</p>
  78. <figure><code>
  79. $ mad app zero sample
  80. OK
  81. </code></figure>
  82. <p>sample.app.src</p>
  83. <figure><code>
  84. {application, sample,
  85. [{description, "sample application"},
  86. {vsn, "0.8.0"},
  87. {registered, []},
  88. {applications, [kernel,stdlib]},
  89. {mod, { sample, []}},
  90. {env, []}]}.
  91. </code></figure>
  92. <p>sample.erl</p>
  93. <figure><code>
  94. -module(sample).
  95. -compile(export_all).
  96. -behaviour(application).
  97. -behaviour(supervisor).
  98. -export([start/2, stop/1, init/1]).
  99. start(_, _) -> supervisor:start_link({local, ?MODULE}, ?MODULE, []).
  100. stop(_) -> ok.
  101. init([]) -> {ok, { {one_for_one, 5, 10}, []} }.
  102. </code></figure>
  103. <div>
  104. <ul><li><b><a href="man/mad_static.htm">mad_static</a></b> — MAD Static</li></ul>
  105. </div>
  106. </section>
  107. <section>
  108. <a name="deps"></a><h3>DEPS</h3>
  109. <div>
  110. <figure><code>
  111. $ cd sample
  112. $ cat rebar.config
  113. {sub_dirs,["apps"]}.
  114. {deps_dir,"deps"}.
  115. {deps, [
  116. {erlydtl,".*", {git, "git://github.com/voxoz/erlydtl", [] }},
  117. {cowboy, ".*", {git, "git://github.com/voxoz/cowboy", [] }},
  118. {gproc, ".*", {git, "git://github.com/voxoz/gproc", [] }},
  119. {fs, ".*", {git, "git://github.com/synrc/fs", {tag, "4.10"} }},
  120. {sh, ".*", {git, "git://github.com/synrc/sh", {tag, "2.10"} }},
  121. {mad, ".*", {git, "git://github.com/synrc/mad", {tag, "4.10"} }},
  122. {active, ".*", {git, "git://github.com/synrc/active", {tag, "4.10"} }},
  123. {nitro, ".*", {git, "git://github.com/synrc/nitro", {tag, "3.10"} }},
  124. {n2o, ".*", {git, "git://github.com/synrc/n2o", {tag, "5.10"} }}
  125. ]}
  126. </code></figure>
  127. <figure><code>
  128. $ mad deps
  129. ==> dependency: "git://github.com/voxoz/erlydtl" tag: []
  130. ==> dependency: "git://github.com/voxoz/cowlib" tag: []
  131. ==> dependency: "git://github.com/voxoz/ranch" tag: []
  132. ==> dependency: "git://github.com/voxoz/gproc" tag: []
  133. ==> dependency: "git://github.com/synrc/fs" tag: {tag,"4.10"}
  134. ==> dependency: "git://github.com/synrc/sh" tag: {tag,"2.10"}
  135. ==> dependency: "git://github.com/synrc/mad" tag: {tag,"4.10"}
  136. ==> dependency: "git://github.com/synrc/active" tag: {tag,"4.10"}
  137. ==> dependency: "git://github.com/synrc/nitro" tag: {tag,"3.10"}
  138. ==> dependency: "git://github.com/synrc/n2o" tag: {tag,"5.10"}
  139. OK
  140. </code></figure>
  141. </div>
  142. <a name="get"></a><h3>GET</h3>
  143. <figure><code>
  144. $ mad get kvx
  145. ==> dependency: "https://github.com/synrc/kvx" tag: []
  146. OK
  147. </code></figure>
  148. <a name="up"></a><h3>UP</h3>
  149. <figure><code>
  150. $ mad up
  151. OK
  152. </code></figure>
  153. <div>
  154. <ul><li><b><a href="man/mad_git.htm">mad_git</a></b> — MAD Git</li></ul></div>
  155. </section>
  156. <section>
  157. <a name="clean"></a><h3>CLEAN</h3>
  158. <div>
  159. <figure><code>
  160. $ mad clean
  161. OK
  162. </code></figure>
  163. </div>
  164. <a name="start"></a><h3>START</h3>
  165. <figure><code>
  166. $ mad start
  167. Scripting: "/Users/maxim/depot/synrc/mad/mad"
  168. OK
  169. </code></figure>
  170. <a name="attach"></a><h3>ATTACH</h3>
  171. <figure><code>
  172. $ $(mad attach)
  173. Attaching to . (^D to exit)
  174. 1>
  175. </code></figure>
  176. <a name="stop"></a><h3>STOP</h3>
  177. <figure><code>
  178. $ eval $(mad stop)
  179. Attaching to . (^D to exit)
  180. [EOF]
  181. </code></figure>
  182. <div>
  183. <ul><li><b><a href="man/mad_run.htm">mad_run</a></b> — MAD Runner</li></ul></div>
  184. </section>
  185. <section>
  186. <a name="compile"></a><h3>COMPILE</h3>
  187. <figure><code>
  188. $ mad compile
  189. Writing /apps/sample/ebin/sample.app
  190. OK
  191. </code></figure>
  192. <div>
  193. <ul><li><b><a href="man/mad_compile.htm">mad_compile</a></b> — MAD Compiler</li><li><b><a href="man/mad_app.htm">mad_app</a></b> — OTP Application files</li><li><b><a href="man/mad_cubical.htm">mad_cubical</a></b> — cubicaltt files</li><li><b><a href="man/mad_dtl.htm">mad_dtl</a></b> — DTL files</li><li><b><a href="man/mad_erl.htm">mad_erl</a></b> — Erlang source files</li><li><b><a href="man/mad_leex.htm">mad_leex</a></b> — Erlang leex files</li><li><b><a href="man/mad_yecc.htm">mad_yecc</a></b> — Erlang yecc files</li><li><b><a href="man/mad_port.htm">mad_port</a></b> — C/C++ files</li><li><b><a href="man/mad_script.htm">mad_script</a></b> — .script files</li></ul>
  194. </div>
  195. </section>
  196. <section>
  197. <a name="plan"></a><h3>PLAN</h3>
  198. <figure><code>
  199. $ mad plan
  200. OK
  201. </code></figure>
  202. <a name="strip"></a><h3>STRIP</h3>
  203. <figure><code>
  204. $ mad strip
  205. OK
  206. </code></figure>
  207. <a name="bundle"></a><h3>BUNDLE</h3>
  208. <figure><code>
  209. $ mad bundle script sample
  210. OK
  211. </code></figure>
  212. <figure><code>
  213. $ mad bundle beam sample
  214. OK
  215. </code></figure>
  216. <div>
  217. <ul><li><b><a href="man/mad_release.htm">mad_release</a></b> — MAD Bundler</li><li><b><a href="man/mad_escript.htm">mad_escript</a></b> — MAD escript bundler</li><li><b><a href="man/mad_systools.htm">mad_systools</a></b> — MAD BEAM release bundler</li></ul>
  218. </div>
  219. </section>
  220. <section>
  221. <a name="repl"></a><h3>REPL</h3>
  222. <figure><code>
  223. $ mad repl
  224. $ open http://127.0.0.1:8001/app/index.htm
  225. </code></figure>
  226. <div>
  227. <ul><li><b><a href="man/mad_repl.htm">mad_repl</a></b> — MAD REPL</li></ul></div>
  228. </section>
  229. <section>
  230. <a name="articles"></a><h3>ARTICLES</h3>
  231. <div>
  232. <ul><li><a href="https://n2o.dev/articles/n2o.htm">N2O: PROTOCOL</a></li>
  233. <li><a href="https://n2o.dev/articles/web.htm">N2O: SERVER</a></li>
  234. <li><a href="https://n2o.dev/articles/history.htm">N2O: HISTORY</a></li></ul></div>
  235. </section>
  236. </main><footer>
  237. Made with <span class="heart">❤</span> to N2O
  238. </footer></body></html>