   # Build the source tree
   setRootPath: (p) ->
     @sourcePath = path.join p, 'src'
-    @compilePath = path.join p, 'tmp/compiled'
+    @tmpPath = path.join p, 'tmp'
     @outputPath = path.join p, 'build'
   build: (version) ->
     version = @defaultVersion unless version?

    throw "#{version} is not a valid version name" unless @versions[version]?
    # Create new files when required
    targets = []
    for f, conf of @generateCompileConfigTree(version)
      sourceFile = path.join @sourcePath, f
      targetFile = path.join @compilePath, version, conf.targetFile(f)
      targets.push targetFile unless conf.ignore is true
      unless conf.ignore
        if not path.existsSync(targetFile) or fs.statSync(targetFile).mtime <
        fs.statSync(sourceFile).mtime
          mkdirp.sync path.dirname(targetFile)
          if conf.compile
            console.log "Compiling #{f}..."

          cfPath = path.join cvPath, cf
          throw "Cannot find compiled file #{cf}" unless path.existsSync cfPath
          matchedFiles.push cfPath
          matchedFileHashes.push @getFileHash(cfPath)
          builtFiles.push cf
      buildFileExists = path.existsSync bfPath
      if buildFileExists and matchedFiles.length is 0
        console.log "Removing #{bf}..."
        fs.unlinkSync bfPath
      else if matchedFiles.length > 0
        newMatchedFilesHash = @getHash matchedFileHashes.join()
        unless path.existsSync(bfPath) and
        buildFileHashes[bfPath] is newMatchedFilesHash
          console.log "Building #{bf}..."
          mkdirp.sync path.dirname(bfPath)
          bfFile = fs.openSync bfPath, 'w'
          for mf in matchedFiles
            fs.writeSync(bfFile, fs.readFileSync(mf, 'utf8'), null)
          buildFileHashes[bfPath] = newMatchedFilesHash
          @saveDatabase version, @buildFileHashDb, buildFileHashes
      compiledFiles.push bf
    # Move files to build dir
    copyFileHashes = @loadDatabase version, @copyFileHashDb
    ovPath = path.join(@outputPath, version)
    mkdirp.sync ovPath
    buildFileNames = _.keys @files
    walkdir.sync cvPath, (f, stat) =>
      return if stat.isDirectory()
      f = path.relative(cvPath, f)
      outf = path.join ovPath, f
      if builtFiles.indexOf(f) is -1 or buildFileNames.indexOf(f) isnt -1
        compf = path.join cvPath, f
        compfHash = @getFileHash compf
        unless path.existsSync(outf) and
        copyFileHashes[compf] is compfHash
          # Copy
          console.log "Outputting #{f}..."
          mkdirp.sync path.dirname(outf)
          fs.writeFileSync outf, fs.readFileSync(compf)
          copyFileHashes[compf] = compfHash
          @saveDatabase version, @copyFileHashDb, copyFileHashes          
      else if path.existsSync(outf)
        console.log "Removing orphaned file #{f}..."
        fs.unlinkSync outf
