summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-19 02:36:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-19 02:36:25 +0000
commit1a6b07d71669658dcdb72d0937482aa6b9510e15 (patch)
tree8504bffdbb8834c531e0cb2246d8a44677f2a086 /ext/extmk.rb
parent0a6700fec25027188f01105d1fcaa96a9d4fe385 (diff)
ext/extmk.rb: fold long macro
* ext/extmk.rb (command_output): fold long macro lines. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 45c0afd..45fc9da 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -628,25 +628,25 @@ if $configure_only and $command_output
mf.puts "MFLAGS = -$(MAKEFLAGS)" if $nmake
mf.puts
- mf.print "extensions ="
- w = 12
- exts.each do |d|
- if d.size + w > 70
- mf.print " \\\n\t "
- w = 12
+ def mf.macro(name, values, max = 70)
+ print name, " ="
+ w = w0 = name.size + 2
+ h = " \\\n" + "\t" * (w / 8) + " " * (w % 8)
+ values.each do |s|
+ if s.size + w > max
+ print h
+ w = w0
+ end
+ print " ", s
+ w += s.size + 1
end
- mf.print " #{d}"
- w += d.size + 1
+ puts
end
- mf.puts
- if !$extlist.empty?
- mf.puts "EXTOBJS = ext/extinit.#{$OBJEXT} #{$extobjs.join(' ')}"
- mf.puts "EXTLIBS = #{$extlibs.join(' ')}"
- else
- mf.puts "EXTOBJS = "
- mf.puts "EXTLIBS = "
- end
- mf.puts "EXTLDFLAGS = #{$extflags}"
+
+ mf.macro "extensions", exts
+ mf.macro "EXTOBJS", $extlist.empty? ? [] : ["ext/extinit.#{$OBJEXT}", *$extobjs]
+ mf.macro "EXTLIBS", $extlibs
+ mf.macro "EXTLDFLAGS", $extflags.split
mf.puts
targets = %w[all install static install-so install-rb clean distclean realclean]
targets.each do |tgt|