Go to the Next or Previous section or the Detailed Contents.


3.2 Including Files

When a file is included its contents are copied in the current build file before it is processed. The copying is only temporary, both the build file and the included file are left untouched.

Including is useful if you have a number of build files that all need the same variables or share some fake targets.

To include a file the build file has to have the '#i' directive followed by the name of the file to include. For example,

#i /scripts/template

includes the file `/scripts/template' in the current build file. Let's say this file contains these symbol definitions:

COMPILER=E:bin/EC
TEMP_DIR=T:

The following build file includes these definitions and uses it:

#i /scripts/template

test: test.e
  $(COMPILER) $(dep)
  Copy $target TO $(TEMP_DIR)

EBuild takes everything it finds in the file you include, you could even include binary files. This is not recommended... let's just say the behaviour of EBuild is undefined in that case.

Since every file is included before processing the build file constants cannot be used in the file name. The following scheme may illustrate it:

  1. Parse the build file for any include directives and include the files.
  2. Process the build file line by line and substitute constants in rules.
  3. Build target if necessary and substitute constants in actions.


Go to the Next or Previous section or the Detailed Contents.