       return (options as NSString)
         .componentsSeparatedByCharactersInSet(WhitespaceCharacterSet)
         .map { $0 as! String }
+        .map { self.formatCompilerOption($0) }
     } else {
       return [String]()
     }
   }
 
+  private func formatCompilerOption(option: String) -> String {
+    return option
+      .stringByReplacingOccurrencesOfString("{root}", withString: rootDirectory)
+  }
+
 }


  private func runPrecompileCommands() {
    let commands = package.roostfile.precompileCommands

    for command in commands {
      let task = Task("/bin/sh")
      task.arguments = ["-c", command]

      task.launchAndWait()

      if task.hasAnyOutput() {

class Builder {

  var package: Package
  var rootDirectory: String
  var buildDirectory: String
  var binDirectory: String

