Clean intermediate files and debug info for each target

By replacing `ALLOBJS` suffix with intermediate file suffixes instead
of roughly removing by wildcards.  Made `cleanlibs` append `.dSYM`
suffix for each word in `TARGET_SO`, not the end of the entire list.
This commit is contained in:
Nobuyoshi Nakada 2024-03-09 01:44:54 +09:00
Родитель 8e3cb69a83
Коммит 0fb39ab1b9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 3582D74E1FEE4465
7 изменённых файлов: 18 добавлений и 7 удалений

Просмотреть файл

@ -275,7 +275,7 @@ EXPORTOBJS = $(DLNOBJ) \
$(COMMONOBJS)
OBJS = $(EXPORTOBJS) builtin.$(OBJEXT)
ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
ALLOBJS = $(OBJS) $(MINIOBJS) $(INITOBJS) $(MAINOBJ)
GOLFOBJS = goruby.$(OBJEXT)
@ -718,7 +718,7 @@ clear-installed-list: PHONY
clean: clean-ext clean-enc clean-golf clean-docs clean-extout clean-local clean-platform clean-spec
clean-local:: clean-runnable
$(Q)$(RM) $(OBJS) $(MINIOBJS) $(INITOBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
$(Q)$(RM) $(ALLOBJS) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
$(Q)$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) dmyenc.$(OBJEXT) $(ARCHFILE) .*.time
$(Q)$(RM) y.tab.c y.output encdb.h transdb.h config.log rbconfig.rb $(ruby_pc) $(COROUTINE_H:/Context.h=/.time)
$(Q)$(RM) probes.h probes.$(OBJEXT) probes.stamp ruby-glommed.$(OBJEXT) ruby.imp ChangeLog $(STATIC_RUBY)$(EXEEXT)

Просмотреть файл

@ -1110,7 +1110,7 @@ main()
AC_CHECK_HEADERS(crt_externs.h, [], [], [
#include <crt_externs.h>
])
cleanlibs='$(TARGET_SO).dSYM'
cleanlibs='$(TARGET_SO:=.dSYM)'
],
[solaris*], [ LIBS="-lm $LIBS"
ac_cv_func_vfork=no

Просмотреть файл

@ -469,6 +469,10 @@ benchmark/%: miniruby$(EXEEXT) update-benchmark-driver PHONY
--executables="built-ruby::$(BENCH_RUBY) --disable-gem" \
$(srcdir)/$@ $(BENCH_OPTS) $(OPTS)
clean-local:: TARGET_SO = $(PROGRAM) $(WPROGRAM) $(LIBRUBY_SO) $(STATIC_RUBY) miniruby goruby
clean-local::
-$(Q)$(RMALL) $(cleanlibs)
clean-srcs-ext::
$(Q)$(RM) $(patsubst $(srcdir)/%,%,$(EXT_SRCS))

Просмотреть файл

@ -84,6 +84,9 @@ all:
make-workdir:
$(Q)$(MAKEDIRS) $(WORKDIRS)
.PHONY: encs all modencs libencs enc libenc trans libtrans srcs
.PHONY: clean distclean realclean clean-srcs
clean:
distclean: clean

Просмотреть файл

@ -35,7 +35,7 @@ ENCSOS =<%ENCS.map {|e|%> $(ENCSODIR)/<%=e%>.$(DLEXT) \
<%}%> #
ENCCLEANLIBS = <%=cleanlibs.map {|clean|
clean.gsub(/\$\*(\.\w+)?/) {"$(ENCOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
.gsub(/\A\$\(TARGET_SO\)(.*)/) {"$(ENCSOS:=#{$1})"}
.gsub(/\$\(\KTARGET_SO(?=[:\)])/) {"ENCSOS"}
}.join(" ")%>
ENCCLEANOBJS = <%=cleanobjs.map {|clean|
clean.gsub(/\$\*(\.\w+)?/) {"$(ENCOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
@ -52,7 +52,7 @@ TRANSSOS =<%TRANS.map {|e|%> $(ENCSODIR)/<%=e%>.$(DLEXT) \
<%}%> #
TRANSCLEANLIBS = <%=cleanlibs.map {|clean|
clean.gsub(/\$\*(\.\w+)?/) {"$(TRANSOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
.gsub(/\A\$\(TARGET_SO\)(.*)/) {"$(TRANSSOS:=#{$1})"}
.gsub(/\$\(\KTARGET_SO(?=[:\)])/) {"TRANSSOS"}
}.join(" ")%>
TRANSCLEANOBJS = <%=cleanobjs.map {|clean|
clean.gsub(/\$\*(\.\w+)?/) {"$(TRANSOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}

Просмотреть файл

@ -2516,6 +2516,7 @@ static: #{$extmk && !$static ? "all" : %[$(STATIC_LIB)#{$extout ? " install-rb"
mfile.puts dest
mfile.print "clean-so::\n"
mfile.print "\t-$(Q)$(RM) #{fseprepl[dest]} #{fseprepl[stamp]}\n"
mfile.print "\t-$(Q)$(RM_RF) #{fseprepl['$(CLEANLIBS)']}\n"
mfile.print "\t-$(Q)$(RMDIRS) #{fseprepl[dir]}#{$ignore_error}\n"
else
mfile.print "#{f} #{stamp}\n"

Просмотреть файл

@ -269,6 +269,8 @@ ACTIONS_ENDGROUP = @$(NULLCMD)
DESTDIR = @DESTDIR@
cleanlibs = @cleanlibs@
configure_args = @configure_args@
#### End of variables
@ -491,8 +493,9 @@ clean-local::
enc/encinit.c enc/encinit.$(OBJEXT) $(pkgconfig_DATA) \
ruby-runner.$(OBJEXT) ruby-runner.h \
|| $(NULLCMD)
$(Q)find . -depth \( -name '*.bc' -o -name '*.[is]' \) -delete 2> /dev/null || true
-$(Q)$(RMALL) *.dSYM
@$(RM) $(ALLOBJS:.$(OBJEXT)=.bc)
@$(RM) $(ALLOBJS:.$(OBJEXT)=.i)
@$(RM) $(ALLOBJS:.$(OBJEXT)=.s)
distclean-local::
$(Q)$(RM) \