9. Target specifics

This chapter details the Amiga and A2560 targets.

9.1. Amiga

The installation provides the Amiga NDK (Native Development Kit) and an Amiga extension library to supplement the C library. The NDK supplied is version 3.2.

If you want to use a different Amiga NDK, search for “ndk” at Aminet.

The extension library project is available at Calypsi Amiga.

Using the --target=amiga command-line option enables Amiga headers and knowledge of its system libraries. This provides direct access to Amiga system headers and ensures proper parameter passing to Amiga library entry points.

Note

If you use a different Amiga NDK, treat its headers as system headers using #include <header.h>. Specify the path with --include-system to place them before compiler-supplied header files.

Auto open libraries

Amiga libraries must be opened before use. The compile-time runtime automatically opens certain libraries when you make function calls to them. This includes dos.library, intuition.library, and graphics.library. The exec.library does not require opening, as it is always present at address 4 on the Amiga.

Note

No specific version is requested when opening such libraries. If a specific version is required, open the library manually and handle any failures.

Amiga C runtime

The following cleanups occur automatically upon a normal application exit():

  1. All memory allocated using malloc() is released.

  2. All opened files are flushed and closed.

  3. Automatically opened libraries are closed. This includes dos, graphics and intuition libraries.

Errors from Amiga DOS calls, made on behalf of the C library, are translated to C-style error codes and stored in the errno variable.

9.2. Foenix A2560

The installation provides board support for the Foenix A2560.

Using the command-line option --target=a2560k or --target=a2560u makes specific header files available for access:

#include <mcp.h>
#include <foenix.h>

A2560 linker rule files are included in the installation directory. They follow an a2560 prefix naming convention (e.g., a2560u+.scm). You can refer to these files by name without specifying the full path. The linker first checks the current directory, then the installation directory if not found.

To modify a .scm file, copy it to your project and edit as required.

When linking, specify the same --target=a2560k or --target=a2560u option. This enables access to additional target-specific board support libraries, which are named with an sdk prefix instead of clib.