This variable can be set to a gcc toolchain triplet such as
i686-pc-linux-gnu or
x86_64-w64-mingw32 in order to cross-compile using that GCC cross-compiler toolchain. The makefile will use
fbc -target $(TARGET) instead of
fbc, and
$(TARGET)-gcc instead of
gcc.
For example, on a Debian GNU/Linux system with the
i686-w64-mingw32 GCC cross-compiler installed, you can build the win32 rtlib like this:
# Build the win32 rtlib/gfxlib2
make rtlib gfxlib2 TARGET=i686-w64-mingw32
# Install it into /usr/local/lib/i686-w64-mingw32-freebasic
make install-rtlib install-gfxlib2 TARGET=i686-w64-mingw32
It will supplement the existing fbc installation in
/usr/local, like a plugin, and from now on you can cross-compile FB programs for win32 by doing:
fbc -target i686-w64-mingw32 ...