On 3 May 2022 at 21:21:01 CEST, "Brian Fox" <
bria...@brianfox.ca> wrote:
> If you have a program that you build with a Forth cross-compiler, how
> do you provide the user with the type of compiler switches that Anton
> is demonstrating?
>
> I have typically just written a Forth "script" to control everything but
> command line switches are pretty convenient . I am curious how
> others people handle this in a Forth cross-compiler environment.
Firstly, a cross compiler is a Forth app and its tools are only buried by
vocabulary/wordlist selection.
Secondly.most cross compilers support EQU, e.g
5 EQU MACHINE-TYPE
An equ is a constant that uses no target space and is ideal for
defining target switches. The MPE compiler has switches such
as
TASKING? \ true for multitasking
FAST-CMOVE? \ true for huge but fast CMOVE
as well as configuration values such as
SP-SIZE \ data stack size
The words available during interpretation include directives that
can change configuration.
Fine names/paths can also be used with macros, e.g.
ms" myproj/%arch%/floats.fth"
where %arch% may give x86 or x64 or ARM32 or ARM64.
Text Macros are also available in hosted systems.
The tools are designed with the knowledge that they will be
used in a cross-compiler. The techniques can be mixed as required.
The following programs the target Flash after compilation.
\ Define device, speed (0=auto) and project file
\ Download the target image when compilation finishes
jlink LPC4078 0 Project.jlink \ JLINK and device setup
useSWD \ use SWD rather than the
default JTAG
-download-prompts \ no prompting for download
afterwards download-sections \ download image after completion.
--
Stephen Pelc,
ste...@vfxforth.com
MicroProcessor Engineering, Ltd. - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel:
+44 (0)23 8063 1441, +44 (0)78 0390 3612,
+34 649 662 974
http://www.mpeforth.com - free VFX Forth downloads