Class: Rake::MakefileLoader
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
|
|
Inherits: | Object |
Defined in: | lib/rake/loaders/makefile.rb |
Overview
Makefile loader to be used with the import file loader. Use this to import dependencies from make dependency tools:
require 'rake/loaders/makefile'
file ".depends.mf" => [SRC_LIST] do |t|
sh "makedepend -f- -- #{CFLAGS} -- #{t.prerequisites} > #{t.name}"
end
import ".depends.mf"
See Importing Dependencies
for further details.
Constant Summary
-
SPACE_MARK =
Internal use only
# File 'lib/rake/loaders/makefile.rb', line 21"\0"
::FileUtils - Included
FileUtilsExt - Included
Instance Method Summary
-
#load(fn)
Internal use only
Load the makefile dependencies in
fn
. -
#process_line(line)
private
Internal use only
Process one logical line of makefile data.
- #respace(str) private Internal use only
DSL - Included
#desc | Describes the next rake task. |
#directory | Declare a set of files tasks to create the given directories on demand. |
#file | Declare a file task. |
#file_create | Declare a file creation task. |
#import | Import the partial Rakefiles |
#multitask | Declare a task that performs its prerequisites in parallel. |
#namespace | Create a new rake namespace and use it for evaluating the given block. |
#rule | Declare a rule for auto-tasks. |
#task | Declare a basic task. |
FileUtilsExt - Included
#nowrite | Get/set the nowrite flag controlling output from the ::FileUtils utilities. |
#rake_check_options | Check that the options do not contain options not listed in |
#rake_merge_option | Merge the given options with the default values. |
#rake_output_message | Send the message to the default rake output (which is $stderr). |
#verbose | Get/set the verbose flag controlling output from the ::FileUtils utilities. |
#when_writing | Use this function to prevent potentially destructive ruby code from running when the |
::FileUtils - Included
#ruby | Run a Ruby interpreter with the given arguments. |
#safe_ln | Attempt to do a normal file link, but fall back to a copy if the link fails. |
#sh | Run the system command |
#split_all | Split a file path into individual directory names. |
#create_shell_runner, #set_verbose_option, #sh_show_command |
Instance Method Details
#load(fn)
Load the makefile dependencies in fn
.
# File 'lib/rake/loaders/makefile.rb', line 24
def load(fn) # :nodoc: lines = File.read fn lines.gsub!(/\\ /, SPACE_MARK) lines.gsub!(/#[^\n]*\n/m, "") lines.gsub!(/\\\n/, " ") lines.each_line do |line| process_line(line) end end
#process_line(line) (private)
Process one logical line of makefile data.
#respace(str) (private)
# File 'lib/rake/loaders/makefile.rb', line 47
def respace(str) # :nodoc: str.tr SPACE_MARK, " " end