Class: Comet::Rules::ObjCopy

Inherits:
Object
  • Object
show all
Defined in:
lib/comet/rules/objcopy.rb

Instance Method Summary collapse

Constructor Details

#initialize(linker, elf, format, extension) ⇒ ObjCopy

Returns a new instance of ObjCopy.



4
5
6
7
8
9
# File 'lib/comet/rules/objcopy.rb', line 4

def initialize(linker, elf, format, extension)
  @linker = linker
  @elf = elf
  @format = format
  @extension = extension
end

Instance Method Details

#commandsObject



30
31
32
# File 'lib/comet/rules/objcopy.rb', line 30

def commands
  { COMET_OBJCOPY: 'objcopy' }
end

#contentsObject



19
20
21
22
23
24
# File 'lib/comet/rules/objcopy.rb', line 19

def contents
  [
    "#{target}: #{@elf.target} | #{Comet::TMPDIR}",
    "\t#{objcopy}"
  ]
end

#rulesObject



26
27
28
# File 'lib/comet/rules/objcopy.rb', line 26

def rules
  [@elf]
end

#targetObject



11
12
13
14
15
16
17
# File 'lib/comet/rules/objcopy.rb', line 11

def target
  @target ||= Comet::Makefile.fingerprint Hash[
    triple: @linker.triple,
    format: @format,
    elf: @elf.target
  ], extension: @extension
end