Class: Rake::MakefileLoader

Inherits:
Object show all
Defined in:
lib/ceedling/makefile.rb

Overview

Makefile loader to be used with the import file loader.

Instance Method Summary collapse

Instance Method Details

#load(fn) ⇒ Object

Load the makefile dependencies in fn.



19
20
21
22
23
24
25
26
27
28
# File 'lib/ceedling/makefile.rb', line 19

def load(fn)
  open(fn) do |mf|
    lines = mf.read
    lines.gsub!(/#[^\n]*\n/m, "") # remove comments
    lines.gsub!(/\\\n/, ' ')      # string together line continuations into single line
    lines.split("\n").each do |line|
      process_line(line)
    end
  end
end