# Licensed Materials - Property of IBM                       
# Rational Software Architect RealTime Edition - TARGET RTS                 
# Copyright IBM Corporation 1999, 2014. All Rights Reserved.      
# U.S. Government Users Restricted Rights -  Use, duplication or    
# disclosure restricted by GSA ADP  Schedule Contract with IBM Corp.

There is directory here for each supported target operating environment.

The actual names can be chosen arbitrarily, but by convention those
defined by Rational Software are structured as three juxtaposed
components.

The first component identifies the generic operating system.

The second component is an integer which identifies the major release
of the operating system.

The third component is either 'S' or 'T' which denote single-threaded
and multi-threaded configurations, respectively.

Examples include:

    SUN4S       SunOS 4.X, single-threaded
    HPUX09S     HP-US 9.X, single-threaded
    SUN5S       SunOS 5.X (Solaris), single-threaded
    SUN5T       SunOS 5.X (Solaris), multi-threaded
    QNX4S       QNX Software System, single-threaded

Each directory should include at least two files:
    RTTarget.h
    target.mk

Each instance of RTTarget.h must define a macro of the form TARGET_xxx
where the suffix is the first component of the target directory name;
the value should be the second component (the major release number of
that O/S).  For backwards compatibility, RTTarget.h should also define
TARGET as one of the platXXX symbols defined in RTConfig.h when an
appropriate name exists.  For example, HPRT2S/RTTarget.h includes:

    #define TARGET_HPRT 2
    #define TARGET platHPRT

Previously application code could say

    #if TARGET == platHPRT

to select code specific to the HP-RT operating system.  These sections
may now be equivalently selected by coding

    #if defined( TARGET_HPRT )

Targets added in the future will only make the second form available.
This new approach also allows for version-specific elements via:

    #if defined( TARGET_HPRT ) && TARGET_HPRT - 0 >= 2

RTTarget.h must also define USE_THREADS.  The value of this symbol
controls the inclusion of the code supporting multi-threaded
capabilities.

Other symbols may appear in RTTarget.h when the defaults specified in
RTConfig.h are inappropriate.  For example, QNX4S/RTTarget.h could say
the following if Socket is not running:

    #define HAVE_INET 0

Within each directory should be a copy of 'target.mk' which is included
in makefiles used both when compiling the libraries and when compiling
applications. It may (re)define any variables, but the following are
target-specific.

    Macro          Purpose
    -----          -------
    TARGETCCFLAGS  compile options
    TARGETLDFLAGS  link options
    TARGETLIBS     link libraries

These definitions should make use of the make variables defined by
libset.mk so that any suitable compiler may be used.

The main include file must define the make variable 'TARGET' and will
normally just include common.mk.  For example, here is targets/SUN5T:

    TARGET = SUN5T
    include $(RTS_HOME)/target/common.mk

RTS_HOME is defined by the toolset-generated makefile.  The file
'common.mk' makes use of the macros defined here, and includes
libset/$(LIBRARY_SET)/libset.mk, target/$(TARGET)/target.mk and
config/$(TARGET).$(LIBRARY_SET).mk.

In extreme cases, other header files may be altered to deal with specific
issues that arise out of dealing with a particular target by placing the
modified copy in the appropriate target directory.  Hopefully this will
be necessary only rarely.
