6.3 Compilation for Multiple Systems

Within the Makefile in the .../src/ directory, L4DIR and PKGDIR and the supported systems are specified. Also, either prog.mk or lib.mk is included. During the make process, BID creates the system-specific subdirectories with Makefiles therein. Those Makefiles define the variables L4DIR, PKGDIR, SYSTEM, ARCH, CPU and L4API3. During compilation of C and C++ files, the preprocessor macros SYSTEM_$(SYSTEM), ARCH_$(ARCH), CPUTYPE_$(CPU) and L4API_$(L4API) will be defined. The generated Makefiles also include either the original Makefile in the upper directory or alternatively a separate file Make.rules if it exists within the upper directory.

Having that separate Make.rules file might be useful, as otherwise all definitions have to be done in that one Makefile. Note, that this Makefile is interpreted in the src/ directory and in the system-specific subdirectories. To prevent trouble, you can write all the declarations meant for the src/ directory in the Makefile (this are L4DIR, PKGDIR and the systems normally). All declarations for generating the targets and controlling the actual build process for one system in Make.rules. Make.rules will only be interpreted within the subdirectories.

If immediate evaluation of variables defined in the role-files is needed (e.g., to define rules), $(L4DIR)/mk/*.mk can be included in Make.rules. It is ensured, that the same role-file will only be included once. If no role-file is included explicitly, it will be automatically included after including Make.rules.

L4 Checker 2012-04-11