Class: MTBuild::MakefileLoader

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

Overview

Makefile loader to be used with the import file loader.

Constant Summary collapse

SPACE_MARK =
"\0"

Instance Method Summary collapse

Methods included from Rake::DSL

#application_task, #framework_task, #static_library_task, #test_application_task

Instance Method Details

#load(fn) ⇒ Object

Load the makefile dependencies in fn.



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

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