Class: Rake::MakefileLoader

Inherits:
Object
  • Object
show all
Includes:
DSL
Defined in:
lib/rake/loaders/makefile.rb

Overview

Makefile loader to be used with the import file loader.

Constant Summary collapse

SPACE_MARK =
"\0"

Constants included from FileUtilsExt

FileUtilsExt::DEFAULT

Constants included from FileUtils

FileUtils::LN_SUPPORTED, FileUtils::RUBY

Instance Method Summary collapse

Methods included from FileUtilsExt

#nowrite, #rake_check_options, #rake_merge_option, #rake_output_message, #verbose, #when_writing

Methods included from FileUtils

#ruby, #safe_ln, #sh, #split_all

Instance Method Details

#load(fn) ⇒ Object

Load the makefile dependencies in fn.


10
11
12
13
14
15
16
17
18
# File 'lib/rake/loaders/makefile.rb', line 10

def load(fn)
  lines = File.read fn
  lines.gsub!(/\\ /, SPACE_MARK)
  lines.gsub!(/#[^\n]*\n/m, "")
  lines.gsub!(/\\\n/, ' ')
  lines.each_line do |line|
    process_line(line)
  end
end