summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-08 17:28:29 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-12-05 17:09:49 +0900
commitfacb5cd4d5405dafabe0bd150f5dc56dc73aa96a (patch)
tree59029775d8c3fe8281246e4c4027820504561c2b /lib
parentf64718cb3211f0fabecd5a898f209eed2be9014b (diff)
Clean compiler intermediate files more
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index fba1e678c7..e94733c635 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -2378,11 +2378,18 @@ TIMESTAMP_DIR = #{$extout && $extmk ? '$(extout)/.timestamp' : '.'}
install_dirs.each {|d| conf << ("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]}
sodir = $extout ? '$(TARGET_SO_DIR)' : '$(RUBYARCHDIR)'
n = '$(TARGET_SO_DIR)$(TARGET)'
+ cleanobjs = ["$(OBJS)"]
+ if $extmk
+ %w[bc i s].each {|ex| cleanobjs << "$(OBJS:.#{$OBJEXT}=.#{ex})"}
+ end
+ if target
+ config_string('cleanobjs') {|t| cleanobjs << t.gsub(/\$\*/, "$(TARGET)#{deffile ? '-$(arch)': ''}")}
+ end
conf << "\
TARGET_SO_DIR =#{$extout ? " $(RUBYARCHDIR)/" : ''}
TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
CLEANLIBS = #{'$(TARGET_SO) ' if target}#{config_string('cleanlibs') {|t| t.gsub(/\$\*/) {n}}}
-CLEANOBJS = *.#{$OBJEXT} #{config_string('cleanobjs') {|t| t.gsub(/\$\*/, "$(TARGET)#{deffile ? '-$(arch)': ''}")} if target} *.bak
+CLEANOBJS = #{cleanobjs.join(' ')} *.bak
TARGET_SO_DIR_TIMESTAMP = #{timestamp_file(sodir, target_prefix)}
" #"