ruby-changes:53731
From: nobu <ko1@a...>
Date: Sat, 24 Nov 2018 13:34:06 +0900 (JST)
Subject: [ruby-changes:53731] nobu:r65947 (trunk): Add clean-srcs
nobu 2018-11-24 13:34:00 +0900 (Sat, 24 Nov 2018) New Revision: 65947 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65947 Log: Add clean-srcs Add `clean-srcs` target to clean sources in the build directory, and `realclean-srcs` target to clean autogenerated sources in the source directory. Also `realclean-srcs-extra` target to clean sources which are generatable but need to install extra commands, in addition. Modified files: trunk/common.mk trunk/defs/gmake.mk Index: common.mk =================================================================== --- common.mk (revision 65946) +++ common.mk (revision 65947) @@ -622,12 +622,26 @@ distclean-spec: clean-spec https://github.com/ruby/ruby/blob/trunk/common.mk#L622 distclean-rubyspec: distclean-spec realclean:: realclean-ext realclean-local realclean-enc realclean-golf realclean-extout -realclean-local:: distclean-local +realclean-local:: distclean-local realclean-srcs-local + +clean-srcs:: clean-srcs-local clean-srcs-ext +realclean-srcs:: realclean-srcs-local realclean-srcs-ext + +clean-srcs-local:: $(Q)$(RM) parse.c parse.h lex.c enc/trans/newline.c revision.h - $(Q)$(RM) id.c id.h probes.dmyh + $(Q)$(RM) id.c id.h probes.dmyh probes.h + $(Q)$(RM) encdb.h transdb.h verconf.h ruby-runner.h + $(Q)$(RM) mjit_build_dir.c mjit_config.h rb_mjit_header.h + $(Q)$(RM) $(MJIT_MIN_HEADER) $(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX:%=*).h + +realclean-srcs-local:: clean-srcs-local $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) parse.c parse.h lex.c enc/trans/newline.c $(PRELUDES) revision.h $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) id.c id.h probes.dmyh $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) configure aclocal.m4 tool/config.guess tool/config.sub gems/*.gem + +clean-srcs-ext:: +realclean-srcs-ext:: clean-srcs-ext + realclean-ext:: PHONY realclean-golf: distclean-golf $(Q)$(RM) $(GOLFPRELUDES) @@ -970,10 +984,16 @@ EXT_SRCS = $(srcdir)/ext/ripper/ripper.c https://github.com/ruby/ruby/blob/trunk/common.mk#L984 # EXT_SRCS srcs-ext: $(EXT_SRCS) +realclean-srcs-ext:: + $(Q)$(RM) $(EXT_SRCS) -srcs-extra: $(srcdir)/ext/json/parser/parser.c \ - $(srcdir)/ext/date/zonetab.h \ - $(empty) +EXTRA_SRCS = $(srcdir)/ext/json/parser/parser.c \ + $(srcdir)/ext/date/zonetab.h \ + $(empty) + +srcs-extra: $(EXTRA_SRCS) +realclean-srcs-extra:: + $(Q)$(RM) $(EXTRA_SRCS) LIB_SRCS = $(srcdir)/lib/unicode_normalize/tables.rb Index: defs/gmake.mk =================================================================== --- defs/gmake.mk (revision 65946) +++ defs/gmake.mk (revision 65947) @@ -193,3 +193,9 @@ rdoc\:%: PHONY https://github.com/ruby/ruby/blob/trunk/defs/gmake.mk#L193 test_%.rb test/%: programs PHONY +$(Q)$(exec) $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) $(patsubst test/%,%,$@) + +clean-srcs-ext:: + $(Q)$(RM) $(patsubst $(srcdir)/%,%,$(EXT_SRCS)) + +clean-srcs-extra:: + $(Q)$(RM) $(patsubst $(srcdir)/%,%,$(EXTRA_SRCS)) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/