retroforth/doc/html/chapters/toolchain/info/retro-compiler.html

100 lines
3.6 KiB
HTML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>.</title>
<style type="text/css">
* { color: #000; background: #fff; max-width: 700px; }
tt, pre { background: #dedede; color: #111; font-family: monospace;
white-space: pre; display: block; width: 100%; }
.indentedcode { margin-left: 2em; margin-right: 2em; }
.codeblock {
background: #dedede; color: #111; font-family: monospace;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
padding: 7px;
display: block;
}
.indentedlist { margin-left: 2em; color: #000; }
span { white-space: pre; }
.text { color: #000; white-space: pre; background: #dedede; }
.colon { color: #000; background: #dedede; }
.note { color: #000; background: #dedede; }
.str { color: #000; text-decoration: underline; background: #dedede; }
.num { color: #000; background: #dedede; font-weight: bold; font-style: italic; }
.fnum { color: #000; font-weight: bold; background: #dedede; }
.ptr { color: #000; font-weight: bold; background: #dedede; }
.fetch { color: #000; font-style: italic; background: #dedede; }
.store { color: #000; font-style: italic; background: #dedede; }
.char { color: #000; background: #dedede; }
.inst { color: #000; background: #dedede; }
.defer { color: #000; background: #dedede; }
.imm { color: #000; font-weight: bold; background: #dedede; }
.prim { color: #000; font-weight: bolder; background: #dedede; }
.tt { white-space: pre; font-family: monospace; background: #dedede; }
.h1, .h2, .h3, .h4 { white-space: normal; }
.h1 { font-size: 125%; }
.h2 { font-size: 120%; }
.h3 { font-size: 115%; }
.h4 { font-size: 110%; }
.hr { display: block; height: 2px; background: #000000; }
</style>
</head><body>
<p><br/><br/>
In addition to the base system, users of RETRO on Unix hosts
with ELF executables can build and use the <span class="tt">retro-compiler</span>
to generate turnkey executables.
<br/><br/>
<span class="h2">Requirements</span>
<br/><br/>
&bull; Unix host<br/>
&bull; ELF executable support<br/>
&bull; <span class="tt">objcopy</span> in the $PATH<br/>
<br/><br/>
<span class="h2">Building</span>
<br/><br/>
make bin/retro-compiler
<br/><br/>
<span class="h2">Installing</span>
<br/><br/>
Copy <span class="tt">bin/retro-compiler</span> to somewhere in your $PATH.
<br/><br/>
<span class="h2">Using</span>
<br/><br/>
<span class="tt">retro-compiler</span> takes two arguments: the source file to
compile and the name of the word to use as the main entry
point.
<br/><br/>
Example:
<br/><br/>
Given a <span class="tt">hello.forth</span>:
<br/><br/>
<tt class='indentedcode'>~~~</tt>
<tt class='indentedcode'>:hello&nbsp;'Hello_World!&nbsp;s:put&nbsp;nl&nbsp;;</tt>
<tt class='indentedcode'>~~~</tt>
<br/><br/>
Use:
<br/><br/>
<tt class='indentedcode'>retro-compiler&nbsp;hello.forth&nbsp;hello</tt>
<br/><br/>
The compiler will generate an <span class="tt">a.out</span> file which you can
then rename.
<br/><br/>
<br/><br/>
This does not provide the scripting support for command line
arguments that the standard <span class="tt">retro</span> interface offers.
<br/><br/>
A copy of <span class="tt">objcopy</span> needs to be in the path for compilation
to work.
<br/><br/>
The current working directory must be writable.
<br/><br/>
This only supports hosts using ELF executables.
<br/><br/>
The output file name is fixed to <span class="tt">a.out</span>.
</p>
</body></html>