     if extension is 'coffee'
       target = file.replace(/^src/, 'build/compiled').replace(/\.coffee$/, '.js')
     else
-      target = file.replace(/^src/, 'build/compiled')
+      target = file.replace /^src/, 'build/compiled'
+    # Ignore file if the compiled version is newer
+    return if path.existsSync(target) and fs.statSync(target).mtime >= fs.statSync(file).mtime
     # Generate contents if required
     if extension is 'coffee'
       console.log "Compiling #{file}..."

    else
      console.log "Copying #{file} to #{target}..."
      util.pump fs.createReadStream(file), fs.createWriteStream(target)

    # Write the file

  desc 'Remove a file from source'
  task 'remove', (file) ->

task 'make', ['compile', 'concat', 'minify']

desc 'Compile from source.'
task 'compile', ->
  console.log 'Compiling source...'
  # Traverse src tree to find old files
  findit.sync 'src', (file) ->
    jake.Task['compile:file'].reenable true
    jake.Task['compile:file'].invoke file
  # Traverse compile trees to prune orphaned files
  console.log 'Pruning orphaned files...'
  orphanedDirs = []
  findit.sync 'build/compiled', (file) ->
    searchPath = file.replace /^build\/compiled/, 'src'
    searchPathCoffee = searchPath.replace /\.js$/, '.coffee'
    return if path.existsSync(searchPath) or path.existsSync(searchPathCoffee)
    fileStats = fs.statSync file
    if fileStats.isFile()
      fs.unlinkSync file
    else if fileStats.isDirectory()
      # Collect directories to remove after files
      orphanedDirs.push file
  fs.rmdir dir for dir in orphanedDirs
  console.log 'Compiled source.'

namespace 'compile', ->
  desc 'Compile a file from source.'
