summaryrefslogtreecommitdiff
path: root/lib/rake/loaders/makefile.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-04 12:31:31 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-04 12:31:31 +0000
commitc4ee0df8ba2cf7cc6aaa785c8df20a91b1719021 (patch)
tree06beca468cce4a75a3e9890d18aa001ef2c41e54 /lib/rake/loaders/makefile.rb
parent8c0b2a286080609613b6b007e030ff7c7adaa23c (diff)
* lib/rake/*: Gemify rake [fix GH-862][Feature #11025]
* test/rake/*: ditto. * tool/rbinstall.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rake/loaders/makefile.rb')
-rw-r--r--lib/rake/loaders/makefile.rb40
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/rake/loaders/makefile.rb b/lib/rake/loaders/makefile.rb
deleted file mode 100644
index 4ece4323af8..00000000000
--- a/lib/rake/loaders/makefile.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-module Rake
-
- # Makefile loader to be used with the import file loader.
- class MakefileLoader
- include Rake::DSL
-
- SPACE_MARK = "\0"
-
- # Load the makefile dependencies in +fn+.
- def load(fn)
- 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
-
- private
-
- # Process one logical line of makefile data.
- def process_line(line)
- file_tasks, args = line.split(':', 2)
- return if args.nil?
- dependents = args.split.map { |d| respace(d) }
- file_tasks.scan(/\S+/) do |file_task|
- file_task = respace(file_task)
- file file_task => dependents
- end
- end
-
- def respace(str)
- str.tr SPACE_MARK, ' '
- end
- end
-
- # Install the handler
- Rake.application.add_loader('mf', MakefileLoader.new)
-end