To build a product for platform different to that of the local system is called cross-compiling. Sometimes this cross-compiling is just for a different instruction set (say x64 instead of x86). Other times it is for a completely different operating system and/or CPU architecture. In such cases, a cross-compiler may be required to build for the target platform.

MakeMe supports cross-compiling via the me --platform switch. This adds a platform to the list of platforms to be made when building. Multiple platforms may be specified and the local platform alias may be used for the local development platform.

Some products require local building to make the tools that are required to build for a target platform. This necessitates two build passes: one for the local system and one for the target. These products add a "platforms: ['local']" property to their settings collection in the file. This automatically adds the local platform to the platforms list and is the same as adding --platform local on the command line when configuring.

me --platform windows-x64-debug -configure .

This will create a configuration file and a that references it. The platform switch does not need to be restated after configuration.

Environment Variables

MakeMe has default command paths and command flags for the compiler, linker and other tools. These can be overridden by providing environment variables containing alternate flags to use.

Use the variables AR, CC and LD to specify the path to the archiver, compiler and linker tools. Use CFLAGS to provide compiler flags, DFLAGS for pre-processor definitions, IFLAGS for compiler include paths and LDFLAGS for linker flags.

If these flags are provided to MakeMe when building, they apply to that run only. If the flags are provide when configuring, they are saved in the generated platform build file and apply to all subsequent runs. For example:

CC=/path/to/compiler CFLAGS=-w me configure

© Embedthis Software. All rights reserved.