Class: PaperHouse::ExecutableTask

Inherits:
BuildTask
  • Object
show all
Includes:
LinkerOptions
Defined in:
lib/paper_house/executable_task.rb

Overview

Compiles *.c files into an executable file.

Instance Attribute Summary collapse

Attributes included from LinkerOptions

#ldflags

Attributes inherited from BuildTask

#cc, #name, #target_directory

Attributes included from CcOptions

#cflags, #includes, #sources

Instance Method Summary collapse

Methods included from LinkerOptions

#library_dependencies, #library_dependencies=

Methods inherited from BuildTask

#target_path

Constructor Details

#initialize(name) {|task| ... } ⇒ ExecutableTask

Defines a rake task called name that builds an executable. Several task attributes can be set in the block.

Examples:

PaperHouse::ExecutableTask.new :hello do |task|
  task.executable_name = 'hello'
  task.target_directory = 'objects'
  task.sources = 'sources/*.c'
  task.includes = 'includes'
  task.cflags = %w(-Wall -Wextra)
end

Yields:

  • (task)


27
28
29
30
31
32
# File 'lib/paper_house/executable_task.rb', line 27

def initialize(name, &block)
  super name, &block
  Rake::Task[name].prerequisites.each do |each|
    find_prerequisites each, [StaticLibraryTask, SharedLibraryTask]
  end
end

Instance Attribute Details

#executable_nameObject Also known as: target_file_name

Name of target executable file.



36
# File 'lib/paper_house/executable_task.rb', line 36

attr_writer :executable_name