You can combine variant names into a compound variant, using a period (.), dash (-), or slash (/) between the variants.
The common makefiles are triggered by a number of distinguished variant names:
If the compound variant doesn't include a, so, or dll, an executable is being built.
Variant names can be placed in any order in the compound variant, but to avoid confusing a source configuration management tool (e.g., CVS), make sure that the last variant in the list never looks like a generated file suffix. In other words, don't use variant names ending in .a, .so, or .o.
The following table lists some examples:
Variant | Purpose |
---|---|
g.le | A debugging version of a little-endian executable. |
so.be | A big-endian version of a shared object. |
403.be | A user-defined 403 variant for a big-endian system. |
In order for the source code to tell what variant(s) it's being compiled for, the common makefiles arrange for each variant name to be suffixed to the string VARIANT_ and have that defined as a C or assembler macro on the command line. For example, if the compound variant is so.403.be, the makefiles define the following C macros:
Note that neither VARIANT_be nor VARIANT_le is defined on a CPU that doesn't support bi-endian operation, so any endian-specific code should always test for the C macros __LITTLEENDIAN__ or __BIGENDIAN__ (instead of VARIANT_le or VARIANT_be) to determine what endian-ness it's running under.