Class: Canoe::CanoeMakefile

Inherits:
Object
  • Object
show all
Includes:
WorkSpaceUtil
Defined in:
lib/workspace/make.rb

Overview

CanoeMakefile is used to offer makefile generation utilities

Instance Method Summary collapse

Methods included from WorkSpaceUtil

#comp_to_obj, #current_workspace, #extract_one_file, #extract_one_file_obj, #file_to_obj, #src_to_obj

Constructor Details

#initialize(workspace) ⇒ CanoeMakefile

Returns a new instance of CanoeMakefile.



7
8
9
10
11
12
13
14
15
# File 'lib/workspace/make.rb', line 7

def initialize(workspace)
  @workspace = workspace
  @all_names = []
  @common_variables = {}
  @src_variables = {}
  @hdr_variables = {}
  @obj_variables = {}
  @config = {}
end

Instance Method Details

#configure(config) ⇒ Object



17
18
19
# File 'lib/workspace/make.rb', line 17

def configure(config)
  @config = config
end

#make!(deps) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/workspace/make.rb', line 21

def make!(deps)
  File.open('Makefile', 'w') do |f|
    if cxx?(get_compiler)
      make_cxx(f, deps)
    else
      make_c(f, deps)
    end
  end
end