summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-01 09:29:14 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-01 09:29:14 +0000
commit5cae104e51be9cbf524b7d953b33d0909c46d006 (patch)
tree9446c66de917d4eb375dfc80e970f14fa5d8f660 /ext/extmk.rb
parentd1f8694171eed1544a8cc7c29ede155679efa0ca (diff)
Let sub-directory exts depend on their parent ext
* ext/extmk.rb: Let sub-directory exts depend on their parent ext. * template/exts.mk.tmpl: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index c5b4151..1389dc4 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -722,7 +722,16 @@ begin
end
targets.each do |tgt|
exts.each do |d|
- mf.puts "#{d[0..-2]}#{tgt}:\n\t$(Q)#{submake} $(MFLAGS) V=$(V) $(@F)"
+ d = d[0..-2]
+ t = "#{d}#{tgt}"
+ if /^(dist|real)?clean$/ =~ tgt
+ deps = exts.select {|e|e.start_with?(d)}.map {|e|"#{e[0..-2]}#{tgt}"} - [t]
+ pd = ' ' + deps.join(' ') unless deps.empty?
+ else
+ pext = File.dirname(d)
+ pd = " #{pext}/#{tgt}" if exts.include?("#{pext}/.")
+ end
+ mf.puts "#{t}:#{pd}\n\t$(Q)#{submake} $(MFLAGS) V=$(V) $(@F)"
end
end
mf.puts "\n""extso:\n"