Clean extension build directories and exts.mk file
This commit is contained in:
parent
be65cf5325
commit
dc1c4e4675
Notes:
git
2022-11-16 09:43:15 +00:00
10
ext/extmk.rb
10
ext/extmk.rb
@ -722,6 +722,7 @@ begin
|
|||||||
mf.puts "ECHO = $(ECHO1:0=@echo)"
|
mf.puts "ECHO = $(ECHO1:0=@echo)"
|
||||||
mf.puts "MFLAGS = -$(MAKEFLAGS)" if $nmake
|
mf.puts "MFLAGS = -$(MAKEFLAGS)" if $nmake
|
||||||
mf.puts "override MFLAGS := $(filter-out -j%,$(MFLAGS))" if $gnumake
|
mf.puts "override MFLAGS := $(filter-out -j%,$(MFLAGS))" if $gnumake
|
||||||
|
mf.puts "ext_build_dir = #{File.dirname($command_output)}"
|
||||||
mf.puts
|
mf.puts
|
||||||
|
|
||||||
def mf.macro(name, values, max = 70)
|
def mf.macro(name, values, max = 70)
|
||||||
@ -764,6 +765,7 @@ begin
|
|||||||
mf.macro "SUBMAKEOPTS", submakeopts
|
mf.macro "SUBMAKEOPTS", submakeopts
|
||||||
mf.macro "NOTE_MESG", %w[$(RUBY) $(top_srcdir)/tool/lib/colorize.rb skip]
|
mf.macro "NOTE_MESG", %w[$(RUBY) $(top_srcdir)/tool/lib/colorize.rb skip]
|
||||||
mf.macro "NOTE_NAME", %w[$(RUBY) $(top_srcdir)/tool/lib/colorize.rb fail]
|
mf.macro "NOTE_NAME", %w[$(RUBY) $(top_srcdir)/tool/lib/colorize.rb fail]
|
||||||
|
%w[RM RMDIRS RMDIR RMALL].each {|w| mf.macro w, [RbConfig::CONFIG[w]]}
|
||||||
mf.puts
|
mf.puts
|
||||||
targets = %w[all install static install-so install-rb clean distclean realclean]
|
targets = %w[all install static install-so install-rb clean distclean realclean]
|
||||||
targets.each do |tgt|
|
targets.each do |tgt|
|
||||||
@ -798,16 +800,20 @@ begin
|
|||||||
exts.each do |d|
|
exts.each do |d|
|
||||||
d = d[0..-2]
|
d = d[0..-2]
|
||||||
t = "#{d}#{tgt}"
|
t = "#{d}#{tgt}"
|
||||||
if /^(dist|real)?clean$/ =~ tgt
|
if clean = /^(dist|real)?clean$/.match(tgt)
|
||||||
deps = exts.select {|e|e.start_with?(d)}.map {|e|"#{e[0..-2]}#{tgt}"} - [t]
|
deps = exts.select {|e|e.start_with?(d)}.map {|e|"#{e[0..-2]}#{tgt}"} - [t]
|
||||||
pd = ' ' + deps.join(' ') unless deps.empty?
|
pd = [' clean-local', *deps].join(' ')
|
||||||
else
|
else
|
||||||
pext = File.dirname(d)
|
pext = File.dirname(d)
|
||||||
pd = " #{pext}/#{tgt}" if exts.include?("#{pext}/.")
|
pd = " #{pext}/#{tgt}" if exts.include?("#{pext}/.")
|
||||||
end
|
end
|
||||||
mf.puts "#{t}:#{pd}\n\t$(Q)#{submake} $(MFLAGS) V=$(V) $(@F)"
|
mf.puts "#{t}:#{pd}\n\t$(Q)#{submake} $(MFLAGS) V=$(V) $(@F)"
|
||||||
|
if clean and clean.begin(1)
|
||||||
|
mf.puts "\t$(Q)$(RM) $(ext_build_dir)/exts.mk\n\t$(Q)$(RMDIRS) -p $(@D)"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
mf.puts "\n""clean-local:\n\t$(Q)$(RM) $(ext_build_dir)/*~ $(ext_build_dir)/*.bak $(ext_build_dir)/core"
|
||||||
mf.puts "\n""extso:\n"
|
mf.puts "\n""extso:\n"
|
||||||
mf.puts "\t@echo EXTSO=$(EXTSO)"
|
mf.puts "\t@echo EXTSO=$(EXTSO)"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user