next up previous contents
Next: Compilation rules Up: Compiling uCR Programs Previous: Makefiles and Environments

Header Files for ``make''

The rules.mk file includes all the rules needed to make object files out of source files, whether the source is C, C++ or assembler. It also defines some target-specific symbols (by including a target-specific .mk file) default CFLAGS and default CXXFLAGS. It also defines the make variable OBJD to be used in path names for locating libraries and object files. This will be discussed later. The rules.mk file does not say how to create the final target file from the object files.

The image.mk file contains rules for making a loadable image from the object files. It expects the variables TARG, OBJ, LIBS and MODEL to be defined before it is included. The product of the image.mk file is the rules needed to make $TARG, a fully linked COFF image ready to be loaded into the target hardware. It also creates a .map file that shows how everything was allocated in memory.

The MODEL is the most interesting variable, as it is used to select a linker script. The linker scripts are located in $UCR/$OBJD/lib/*.ld and tell the linker where libraries are, how special symbols are allocated and where the C/C++ runtime files live.


next up previous contents
Next: Compilation rules Up: Compiling uCR Programs Previous: Makefiles and Environments
Stephen Williams
9/2/1997