Building with MakeMe
This document describes the process to build the software from source using MakeMe. First make sure you have read the Building Overview to prepare your build environment.
The procedure for building with MakeMe is the same for all supported platforms.
You can download MakeMe from the Embedthis MakeMe Download download site. Packaged installations are provided for Windows and Mac. For Linux, use the source distribution. Read Installing MakeMe for details.
Before building with MakeMe, you need to do a one-time configuration step. This customizes the software to select features, options and third-party packages available on your system. The configure shell script simply invokes me configure and passes all command line options to me.
You may run the configure script with no options to accept the defaults — this is a good starting point:
You may also supply options to tailor the build:
configure --release --without all
The --release switch instructs MakeMe to build an optimized production release. The --without all switch will disable non-essential features and components to create a minimal build.
During configuration, MakeMe will create:
- A MakeMe file that specifies the platforms to build named: start.me
- An output products directory for each platform named: build/OS-ARCH-PROFILE
- A MakeMe file for each platform named: build/OS-ARCH-PROFILE/platform.me
- A source header with for the build configuration named: build/OS-ARCH-PROFILE/inc/me.h
OS is the name of the operating system, ARCH is the name of the cpu architecture and PROFILE is the build profile name, typically "debug" or "release". For example: linux-x86-debug.
The tables below describe the key configuration options.
Basic Configure Options
|--debug||Build a debug build. This builds a development, non-optimized build with debug symbols.|
|--help||Display the me program usage help.|
|--set KEY=VALUE||Set the value of a property in the MakeMe settings collection. For example: "--set mpr.tracing=false".|
|--quiet, -q||Run quietly without progress trace.|
|--release||Build a release build. This builds an optimized, production-ready build of the software.|
|--verbose, -v||Run verbosely and emit more detailed progress trace.|
Specify the target platform for which to build. For example "-platform linux-arm-debug". Supported operating systems are: freebsd, linux, macosx, vxworks and windows. Supported architectures are: arm, mips, ppc, x64 or x86.
If the -platform option is omitted, the local system is added as the target platform. You may use the 'local' alias to indicate the local platform. Multiple platforms may be specified.
The ARCH component may specify a CPU instance to tune for. The CPU setting is used in a -DCPU=VALUE compiler define. For example: "-platform linux-arm:arm7tdmi-debug".
NOTE: the platform switch is not a typical configure --host argument. i.e. The second component is a system architecture and not a distribution name.
|--without all||Disable all non-essential possible packages.|
|--set tune=MODE||Tune the build to optimize for "size", "speed". You can also select "balanced" for a balance between speed and size. (Default is size).|
|--with PACKAGE[=dir]||Specify if a PACKAGE should be included in the build. The optional directory is the path to the source distribution of the package. If the directory is omitted, me will search the local system for the package in well known places.|
|--without PACKAGE||Do not include the PACKAGE in the build.|
configure --with openssl=/usr/src/openssl
Building with MakeMe
After configuring, you may proceed to build the source code by typing:
For a list of the available packages on your system that can be selected via configure, run
This will display the MakeMe command options followed by a list of configurable features and components.
When cross compiling, certain environment variables may be passed to the configure script and on to me to configure the compiler and linker paths and flags. See more details below in the Cross Compiling section.
|AR||Path to the archiver program to use to archive libraries for the target system.|
|CC||Path to the C/C++ compiler to use to compile for the target system.|
|CFLAGS||Compiler control flags.|
|DFLAGS||Compiler preprocessor defines.|
|IFLAGS||Include directory options.|
|LD||Path to the linker program to link objects for the target system.|
|LDFLAGS||Linker flags. E.g. -Ldir to specify a non-standard directory for libraries.|
|VSINSTALLDIR||Directory to the version of Visual Studio to use. By default, MakeMe will use the most recent installed version.|
|WIND_BASE||Directory to the version of WindRiver VxWorks. By default, MakeMe will use the most recent installed version of the same architecture as specified platform architecture.|
Here are some useful configure command options.
To configure to build with the ccarm compiler.
To configure for building outside a source tree. This supports building from source from a read-only file system.
configure --configure /path/to/source
To configure for a debug build with debug symbols:
To configure without TLS/SSL:
configure --without ssl
To configure using OpenSSL from a specific source location:
configure --with openssl=/path/to/openssl-source
To configure to build for 32-bit X86 (when on a 64-bit system):
configure --platform linux-x86-debug
To display all configure options, use configure --help. This is the example output for the Appweb product.
Useful MakeMe options and targets
Here are some useful MakeMe examples:
me --show # Show actual commands while building me --why # Show why each target is or is not being built me dump # Dump the combined MakeMe configuration in one file me rebuild # Rebuild all targets me clean # Clean all built targets me rebuild # Rebuild all targets me install # Install the built software locally me help # Show MakeMe usage
On some platforms, it may be necessary to statically link the software. The default MakeMe configuration will build using shared libraries. This is so that software can dynamically load modules at run-time. It is generally recommended that you use dynamic linking, however, if you must statically link, run configure with the --static option and then rebuild.
configure --static me
You can install the newly built software via me:
sudo me install
You can remove by:
sudo me uninstall
To build a product for platform different to that of the local system is called cross compiling. Sometimes this 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.
MakeMe supports cross compiling via the configure -platform PLATFORM option. This adds a platform to the list of platforms to be made. Multiple platforms may be specified and the 'local' platform alias may be used for the local development platform.
Specifying the Target Platform
A platform specification is of the form OS-ARCH-PROFILE, where the supported operating systems are: freebsd, linux, macosx, vxworks and windows. The ARCH field is one of arm, mips, ppc, x64 or x86. X64 is the AMD/Intel 64-bit instruction set and x86 is the Intel X86 Pentium instruction set. You may also use i386 or i686 for specific Intel X86 instruction sets.
The ARCH componenty may contain a specific CPU to tune for. This is specified as a :CPU suffix to the ARCH field. Some operating systems such as VxWorks, require a CPU specifier. For example:
me --platform vxworks-arm:arm7tdmi-debug -configure .
This will create a vxworks-arm/platform.me configuration file and a start.me that references it. The platform switch does not need to be restated after configuration and will be ignored.
Note the configuration options apply to the preceding platform. If no preceding platform, the option applies to the local platform. For example:
configure -with ejscript -platform linux-arm-debug -without ejscript
This will build with the Ejscript package for the local development system, and without Ejscript for the target.
Building 32-bit Applications
Some products require local building to make the tools that are required to build for a target platform. These products add a "platforms: ['local']" property to their settings collection in the main.me 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.
If your local system can execute binaries for the specified platform, MakeMe will suppress adding an extra pass for the local system. For example: if you want to build a Windows 32-bit application on a Windows 64-bit system, you can specify --platform windows-x86. MakeMe will realize that your system can also execute 32-bit binaries and will suppress also building for 64-bit.
When compiling, you may need to inform configure about your cross-compilation tool chain and where it is located. MakeMe will do its best to discover the installed SDKs and cross tool chain and will look in well known directories to locate the compiler, linker, libraries and other required tools. If MakeMe cannot locate the tool chain, you can supply the tool chain details via environment variables.
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 configure
Note that on Unix systems, the compiler is used for linking.
Here is a cross-compilation configure command line to create a debug build for Linux on ARM7 using a specific compiler version.
CC=/opt/bin/cc.exe \ CFLAGS=-I/opt/include \ ./configure --debug --platform linux-arm:arm7tdi-debug
Specifying Compiler and SDK Versions
By default, MakeMe will use the latest version of a compiler to build an application. However, when building for Windows or VxWorks, you can force MakeMe to use a specific version of Visual Studio or VxWorks by setting the VSINSTALLDIR and WIND_BASE environment variables.
For example: if you have Visual Studio 2013 (12) and Visual Studio 2015 (14) installed, you can force MakeMe to build with Visual Studio 2013 by setting the VSINSTALLDIR environment variable. This is most easily done by running the Visual Studio vcvarsall.bat script supplied with Visual Studio.
"c:\Program Files (x86)\Microsoft Visual Studio 12.0 VC\vcvarsall.bat" x86 configure make
If building Windows using Cygwin, you can pass the VSINSTALLDIR variable directly into configure.
VSINSTALLDIR="c:/Program Files/Microsoft Visual Studio 12.0" ./configure
Before building for VxWorks, you must define the WIND environment variables via the WindRiver wrenv.sh script provided with VxWorks. This defines the WIND_BASE, WIND_HOST_TYPE and other required environment variables.
The command below runs wrenv.sh and defines the WIND variables in the current shell's environment.
eval `/path/to/WindRiver/wrenv.sh -p vxworks-6.8 -o print_env -f sh`
Once defined, you can invoke configure.
configure --platform vxworks-x86
Create an Installable Release
After building, MakeMe can create installable packages of the software:
The release packages are placed under the build/*/img directory.
If you are embedding into another application or installing to a target device, you can deploy the required software files to a staging directory.
me --sets core,lib deploy /tmp/deployed
This will copy the core and library files to the deploy directory under the platform output directory.