Embedthis MakeMe™ Overview
MakeMe is a modern replacement for the venerable make and the not so popular autoconf tool. It manages the building of programs and products by direct compilation and the generation of IDE projects and Makefiles. MakeMe can portably build programs for Linux, Mac and Windows and handles cross-compilation with ease.
MakeMe Command
MakeMe is run via the "me" command. So to build a project, just type:
me
Just like make you can build specific targets which MakeMe calls goals:
me clean me compile me myapp
A Simple MakeMe File
A MakeMe file is written in Javascript, though with a .me extension. It contains a set of build instructions expressed as a Javascript object literal. For example:
Me.load({ targets: { /* Build the rocket executable */ rocket: { type: 'exe', sources: '*.c', }, }, })
MakeMe files invoke Me.load to process build instructions. Arbitrary Javascript is permitted in MakeMe files, but typically, little script code is needed.
MakeMe files specify targets. These can be source files, libraries, executables or other actions to run. MakeMe has built-in rules to compile source code, build libraries, create executables, copy files, build packages and generate IDE projects. So, typically, you need to type very little to do the common tasks of building.
MakeMe files can intelligently inherit global settings for a project and can override or augment values locally. MakeMe files run with a current directory set to that of the '.me' file itself, so it can easily reference local resources. MakeMe projects are easy to relocate and avoid absolute directory references except for global tool chain programs and directories.
MakeMe also provides a "configure" capability where it searches for required and optional tools for building. MakeMe also supports cross-platform and cross-compilation building.
Why MakeMe?
Many projects rely on autoconf to configure products and 'make' to build. But autoconf is a baroque maze of scripts and make provides too little support for easily building executables and libraries in a cross platform manner. Further, neither of these tools work well for Windows and embedded platforms like VxWorks. Consequently, creating portable Makefiles and autoconf scripts that will work on a variety of platforms and support cross compilation is an exercise in patience. Often the result is slow, fragile build systems, especially on Windows.
MakeMe replaces both autoconf and make with a single utility. MakeMe provides a higher level of abstraction to easily specify the targets to build (libraries and executables) and can build directly on Linux, Mac OS X or Windows and cross compile for other platforms. It will generate native projects for Visual Studio, XCode, Make and Nmake projects. MakeMe builds fast without the complexity of autoconf and make.
History
MakeMe was initiated after evaluating Make, CMake and GYP for use by the Appweb and Ejscript projects in an embedded, cross compilation environment. While all three alternatives can be made to work, we (Embedthis) were expending too large a percentage of our time on the build system and less on the actual products. Out of this frustration, MakeMe was born. We do not expect MakeMe to be a universal replacement for Make or Autoconf for everyone, but for some users with needs similar to our own, it may be an excellent choice.
MakeMe Design Goals
When creating MakeMe, our design goals were:
- Create a build tool to be used by Embedthis for its own products
- Be portable across the major Unix platforms and Windows
- Easily manage cross-compilation and cross-compilers for embedded targets
- Generate native projects for IDE integration
- Build quickly, reliably and flexibly on windows without relying on Cygwin
- Support the entire build cycle: C dependencies, compilation, test and packaging
- Support the modular discovery, configuration and integration of tools and third-party plugins
- Be hackable and extendable and usable by all
MakeMe vs Make
Here is a quick list of differences between MakeMe and Make. These are broad, sweeping, and opinionated comments. Hopefully, with a grain of truth.
- Makefiles don't aggregate well. Make provides little support for combining makefiles. It offers bare facilities for inheriting and overriding project parameters in an orderly fashion. Large projects often use recursive makefiles, but these have many well documented issues. Trying to combine Makefiles from different products is typically not possible. MakeMe creates a single, unified view of how to build an entire product. The product may be comprised of many MakeMe files, but these are combined in a well-defined manner. Lower-level MakeMe files can inherit properties from upper levels and easily locally override settings as required.
- MakeMe is pre-programmed with default compiler and linker switches to achieve common tasks. With make, you have to add the switches yourself.
- MakeMe provides in-built understanding of how to build common targets like libraries and executables. With make, you have to specifically express the link command lines.
- Makefiles are often a mess. MakeMe files are terse and because MakeMe has a high-level understanding of how to build libraries and executables, you don't have to repeat common boiler-plate rules.
- Make and autoconf try to run on every possible Unix, but don't run on Windows (except for Cygwin which is too unreliable for production use). MakeMe supports the major Unix flavors: Linux, BSD and Mac OS X. But it also supports Windows with ease.
- Autoconf is incomprehensible. Just Google™ "hate autoconf". It is a mess of legacy shell scripts that try to address building on all possible systems. but Autoconf fails at building simply and well on the common platforms. MakeMe does not try to create the universal config.h header to mange obscure C compilers. It instead focuses on the dominant platforms. MakeMe provides an open, plugin framework for searching for components. This makes it easy to configure a build based on the components available on the target computer.
- MakeMe is fast — typically much faster than autoconf and make. Because it uses Ejscript internally, file copy and script commands can be executed without spawning a shell. This also means that you can have a uniform scripting environment on Windows.