Sha256: 18dbea7455e9e379ba96187d7e0ab32ebcdc2a600d5c085562a96ad06596fdd4
Contents?: true
Size: 1000 Bytes
Versions: 1
Compression:
Stored size: 1000 Bytes
Contents
require 'erb' class Makefile class << self # build the sketch Makefile for the given template based on the values in its software and hardware config files def compose_for_sketch(sketch_name) params = hardware_params.merge software_params params['target'] = sketch_name params['asm_files'] = Dir.entries( File.expand_path(RAD_ROOT) + "/" + PROJECT_DIR_NAME ).select{|e| e =~ /\.S/} e = ERB.new File.read("#{File.dirname(__FILE__)}/makefile.erb") File.open("#{RAD_ROOT}/#{sketch_name}/Makefile", "w") do |f| f << e.result(binding) end end def hardware_params return @hardware_params if @hardware_params return @hardware_params = YAML.load_file( "#{RAD_ROOT}/config/hardware.yml") end def software_params return @software_params if @software_params return @software_params = YAML.load_file( "#{RAD_ROOT}/config/software.yml" ) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rad-0.2.0 | lib/rad/generators/makefile/makefile.rb |