Build System Native Code Module


Overview

The Build System Native Code Module provides the build system with the ability to compile and link native object files, executables, shared libraries, and static libried from C, C++, and assembler source files.

Macros and Controls

NC_CONTROL_TOOLCHAIN
Specifies the default tool chain to use. Curently recognized tool chains are "GNU" "VENDOR", "PURIFY", "XC_CAVIUMMIPS64_LINUNX", and "XC_CAVIUMMIPS64_SIMPLEEXECUTIVE",

NC_CONTROL_OPTIMIZE
Specifies whether files are compiled with compiler optimizations by default. A value of "0" turns optimization off, a value of "1" turns optimization on.

NC_CONTROL_DEBUG
Specifies whether files are compiled with debug symbols by default. A value of "0" turns debug symbols off, a value of "1" turns debug symbols on.

NC_CONTROL_PROFILE
Specifies whether files are compiled with profiling (prof/gprof) symbols by default. A value of "0" turns profiling off, a value of "1" turns profiling on.

NC_CONTROL_COV
Specifies whether files are compiled with coverage (e.g., gcov) symbols by default. A value of "0" turns coverage off, a value of "1" turns coverage on.

NC_CONTROL_STRIP
Specifies whether targets are stripped after they are built. A value of "0" turns stripping off, a value of "1" turns stripping on.

NC_CONTROL_NOASSERT
Specifies whether targets are compiled without asserts. A value of "0" leaves asserts in, a value of "1" takes out asserts.

NC_CONTROL_REENTRANT
Specifies whether targets are compiled reentrant by default. A value of "0" uses the default based on filenames, a value of "1" makes the default behavior to build objects reentrant.


Targets


Functions


EXE_TARGETS

EXE_TARGETS Overview

EXE_TARGETS is the executable pattern target. This pattern target is used to produce executable files from object files. EXE_TARGETS patten targets will be built during the "target" phase of a build. The general form of the linker command used to generate executable targets is as follows:
<linker> -o <executable target> <linker flags> <object files> <linker load library arguments>

The <linker flags> used to build an executable are assembled from the following macros in the indicated order as is appropriate for the current NC_CONTROLS_* settings:

FLAGS_<TOOLCHAIN>_LD_EXE
FLAGS_LD_EXE
[ FLAGS_<TOOLCHAIN>_LD_EXE_OPT ]
[ FLAGS_LD_EXE_OPT ]
[ FLAGS_<TOOLCHAIN>_LD_EXE_DBG ]
[ FLAGS_LD_EXE_DBG ]
[ FLAGS_<TOOLCHAIN>_LD_EXE_PROFILE ]
[ FLAGS_LD_EXE_PROFILE ]
[ FLAGS_<TOOLCHAIN>_LD_EXE_COV ]
[ FLAGS_LD_EXE_COV ]
Simmilarly, the <linker load library arguments> passed to the linker to build an executable are assembled from the following macros in the indicated order as is appropriate for the current NC_CONTROLS_* settings:
FLAGS_<TOOLCHAIN>_LD_EXE_LOADLIBS
FLAGS_LD_EXE_LOADLIBS
[ FLAGS_<TOOLCHAIN>_LD_EXE_LOADLIBS_OPT ]
[ FLAGS_LD_EXE_LOADLIBS_OPT ]
[ FLAGS_<TOOLCHAIN>_LD_EXE_LOADLIBS_DBG ]
[ FLAGS_LD_EXE_LOADLIBS_DBG ]
[ FLAGS_<TOOLCHAIN>_LD_EXE_LOADLIBS_PROFILE ]
[ FLAGS_LD_EXE_LOADLIBS_PROFILE ]
[ FLAGS_<TOOLCHAIN>_LD_EXE_LOADLIBS_COV ]
[ FLAGS_LD_EXE_LOADLIBS_COV ]

EXE_TARGETS Options

<exe target>_TOOLCHAIN
Override the NC_CONTROL_TOOLCHAIN setting for the current <exe target> only

<exe target>_LD
Override the default linker for the current target.

<exe target>_STRIP
Override the default stripper for the current target.

<exe target>_OBJS
Specify the objects to be build for the current <exe target> from source code in the current directory. Objects specified in this list need not appear in OBJ_???_TARGET declarations if simply build from C, C++, or assembly source code, but may have <object target>_<OPTION> macros controling the the construction of these options if needed. Defaults to "<exe target>.o".

<exe target>_RAWOBJS
Specify additional objects to link into the executable target. Full releative paths to the object files must be used.

<exe target>_DEP
Specify additional dependancies for the target executable.

<exe target>_LDFLAGS
Override FLAGS_<TOOLCHAIN>_LD_EXE and FLAGS_LD_EXE for the current <exe target>.

<exe target>_LDFLAGS_OPT
Override FLAGS_<TOOLCHAIN>_LD_EXE_OPT and FLAGS_LD_EXE_OPT for the current <exe target>.

<exe target>_LDFLAGS_DBG
Override FLAGS_<TOOLCHAIN>_LD_EXE_DBG and FLAGS_LD_EXE_DBG for the current <exe target>.

<exe target>_LDFLAGS_PROFILE
Override FLAGS_<TOOLCHAIN>_LD_EXE_PROFILE and FLAGS_LD_EXE_PROFILE for the current <exe target>.

<exe target>_LDFLAGS_COV
Override FLAGS_<TOOLCHAIN>_LD_EXE_COV and FLAGS_LD_EXE_COV for the current <exe target>.

<exe target>_LDFLAGS_LOADLIBS
Override FLAGS_<TOOLCHAIN>_LD_EXE_LOADLIBS and FLAGS_LD_EXE_LOADLIBS for the current <exe target>.

<exe target>_LDFLAGS_LOADLIBS_OPT
Override FLAGS_<TOOLCHAIN>_LD_EXE_LOADLIBS_OPT and FLAGS_LD_EXE_LOADLIBS_OPT for the current <exe target>.

<exe target>_LDFLAGS_LOADLIBS_DBG
Override FLAGS_<TOOLCHAIN>_LD_EXE_LOADLIBS_DBG and FLAGS_LD_EXE_LOADLIBS_DBG for the current <exe target>.

<exe target>_LDFLAGS_LOADLIBS_PROFILE
Override FLAGS_<TOOLCHAIN>_LD_EXE_LOADLIBS_PROFILE and FLAGS_LD_EXE_LOADLIBS_PROFILE for the current <exe target>.

<exe target>_LDFLAGS_LOADLIBS_COV
Override FLAGS_<TOOLCHAIN>_LD_EXE_LOADLIBS_COV and FLAGS_LD_EXE_LOADLIBS_COV for the current <exe target>.

<exe target>_STRIPFLAGS
Override FLAGS_<TOOLCHAIN>_STRIP_EXE and FLAGS_STRIP_EXE for the current <exe target>.


SHLIB_TARGETS

SHLIB_TARGETS Overview

SHLIB_TARGETS is the shared library pattern target. This pattern target is used to produce shared library files from object files. SHLIB_TARGETS patten targets will be built during the "target" phase of a build. The general form of the linker command used to generate shared library targets is as follows:
<linker> -o <shared library target> <linker flags> <object files> <linker load library arguments>

The <linker flags> used to build a shared library are assembled from the following macros in the indicated order as is appropriate for the current NC_CONTROLS_* settings:

FLAGS_<TOOLCHAIN>_LD_SHLIB
FLAGS_LD_SHLIB
[ FLAGS_<TOOLCHAIN>_LD_SHLIB_OPT ]
[ FLAGS_LD_SHLIB_OPT ]
[ FLAGS_<TOOLCHAIN>_LD_SHLIB_DBG ]
[ FLAGS_LD_SHLIB_DBG ]
[ FLAGS_<TOOLCHAIN>_LD_SHLIB_PROFILE ]
[ FLAGS_LD_SHLIB_PROFILE ]
[ FLAGS_<TOOLCHAIN>_LD_SHLIB_COV ]
[ FLAGS_LD_SHLIB_COV ]
Simmilarly, the <linker load library arguments> passed to the linker to build a shared library are assembled from the following macros in the indicated order as is appropriate for the current NC_CONTROLS_* settings:
FLAGS_<TOOLCHAIN>_LD_SHLIB_LOADLIBS
FLAGS_LD_SHLIB_LOADLIBS
[ FLAGS_<TOOLCHAIN>_LD_SHLIB_LOADLIBS_OPT ]
[ FLAGS_LD_SHLIB_LOADLIBS_OPT ]
[ FLAGS_<TOOLCHAIN>_LD_SHLIB_LOADLIBS_DBG ]
[ FLAGS_LD_SHLIB_LOADLIBS_DBG ]
[ FLAGS_<TOOLCHAIN>_LD_SHLIB_LOADLIBS_PROFILE ]
[ FLAGS_LD_SHLIB_LOADLIBS_PROFILE ]
[ FLAGS_<TOOLCHAIN>_LD_SHLIB_LOADLIBS_COV ]
[ FLAGS_LD_SHLIB_LOADLIBS_COV ]

SHLIB_TARGETS Options

<shared library target>_TOOLCHAIN
Override the NC_CONTROL_TOOLCHAIN setting for the current <shared library target> only

<shared library target>_LD
Override the default linker for the current target.

<shared library target>_STRIP
Override the default stripper for the current target.

<shared library target>_OBJS
Specify the objects to be build for the current <shared library target> from source code in the current directory. Objects specified in this list need not appear in OBJ_???_TARGET declarations if simply build from C, C++, or assembly source code, but may have <object target>_<OPTION> macros controling the the construction of these options if needed.

<shared library target>_RAWOBJS
Specify additional objects to link into the shared library target. Full releative paths to the object files must be used.

<shared library target>_DEP
Specify additional dependancies for the target shared library.

<shared library target>_LDFLAGS
Override FLAGS_<TOOLCHAIN>_LD_SHLIB and FLAGS_LD_SHLIB for the current <shared library target>.

<shared library target>_LDFLAGS_OPT
Override FLAGS_<TOOLCHAIN>_LD_SHLIB_OPT and FLAGS_LD_SHLIB_OPT for the current <shared library target>.

<shared library target>_LDFLAGS_DBG
Override FLAGS_<TOOLCHAIN>_LD_SHLIB_DBG and FLAGS_LD_SHLIB_DBG for the current <shared library target>.

<shared library target>_LDFLAGS_PROFILE
Override FLAGS_<TOOLCHAIN>_LD_SHLIB_PROFILE and FLAGS_LD_SHLIB_PROFILE for the current <shared library target>.

<shared library target>_LDFLAGS_COV
Override FLAGS_<TOOLCHAIN>_LD_SHLIB_COV and FLAGS_LD_SHLIB_COV for the current <shared library target>.

<shared library target>_LDFLAGS_LOADLIBS
Override FLAGS_<TOOLCHAIN>_LD_SHLIB_LOADLIBS and FLAGS_LD_SHLIB_LOADLIBS for the current <shared library target>.

<shared library target>_LDFLAGS_LOADLIBS_OPT
Override FLAGS_<TOOLCHAIN>_LD_SHLIB_LOADLIBS_OPT and FLAGS_LD_SHLIB_LOADLIBS_OPT for the current <shared library target>.

<shared library target>_LDFLAGS_LOADLIBS_DBG
Override FLAGS_<TOOLCHAIN>_LD_SHLIB_LOADLIBS_DBG and FLAGS_LD_SHLIB_LOADLIBS_DBG for the current <shared library target>.

<shared library target>_LDFLAGS_LOADLIBS_PROFILE
Override FLAGS_<TOOLCHAIN>_LD_SHLIB_LOADLIBS_PROFILE and FLAGS_LD_SHLIB_LOADLIBS_PROFILE for the current <shared library target>.

<shared library target>_LDFLAGS_LOADLIBS_COV
Override FLAGS_<TOOLCHAIN>_LD_SHLIB_LOADLIBS_COV and FLAGS_LD_SHLIB_LOADLIBS_COV for the current <shared library target>.

<shared library target>_STRIPFLAGS
Override FLAGS_<TOOLCHAIN>_STRIP_SHLIB and FLAGS_STRIP_SHLIB for the current <shared library target>.


LIB_TARGETS

LIB_TARGETS Overview

LIB_TARGETS is the static library pattern target. This pattern target is used to produce static library files from object files. LIB_TARGETS patten targets will be built during the "target" phase of a build. The general form of the archiver command used to generate static library targets is as follows:
<archiver> <archiver flags> <static library target> <object files> <archiver load library arguments>

The <archiver flags> used to build a static library are assembled from the following macros in the indicated order as is appropriate for the current NC_CONTROLS_* settings:

FLAGS_<TOOLCHAIN>_AR_LIB
FLAGS_AR_LIB
[ FLAGS_<TOOLCHAIN>_AR_LIB_OPT ]
[ FLAGS_AR_LIB_OPT ]
[ FLAGS_<TOOLCHAIN>_AR_LIB_DBG ]
[ FLAGS_AR_LIB_DBG ]
[ FLAGS_<TOOLCHAIN>_AR_LIB_PROFILE ]
[ FLAGS_AR_LIB_PROFILE ]
[ FLAGS_<TOOLCHAIN>_AR_LIB_COV ]
[ FLAGS_AR_LIB_COV ]
Simmilarly, the <archiver load library arguments> passed to the archiver to build a static library are assembled from the following macros in the indicated order as is appropriate for the current NC_CONTROLS_* settings:
FLAGS_<TOOLCHAIN>_AR_LIB_LOADLIBS
FLAGS_AR_LIB_LOADLIBS
[ FLAGS_<TOOLCHAIN>_AR_LIB_LOADLIBS_OPT ]
[ FLAGS_AR_LIB_LOADLIBS_OPT ]
[ FLAGS_<TOOLCHAIN>_AR_LIB_LOADLIBS_DBG ]
[ FLAGS_AR_LIB_LOADLIBS_DBG ]
[ FLAGS_<TOOLCHAIN>_AR_LIB_LOADLIBS_PROFILE ]
[ FLAGS_AR_LIB_LOADLIBS_PROFILE ]
[ FLAGS_<TOOLCHAIN>_AR_LIB_LOADLIBS_COV ]
[ FLAGS_AR_LIB_LOADLIBS_COV ]

SHLIB_TARGETS Options

<static library target>_TOOLCHAIN
Override the NC_CONTROL_TOOLCHAIN setting for the current <static library target> only

<static library target>_AR
Override the default archiver for the current target.

<static library target>_STRIP
Override the default stripper for the current target.

<static library target>_OBJS
Specify the objects to be build for the current <static library target> from source code in the current directory. Objects specified in this list need not appear in OBJ_???_TARGET declarations if simply build from C, C++, or assembly source code, but may have <object target>_<OPTION> macros controling the the construction of these options if needed.

<static library target>_RAWOBJS
Specify additional objects to archiver into the static library target. Full releative paths to the object files must be used.

<static library target>_DEP
Specify additional dependancies for the target static library.

<static library target>_ARFLAGS
Override FLAGS_<TOOLCHAIN>_AR_LIB and FLAGS_AR_LIB for the current <static library target>.

<static library target>_ARFLAGS_OPT
Override FLAGS_<TOOLCHAIN>_AR_LIB_OPT and FLAGS_AR_LIB_OPT for the current <static library target>.

<static library target>_ARFLAGS_DBG
Override FLAGS_<TOOLCHAIN>_AR_LIB_DBG and FLAGS_AR_LIB_DBG for the current <static library target>.

<static library target>_ARFLAGS_PROFILE
Override FLAGS_<TOOLCHAIN>_AR_LIB_PROFILE and FLAGS_AR_LIB_PROFILE for the current <static library target>.

<static library target>_ARFLAGS_COV
Override FLAGS_<TOOLCHAIN>_AR_LIB_COV and FLAGS_AR_LIB_COV for the current <static library target>.

<static library target>_ARFLAGS_LOADLIBS
Override FLAGS_<TOOLCHAIN>_AR_LIB_LOADLIBS and FLAGS_AR_LIB_LOADLIBS for the current <static library target>.

<static library target>_ARFLAGS_LOADLIBS_OPT
Override FLAGS_<TOOLCHAIN>_AR_LIB_LOADLIBS_OPT and FLAGS_AR_LIB_LOADLIBS_OPT for the current <static library target>.

<static library target>_ARFLAGS_LOADLIBS_DBG
Override FLAGS_<TOOLCHAIN>_AR_LIB_LOADLIBS_DBG and FLAGS_AR_LIB_LOADLIBS_DBG for the current <static library target>.

<static library target>_ARFLAGS_LOADLIBS_PROFILE
Override FLAGS_<TOOLCHAIN>_AR_LIB_LOADLIBS_PROFILE and FLAGS_AR_LIB_LOADLIBS_PROFILE for the current <static library target>.

<static library target>_ARFLAGS_LOADLIBS_COV
Override FLAGS_<TOOLCHAIN>_AR_LIB_LOADLIBS_COV and FLAGS_AR_LIB_LOADLIBS_COV for the current <static library target>.

<static library target>_STRIPFLAGS
Override FLAGS_<TOOLCHAIN>_STRIP_LIB and FLAGS_STRIP_LIB for the current <static library target>.


OBJ_INC_TARGETS

OBJ_INC_TARGETS Overview

OBJ_INC_TARGETS is the incrementally linked object file pattern target. This pattern target is used to produce incrementally linked object files from other object files. OBJ_INC_TARGETS patten targets will be built during the "target" phase of a build. The general form of the linker command used to generate incrementally linked object targets is as follows:
<linker> -o <incremental object target> <linker flags> <object files> <linker load library arguments>

The <linker flags> used to build an incrementally linked object are assembled from the following macros in the indicated order as is appropriate for the current NC_CONTROLS_* settings:

FLAGS_<TOOLCHAIN>_LD_INCOBJ
FLAGS_LD_INCOBJ
[ FLAGS_<TOOLCHAIN>_LD_INCOBJ_OPT ]
[ FLAGS_LD_INCOBJ_OPT ]
[ FLAGS_<TOOLCHAIN>_LD_INCOBJ_DBG ]
[ FLAGS_LD_INCOBJ_DBG ]
[ FLAGS_<TOOLCHAIN>_LD_INCOBJ_PROFILE ]
[ FLAGS_LD_INCOBJ_PROFILE ]
[ FLAGS_<TOOLCHAIN>_LD_INCOBJ_COV ]
[ FLAGS_LD_INCOBJ_COV ]
Simmilarly, the <linker load library arguments> passed to the linker to build a incrementally linked object are assembled from the following macros in the indicated order as is appropriate for the current NC_CONTROLS_* settings:
FLAGS_<TOOLCHAIN>_LD_INCOBJ_LOADLIBS
FLAGS_LD_INCOBJ_LOADLIBS
[ FLAGS_<TOOLCHAIN>_LD_INCOBJ_LOADLIBS_OPT ]
[ FLAGS_LD_INCOBJ_LOADLIBS_OPT ]
[ FLAGS_<TOOLCHAIN>_LD_INCOBJ_LOADLIBS_DBG ]
[ FLAGS_LD_INCOBJ_LOADLIBS_DBG ]
[ FLAGS_<TOOLCHAIN>_LD_INCOBJ_LOADLIBS_PROFILE ]
[ FLAGS_LD_INCOBJ_LOADLIBS_PROFILE ]
[ FLAGS_<TOOLCHAIN>_LD_INCOBJ_LOADLIBS_COV ]
[ FLAGS_LD_INCOBJ_LOADLIBS_COV ]

OBJ_INC_TARGETS Options

<object target>_TOOLCHAIN
Override the NC_CONTROL_TOOLCHAIN setting for the current <object target> only

<object target>_LD
Override the default linker for the current target.

<object target>_OBJS
Specify the objects to be build for the current <object target> from source code in the current directory. Objects specified in this list need not appear in OBJ_???_TARGET declarations if simply build from C, C++, or assembly source code, but may have <object target>_<OPTION> macros controling the the construction of these options if needed.

<object target>_RAWOBJS
Specify additional objects to link into the incrementally linked object target. Full releative paths to the object files must be used.

<object target>_DEP
Specify additional dependancies for the target incrementally linked object.

<object target>_LDFLAGS
Override FLAGS_<TOOLCHAIN>_LD_INCOBJ and FLAGS_LD_INCOBJ for the current <object target>.

<object target>_LDFLAGS_OPT
Override FLAGS_<TOOLCHAIN>_LD_INCOBJ_OPT and FLAGS_LD_INCOBJ_OPT for the current <object target>.

<object target>_LDFLAGS_DBG
Override FLAGS_<TOOLCHAIN>_LD_INCOBJ_DBG and FLAGS_LD_INCOBJ_DBG for the current <object target>.

<object target>_LDFLAGS_PROFILE
Override FLAGS_<TOOLCHAIN>_LD_INCOBJ_PROFILE and FLAGS_LD_INCOBJ_PROFILE for the current <object target>.

<object target>_LDFLAGS_COV
Override FLAGS_<TOOLCHAIN>_LD_INCOBJ_COV and FLAGS_LD_INCOBJ_COV for the current <object target>.

<object target>_LDFLAGS_LOADLIBS
Override FLAGS_<TOOLCHAIN>_LD_INCOBJ_LOADLIBS and FLAGS_LD_INCOBJ_LOADLIBS for the current <object target>.

<object target>_LDFLAGS_LOADLIBS_OPT
Override FLAGS_<TOOLCHAIN>_LD_INCOBJ_LOADLIBS_OPT and FLAGS_LD_INCOBJ_LOADLIBS_OPT for the current <object target>.

<object target>_LDFLAGS_LOADLIBS_DBG
Override FLAGS_<TOOLCHAIN>_LD_INCOBJ_LOADLIBS_DBG and FLAGS_LD_INCOBJ_LOADLIBS_DBG for the current <object target>.

<object target>_LDFLAGS_LOADLIBS_PROFILE
Override FLAGS_<TOOLCHAIN>_LD_INCOBJ_LOADLIBS_PROFILE and FLAGS_LD_INCOBJ_LOADLIBS_PROFILE for the current <object target>.

<object target>_LDFLAGS_LOADLIBS_COV
Override FLAGS_<TOOLCHAIN>_LD_INCOBJ_LOADLIBS_COV and FLAGS_LD_INCOBJ_LOADLIBS_COV for the current <object target>.


OBJ_CC_TARGETS

OBJ_CC_TARGETS Overview

OBJ_CC_TARGETS is the C Code objects pattern target. This pattern target is used to produce object files from C source code. OBJ_CC_TARGETS patten targets will be built during the "target" phase of a build. The general form of the compiler command used to generate C object targets is as follows:
<compiler> <compiler flags> -c -o <object target> <source file>

The <compiler flags> used to build an object file from C code are assembled from the following macros in the indicated order as is appropriate for the current NC_CONTROLS_* settings:

FLAGS_<TOOLCHAIN>_CC
FLAGS_CC
[ FLAGS_<TOOLCHAIN>_CC_OPT ]
[ FLAGS_CC_OPT ]
[ FLAGS_<TOOLCHAIN>_CC_DBG ]
[ FLAGS_CC_DBG ]
[ FLAGS_<TOOLCHAIN>_CC_PROFILE ]
[ FLAGS_CC_PROFILE ]
[ FLAGS_<TOOLCHAIN>_CC_COV ]
[ FLAGS_CC_COV ]
[ FLAGS_<TOOLCHAIN>_CC_NOASSERT ]
[ FLAGS_CC_NOASSERT ]
[ FLAGS_<TOOLCHAIN>_CC_REENT ]
[ FLAGS_CC_REENT ]

OBJ_CC_TARGETS Options

<object target>_TOOLCHAIN
Override the NC_CONTROL_TOOLCHAIN setting for the current <object target> only

<object target>_SRC
Override the default source file location of <object target:%.o=%.c>

<object target>_CC
Override the default compiler for for the current <object target> only.

<object target>_REENT
Override the default reentrant setting for the current <object target> only.

<object target>_DEP
Specify additional dependancies for the target object.

<object target>_CFLAGS
Override FLAGS_<TOOLCHAIN>_CC and FLAGS_CC for the current <object target>.

<object target>_CFLAGS_OPT
Override FLAGS_<TOOLCHAIN>_CC_OPT and FLAGS_CC_OPT for the current <objecr target>.

<object target>_CFLAGS_DBG
Override FLAGS_<TOOLCHAIN>_CC_DBG and FLAGS_CC_DBG for the current <object target>.

<object target>_CFLAGS_PROFILE
Override FLAGS_<TOOLCHAIN>_CC_PROFILE and FLAGS_CC_PROFILE for the current <object target>.

<object target>_CFLAGS_COV
Override FLAGS_<TOOLCHAIN>_CC_COV and FLAGS_CC_COV for the current <object target>.

<object target>_CFLAGS_NOASSERT
Override FLAGS_<TOOLCHAIN>_CC_NOASSERT and FLAGS_CC_NOASSERT for the current <object target>.


OBJ_CXX_TARGETS

OBJ_CXX_TARGETS Overview

OBJ_CXX_TARGETS is the C++ Code objects pattern target. This pattern target is used to produce object files from C++ source code. OBJ_CXX_TARGETS patten targets will be built during the "target" phase of a build. The general form of the compiler command used to generate C++ object targets is as follows:
<compiler> <compiler flags> -c -o <object target> <source file>

The <compiler flags> used to build an object file from C++ code are assembled from the following macros in the indicated order as is appropriate for the current NC_CONTROLS_* settings:

FLAGS_<TOOLCHAIN>_CXX
FLAGS_CXX
[ FLAGS_<TOOLCHAIN>_CXX_OPT ]
[ FLAGS_CXX_OPT ]
[ FLAGS_<TOOLCHAIN>_CXX_DBG ]
[ FLAGS_CXX_DBG ]
[ FLAGS_<TOOLCHAIN>_CXX_PROFILE ]
[ FLAGS_CXX_PROFILE ]
[ FLAGS_<TOOLCHAIN>_CXX_COV ]
[ FLAGS_CXX_COV ]
[ FLAGS_<TOOLCHAIN>_CXX_NOASSERT ]
[ FLAGS_CXX_NOASSERT ]
[ FLAGS_<TOOLCHAIN>_CXX_REENT ]
[ FLAGS_CXX_REENT ]

OBJ_CXX_TARGETS Options

<object target>_TOOLCHAIN
Override the NC_CONTROL_TOOLCHAIN setting for the current <object target> only

<object target>_SRC
Override the default source file location of <object target:%.o=%.cc>

<object target>_CXX
Override the default compiler for for the current <object target> only.

<object target>_REENT
Override the default reentrant setting for for the current <object target> only.

<object target>_DEP
Specify additional dependancies for the target object.

<object target>_CXXFLAGS
Override FLAGS_<TOOLCHAIN>_CXX and FLAGS_CXX for the current <object target>.

<object target>_CXXFLAGS_OPT
Override FLAGS_<TOOLCHAIN>_CXX_OPT and FLAGS_CXX_OPT for the current <objecr target>.

<object target>_CXXFLAGS_DBG
Override FLAGS_<TOOLCHAIN>_CXX_DBG and FLAGS_CXX_DBG for the current <object target>.

<object target>_CXXFLAGS_PROFILE
Override FLAGS_<TOOLCHAIN>_CXX_PROFILE and FLAGS_CXX_PROFILE for the current <object target>.

<object target>_CXXFLAGS_COV
Override FLAGS_<TOOLCHAIN>_CXX_COV and FLAGS_CXX_COV for the current <object target>.

<object target>_CXXFLAGS_NOASSERT
Override FLAGS_<TOOLCHAIN>_CXX_NOASSERT and FLAGS_CXX_NOASSERT for the current <object target>.


OBJ_AS_TARGETS

OBJ_AS_TARGETS Overview

OBJ_AS_TARGETS is the assembly code objects pattern target. This pattern target is used to produce object files from assembly source code. OBJ_AS_TARGETS patten targets will be built during the "target" phase of a build. The general form of the assembler command used to generate assembly object targets is as follows:
<assembler> <assembler flags> -c -o <object target> <source file>

The <assembler flags> used to build an object file from assembly code are assembled from the following macros in the indicated order as is appropriate for the current NC_CONTROLS_* settings:

FLAGS_<TOOLCHAIN>_AS
FLAGS_AS
[ FLAGS_<TOOLCHAIN>_AS_OPT ]
[ FLAGS_AS_OPT ]
[ FLAGS_<TOOLCHAIN>_AS_DBG ]
[ FLAGS_AS_DBG ]
[ FLAGS_<TOOLCHAIN>_AS_PROFILE ]
[ FLAGS_AS_PROFILE ]
[ FLAGS_<TOOLCHAIN>_AS_COV ]
[ FLAGS_AS_COV ]

OBJ_AS_TARGETS Options

<object target>_TOOLCHAIN
Override the NC_CONTROL_TOOLCHAIN setting for the current <object target> only

<object target>_SRC
Override the default source file location of <object target:%.o=%.s>

<object target>_AS
Override the default assembler for for the current <object target> only.

<object target>_DEP
Specify additional dependancies for the target object.

<object target>_ASFLAGS
Override FLAGS_<TOOLCHAIN>_AS and FLAGS_AS for the current <object target>.

<object target>_ASFLAGS_OPT
Override FLAGS_<TOOLCHAIN>_AS_OPT and FLAGS_AS_OPT for the current <objecr target>.

<object target>_ASFLAGS_DBG
Override FLAGS_<TOOLCHAIN>_AS_DBG and FLAGS_AS_DBG for the current <object target>.

<object target>_ASFLAGS_PROFILE
Override FLAGS_<TOOLCHAIN>_AS_PROFILE and FLAGS_AS_PROFILE for the current <object target>.

<object target>_ASFLAGS_COV
Override FLAGS_<TOOLCHAIN>_AS_COV and FLAGS_AS_COV for the current <object target>.


nativecode_info

nativecode_info Overview

Simple target to display information about the macro settings of all global macros used by the native code module of the build system. The nativecode_info target will be built during the "info" phase of a build, and can be built in isolation by requesting the nativecode_info target.

nativecode_man

nativecode_man Overview

Simple target to display usage information and help pertaining to the native code module of the build system. The nativecode_man target will be built during the "man" phase of a build, and can be built in isolation by requesting the nativecode_man target.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_FULL(<toolchain>)

This function will return the full platform name for which the specified toolchain generates object code. If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok
base module.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_FALLBACK_1(<toolchain>)

This function will return the first fallback platform name for which the specified toolchain generates object code. If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok
base module.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_FALLBACK_2(<toolchain>)

This function will return the second fallback platform name for which the specified toolchain generates object code. If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok
base module.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_FALLBACK_3(<toolchain>)

This function will return the third fallback platform name for which the specified toolchain generates object code. If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok
base module.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_FALLBACK_4(<toolchain>)

This function will return the forth fallback platform name for which the specified toolchain generates object code. If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok
base module.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_FALLBACK_5(<toolchain>)

This function will return the fifth fallback platform name for which the specified toolchain generates object code. If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok
base module.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_FALLBACK_6(<toolchain>)

This function will return the sixth fallback platform name for which the specified toolchain generates object code. If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok
base module.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_FALLBACK_7(<toolchain>)

This function will return the seventh fallback platform name for which the specified toolchain generates object code. If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok
base module.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_LEGACYFALLBACK_1(<toolchain>)

This function will return the first legacy fallback platform name for which the specified toolchain generates object code. If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok
base module.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_LEGACYFALLBACK_2(<toolchain>)

This function will return the second legacy fallback platform name for which the specified toolchain generates object code. If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok
base module.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_LEGACYFALLBACK_3(<toolchain>)

This function will return the third legacy fallback platform name for which the specified toolchain generates object code. If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok
base module.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_LEGACYFALLBACK_4(<toolchain>)

This function will return the forth legacy fallback platform name for which the specified toolchain generates object code. If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok
base module.

NC_FUNC_GET_TOOLCHAIN_PLATFORM_LIST(<toolchain>)

This function will return a list of platform names for which the specified toolchain generates object code. This list will be in order of most specific to least specific forms of platform identification, and is suitable for _PLATFORM controls on IMPORT_TARGETS (See the
component module for information on IMPORT_TARGETS). If the toolchain is unknown or does not specify override or cross compiling platform information, default values will be derived from the current build host by the Mentok base module.

Example Makefile


# The source root of this component
COMPONENT_ROOT=../..

# The root of the build system
BS_ROOT=$(COMPONENT_ROOT)/../build3

# Boostrap Build system definitions.
include $(BS_ROOT)/defines.mk

# Specify executable pattern targets
EXE_TARGETS=hello hello-pp hi

# Specify shared lib pattern targets
SHLIB_TARGETS=libhello.so

# Specify static lib pattern targets
LIB_TARGETS=libhello.a


# Specify bare C object pattern targets
OBJ_CC_TARGETS=say-hello.o empty.o foo.o

# Specify bare C++ object pattern targets
OBJ_CXX_TARGETS=hello-plusplus.o

# Specify bare assembly object pattern targets
# OBJ_AS_TARGETS=say-hi-IA32.o

# Specify incrementally linked object targets
OBJ_INC_TARGETS=incobj.o



# ... and control the details of how the targets 
# specified above get produced. Some go full defaults,
# others we tweak.
say-hello.o_TOOLCHAIN=VENDOR
#say-hello.o_CFLAGS=-DTEST_PER_OBJECT_CFLAGS
say-hello.o_CFLAGS_OPT=-DTEST_PER_OBJECT_CFLAGS_OPT
say-hello.o_CFLAGS_DBG=-DTEST_PER_OBJECT_CFLAGS_DEBUG
say-hello.o_CFLAGS_PROFILE=-DTEST_PER_OBJECT_CFLAGS_PROFILE
say-hello.o_CFLAGS_COV=-DTEST_PER_OBJECT_CFLAGS_COV
say-hello.o_CFLAGS_NOASSERT=-DTEST_PER_OBJECT_CFLAGS_NOASSERT

foo.o_SRC=empty.c
foo.o_TOOLCHAIN=VENDOR
foo.o_CFLAGS=-DTEST_PER_OBJECT_CFLAGS
foo.o_CFLAGS_OPT=-DTEST_PER_OBJECT_CFLAGS_OPT
foo.o_CFLAGS_DBG=-DTEST_PER_OBJECT_CFLAGS_DEBUG
foo.o_CFLAGS_PROFILE=-DTEST_PER_OBJECT_CFLAGS_PROFILE
foo.o_CFLAGS_COV=-DTEST_PER_OBJECT_CFLAGS_COV
foo.o_CFLAGS_NOASSERT=-DTEST_PER_OBJECT_CFLAGS_NOASSERT


hello_OBJS=hello.o empty.o exercise-memory-debug.o say-hello.o

hello-pp_OBJS=hello-pp.o hello-plusplus.o
hello-pp_LD=$(BIN_GNU_CXX)

hi_OBJS=hi.o  say-hi-IA32.o

incobj.o_OBJS=foo.o say-hello.o
incobj.o_TOOLCHAIN=VENDOR

libhello.so_OBJS=say-hi-IA32.o say-hello.o
libhello.a_OBJS=say-hi-IA32.o say-hello.o


# Finally, include the rules to make the build system go.
include $(BS_ROOT)/rules.mk