Method: Comet::Rules::Build#contents

Defined in:
lib/comet/rules/build.rb

#contentsObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/comet/rules/build.rb', line 15

def contents
  contents = [
    ".PHONY: #{target}",
    "#{target}: #{rules.map(&:target).uniq.join ' '}"
  ]

  if fw_target.elf?
    contents.push "\t$(COMET_CP) #{link.target} #{fw_target.elf_output.path}"
  end

  if fw_target.bin?
    contents.push "\t$(COMET_CP) #{bin.target} #{fw_target.bin_output.path}"
  end

  if fw_target.hex?
    contents.push "\t$(COMET_CP) #{hex.target} #{fw_target.hex_output.path}"
  end

  if fw_target.map?
    contents.push "\t$(COMET_CP) #{link.map_file} #{fw_target.map_output.path}"
  end

  contents
end