-target
 

Syntax

-target <target>

Description

Selects the target platform used by the compiler.

The target controls the predefined platform symbols, default object format,
library search paths, runtime startup code, and platform-specific compiler
behavior.

Common target names include:

dos
win32
win64
win32-aarch64
wince-arm
wince-mips
cygwin
linux
haiku
freebsd
dragonfly
netbsd
openbsd
darwin
solaris
illumos
android
js-asmjs
xbox
wii
nuttx
riscos
aros

Some targets may also be selected through a GNU-style target triplet such
as linux-x86_64, linux-arm, android-aarch64, or
freebsd-x86_64.

For some cross targets, helper commands may be installed alongside the
compiler. Those helpers are usually the best entry point:

fbc-js
fbc-android
fbc-wii
fbc-xbox

Those commands supply the SDK, linker, runtime, and packaging options
expected by their platform.

Example

(sh)
fbc -target linux hello.bas
fbc -target haiku hello.bas
fbc -target android hello.bas
fbc -target js-asmjs hello.bas
fbc -target xbox hello.bas
fbc -target wii hello.bas
fbc -target nuttx hello.bas
fbc -target riscos hello.bas
fbc -target aros-m68k hello.bas

Predefined target symbols

The compiler defines FB_<TARGET> for the selected target. For
example:

-target android defines FB_ANDROID
-target haiku defines FB_HAIKU
-target dragonfly defines FB_DRAGONFLY
-target solaris defines FB_SOLARIS
-target illumos defines FB_ILLUMOS
-target js-asmjs defines FB_JS
-target xbox defines FB_XBOX
-target wii defines FB_WII
-target nuttx defines FB_NUTTX
-target riscos defines FB_RISCOS
-target aros defines FB_AROS

Portable programs should use these predefined symbols when platform-specific
code is required.


See also