To start, the environment must supply two variables: TARGET and UCR. UCR is a pointer to the root of the uCR tree-the directory that contains make/ and include/ and $TARGET/lib, etc. Rules files use the UCR variable to locate header files for C, C++ and make.
The TARGET variable specifies one of the supported targets, i.e. i960_cyclone or i960_ise. The makefile headers use TARGET to select compilers, libraries and memory models. uCR understands specific TARGET strings, reflecting supported devices.
The following example makefile demonstrates many of the interesting features of the uCR build environment:
include \$(UCR)/make/rules.mk TARG := file.exe OBJ := main.o LIBS := -lchips -li960 MODEL := dram.ld include \$(UCR)/make/image.mk
This makefile, along with the proper definitions of UCR and TARGET, provide all the information needed to build an executable image. Much of the magic of figuring out how to build things come from the included make files rules.mk and image.mk.