Class: Comet::Rules::Compile
- Inherits:
-
Object
- Object
- Comet::Rules::Compile
- Defined in:
- lib/comet/rules/compile.rb
Instance Method Summary collapse
- #commands ⇒ Object
- #contents ⇒ Object
-
#initialize(source, file, linker) ⇒ Compile
constructor
A new instance of Compile.
- #rules ⇒ Object
- #target ⇒ Object
Constructor Details
#initialize(source, file, linker) ⇒ Compile
Returns a new instance of Compile.
4 5 6 7 8 |
# File 'lib/comet/rules/compile.rb', line 4 def initialize(source, file, linker) @source = source @file = file @linker = linker end |
Instance Method Details
#commands ⇒ Object
34 35 36 |
# File 'lib/comet/rules/compile.rb', line 34 def commands { COMET_CC: 'clang' } end |
#contents ⇒ Object
23 24 25 26 27 28 |
# File 'lib/comet/rules/compile.rb', line 23 def contents [ "#{target}: #{@file} #{dependencies.join ' '} | #{Comet::TMPDIR}", "\t#{clang_compile} #{formatted_flags.join ' '} -o $@ -c $<" ] end |
#rules ⇒ Object
30 31 32 |
# File 'lib/comet/rules/compile.rb', line 30 def rules [] end |
#target ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/comet/rules/compile.rb', line 10 def target @target ||= Comet::Makefile.fingerprint Hash[ file: @file, triple: @linker.triple, isa: @linker.isa, cpu: @linker.cpu, language: @source.language, flags: Set[formatted_flags], headers: formatted_headers, dependencies: Set[dependencies] ], extension: :ll end |