
SGX Embedded Systems DDK for the Linux kernel.
Copyright (C) Imagination Technologies Ltd. All rights reserved.
======================================================================

This file covers how to build and install the Imagination Technologies
SGX DDK for the Linux kernel.


Build System Environment Variables
-------------------------------------------

The SGX DDK Build scripts depend on a number of environment variables
being setup before compilation or installation of DDK software can
commence:

$DISCIMAGE
The DDK Build scripts install files to the location specified by the
DISCIMAGE environment variable, when the make install target is used.
This should point to the target filesystem.
$ export DISCIMAGE=/path/to/filesystem

$KERNELDIR
When building the SGX DDK kernel module, the build needs access
to the headers of the Linux kernel
$ export KERNELDIR=/path/to/kernel

$PATH
If a cross compiler is being used make sure the PATH environment variable
includes the path to the toolchain
$ export PATH=$PATH:/path/to/toolchain

$CROSS_COMPILE
Since the SGX DDK Build scripts are geared toward a cross-compilation
workflow, the CROSS_COMPILE environment variable needs to be set
$ export CROSS_COMPILE=toolchain-prefix-


Build and Install Instructions
-------------------------------------------

The SGX DDK configures different target builds within directories under
eurasiacon/build/linux/.

The supported build targets are:

	all		Makes everything
	clean	Removes all intermediate files created by a build.
	clobber	Removes all binaries for all builds as well.
	install	Runs the install script generated by the build.

The following variables may be set on the command line to influence a build.

	BUILD	The type of build being performed.
			Alternatives are release, timing or debug.
	CFLAGS	Build dependent	optimisations and debug information flags.
	SILENT	Determines whether text of commands is produced during build.

To build for, change to the appropriate target directory, e.g.:
$ cd eurasiacon/build/linux/platform/kbuild

Issue the make command:
$ make BUILD=debug all

The DDK software must be installed by the root user.  Become the root user:
$ su

Install the DDK software:
$ make install

Become an ordinary user again:
$ exit
