6.4 Specifying the Systems to build

So far, we described how to build multiple systems. No, we describe how to specify the systems a packet can build.

Each source directory of a package specifies the target systems this directory can be built for. The target systems are defined as a list within the parameter SYSTEMS in the Makefile of that source directory. The systems listed in SYSTEMS may have a CPU component, but it can also be empty. The L4API in SYSTEMS is optional too.

The user that compiles its L4-tree specifies the systems he wants to build. Therefore he sets the variable BUILD_SYSTEMS, e.g. using the global Makeconf.bid.local (see Section 3). The systems listed in BUILD_SYSTEMS always have an L4API component. The user may specify a specific CPU for optimization purposes within the CPU component. He may even list the same CPU architecture/L4API combination multiple times, each time with a different CPU type, e.g., x86_386-v2 x86_586-v2 x86_K7-v2.

Within a source directory, the matching systems are built: A system matches, if it can be found in both variables SYSTEMS and BUILD_SYSTEMS. If that directory requires no specific L4 binding (no L4API part within SYSTEMS), the L4API parts in BUILD_SYSTEMS are ignored. The CPU parts in BUILD_SYSTEMS are always ignored for matching, but if a match is found, they become part of the matching system. More formal:

From each item sys specified in BUILD_SYSTEMS the CPU component is removed. Then, each (shortened) item sys is matched against the list in SYSTEMS. If an element i of SYSTEMS can be found as a substring within sys, i is added to the intersection list. If the original value of sys had a CPU component, this CPU component is added to i as well.

Some packages built code for multiple systems and use an IDL compiler to generate the communication stubs. The systems these packets can be built for depend mainly on the IDL compiler. To avoid to change all the Makefile of those packages if the IDL compiler supports more systems, the variable IDL_SYSTEMS contains all the systems our default IDL compiler dice[2] can generate code for. A Makefile can use SYSTEMS=$(IDL_SYSTEMS) to automatically build for all systems that are supported by dice.

Note that when compiling files in the OBJ-* subdirectories, the contents of $(SYSTEM) can not necessarily be found in the $(SYSTEMS) variable of the original Makefile, e.g. due to the added $(ARCH) component. To help writing system-specific makefiles, the make variable $(OSYSTEM) is defined by the generated makefile. It contains that part of the $(SYSTEMS) variable in the Makefile that corresponds to the current $(SYSTEM). Note,

L4 Checker 2012-04-11