ruby-changes:53898
From: mrkn <ko1@a...>
Date: Sat, 1 Dec 2018 18:29:20 +0900 (JST)
Subject: [ruby-changes:53898] mrkn:r66117 (trunk): Let sub-directory exts depend on their parent ext
mrkn 2018-12-01 18:29:14 +0900 (Sat, 01 Dec 2018) New Revision: 66117 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66117 Log: 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. Modified files: trunk/ext/extmk.rb trunk/template/exts.mk.tmpl Index: template/exts.mk.tmpl =================================================================== --- template/exts.mk.tmpl (revision 66116) +++ template/exts.mk.tmpl (revision 66117) @@ -128,14 +128,25 @@ libencs: https://github.com/ruby/ruby/blob/trunk/template/exts.mk.tmpl#L128 ext/extinit.<%=objext%>: $(Q)$(MAKE)<%=mflags%> V=$(V) EXTINITS="$(EXTINITS)" $@ -% targets.product(macros["extensions"].map {|e|e.chomp("/.")}) do |t, e| -<%=e%>/<%=t%>: -% if /^(dist|real)clean$/ =~ t +% exts = macros["extensions"].map {|e|e.chomp("/.")}.sort +% targets.each do |tgt| +% exts.each do |d| +% t = "#{d}/#{tgt}" +% if /^(dist|real)?clean$/ =~ tgt +% deps = exts.select {|e|e.start_with?("#{d}/")}.map {|e|"#{e}/#{tgt}"} +% pd = ' ' + deps.join(' ') unless deps.empty? +% else +% pext = File.dirname(d) +% pd = " #{pext}/#{tgt}" if exts.include?(pext) +% end +<%=t%>:<%=pd%> +% if /^(dist|real)clean$/ =~ tgt $(ECHO) $(@F)ing $(@D) -% end +% end $(Q)<%= submake %><%=mflags%> V=$(V) $(@F) -% if /^(dist|real)clean$/ =~ t +% if /^(dist|real)clean$/ =~ tgt $(Q)$(RMDIRS) $(@D) +% end % end % end Index: ext/extmk.rb =================================================================== --- ext/extmk.rb (revision 66116) +++ ext/extmk.rb (revision 66117) @@ -722,7 +722,16 @@ begin https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L722 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" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/