[前][次][番号順一覧][スレッド一覧]

ruby-changes:58688

From: Nobuyoshi <ko1@a...>
Date: Sun, 10 Nov 2019 09:27:12 +0900 (JST)
Subject: [ruby-changes:58688] faa4f4f23f (master): Get rid of FreeBSD make incompatibility [Bug #16331]

https://git.ruby-lang.org/ruby.git/commit/?id=faa4f4f23f

From faa4f4f23fbb6b48b158cc38d9b509fd00838976 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 10 Nov 2019 09:15:12 +0900
Subject: Get rid of FreeBSD make incompatibility [Bug #16331]

FreeBSD make works differently with `-j` option.

> -j	max_jobs
> 	Specify the maximum number of jobs that `make` may have running
>	at any one time.  The value is saved in `.MAKE.JOBS.` Turns
>	compatibility mode off, unless the `B` flag is also specified.
>	When compatibility mode is off, all commands associated with a
>	target are executed in a single shell invocation as opposed to
>	the traditional one shell invocation per line.  This can break
>	traditional scripts which change directories on each command
>	invocation and then expect to start with a fresh environment on
>	the next line.  It is more efficient to correct the scripts
>	rather than turn backwards compatibility on.

Stop using exit, cd, exec in middle of commands.

diff --git a/common.mk b/common.mk
index af90c53..221db49 100644
--- a/common.mk
+++ b/common.mk
@@ -345,7 +345,7 @@ $(LIBRUBY_A):	$(LIBRUBY_A_OBJS) $(MAINOBJ) $(INITOBJS) $(ARCHFILE) https://github.com/ruby/ruby/blob/trunk/common.mk#L345
 $(LIBRUBY_SO):	$(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(BUILTIN_ENCOBJS)
 
 $(LIBRUBY_EXTS):
-	@exit > $@
+	@$(NULLCMD) > $@
 
 $(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A)
 	$(Q)$(RM) $@
@@ -594,11 +594,14 @@ clean-local:: clean-runnable https://github.com/ruby/ruby/blob/trunk/common.mk#L594
 	$(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
 	$(Q)$(RM) GNUmakefile.old Makefile.old $(arch)-fake.rb bisect.sh $(ENC_TRANS_D)
-	-$(Q) $(RMDIR) enc/jis enc/trans enc $(COROUTINE_H:/Context.h=) coroutine 2> $(NULL) || exit 0
-clean-runnable:: PHONY
-	$(Q)$(CHDIR) bin 2>$(NULL) && $(RM) $(PROGRAM) $(WPROGRAM) $(GORUBY)$(EXEEXT) bin/*.$(DLEXT) 2>$(NULL) || exit 0
-	$(Q)$(CHDIR) lib 2>$(NULL) && $(RM) $(LIBRUBY_A) $(LIBRUBY) $(LIBRUBY_ALIASES) $(RUBY_BASE_NAME)/$(RUBY_PROGRAM_VERSION) $(RUBY_BASE_NAME)/vendor_ruby 2>$(NULL) || exit 0
-	$(Q)$(RMDIR) lib/$(RUBY_BASE_NAME) lib bin 2>$(NULL) || exit 0
+	-$(Q) $(RMDIR) enc/jis enc/trans enc $(COROUTINE_H:/Context.h=) coroutine 2> $(NULL) || $(NULLCMD)
+
+bin/clean-runnable:: PHONY
+	$(Q)$(CHDIR) bin 2>$(NULL) && $(RM) $(PROGRAM) $(WPROGRAM) $(GORUBY)$(EXEEXT) bin/*.$(DLEXT) 2>$(NULL) || $(NULLCMD)
+lib/clean-runnable:: PHONY
+	$(Q)$(CHDIR) lib 2>$(NULL) && $(RM) $(LIBRUBY_A) $(LIBRUBY) $(LIBRUBY_ALIASES) $(RUBY_BASE_NAME)/$(RUBY_PROGRAM_VERSION) $(RUBY_BASE_NAME)/vendor_ruby 2>$(NULL) || $(NULLCMD)
+clean-runnable:: bin/clean-runnable lib/clean-runnable PHONY
+	$(Q)$(RMDIR) lib/$(RUBY_BASE_NAME) lib bin 2>$(NULL) || $(NULLCMD)
 clean-ext:: PHONY
 clean-golf: PHONY
 	$(Q)$(RM) $(GORUBY)$(EXEEXT) $(GOLFOBJS)
@@ -607,7 +610,7 @@ clean-html: PHONY https://github.com/ruby/ruby/blob/trunk/common.mk#L610
 clean-capi: PHONY
 clean-platform: PHONY
 clean-extout: PHONY
-	-$(Q)$(RMDIR) $(EXTOUT)/$(arch) $(EXTOUT) 2> $(NULL) || exit 0
+	-$(Q)$(RMDIR) $(EXTOUT)/$(arch) $(EXTOUT) 2> $(NULL) || $(NULLCMD)
 clean-docs: clean-rdoc clean-html clean-capi
 clean-spec: PHONY
 clean-rubyspec: clean-spec
@@ -643,9 +646,10 @@ clean-srcs-local:: https://github.com/ruby/ruby/blob/trunk/common.mk#L646
 	$(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
+	$(Q)$(CHDIR) $(srcdir) && $(RM) \
+	  parse.c parse.h lex.c enc/trans/newline.c $(PRELUDES) revision.h \
+	  id.c id.h probes.dmyh configure aclocal.m4 tool/config.guess tool/config.sub gems/*.gem \
+	|| $(NULLCMD)
 
 clean-srcs-ext::
 realclean-srcs-ext:: clean-srcs-ext
@@ -677,14 +681,14 @@ timestamp/realclean:: ext/realclean gems/realclean https://github.com/ruby/ruby/blob/trunk/common.mk#L681
 
 timestamp/clean timestamp/distclean timestamp/realclean::
 	$(Q)$(RM) $(TIMESTAMPDIR)/.*.time $(TIMESTAMPDIR)/$(arch)/.time
-	$(Q)$(RMDIRS) $(TIMESTAMPDIR)/$(arch) $(TIMESTAMPDIR) 2> $(NULL) || exit 0
+	$(Q)$(RMDIRS) $(TIMESTAMPDIR)/$(arch) $(TIMESTAMPDIR) 2> $(NULL) || $(NULLCMD)
 
 clean-ext::
 	-$(Q)$(RM) ext/extinit.$(OBJEXT)
 
 distclean-ext realclean-ext::
 	-$(Q)$(RM) $(EXTS_MK) ext/extinit.* ext/configure-ext.mk
-	-$(Q)$(RMDIR) ext 2> $(NULL) || exit 0
+	-$(Q)$(RMDIR) ext 2> $(NULL) || $(NULLCMD)
 
 clean-enc distclean-enc realclean-enc: PHONY
 
@@ -692,7 +696,7 @@ clean-enc: clean-enc.d https://github.com/ruby/ruby/blob/trunk/common.mk#L696
 
 clean-enc.d: PHONY
 	$(Q)$(RM) $(ENC_TRANS_D)
-	-$(Q) $(RMDIR) enc/jis enc/trans enc 2> $(NULL) || exit 0
+	-$(Q) $(RMDIR) enc/jis enc/trans enc 2> $(NULL) || $(NULLCMD)
 
 clean-rdoc distclean-rdoc realclean-rdoc:
 	@echo $(@:-rdoc=ing) rdoc
@@ -708,12 +712,12 @@ clean-capi distclean-capi realclean-capi: https://github.com/ruby/ruby/blob/trunk/common.mk#L712
 
 clean-platform:
 	$(Q) $(RM) $(PLATFORM_D)
-	-$(Q) $(RMDIR) $(PLATFORM_DIR) 2> $(NULL) || exit 0
+	-$(Q) $(RMDIR) $(PLATFORM_DIR) 2> $(NULL) || $(NULLCMD)
 
 RUBYSPEC_CAPIEXT = spec/ruby/optional/capi/ext
 clean-spec: PHONY
 	-$(Q) $(RM) $(RUBYSPEC_CAPIEXT)/*.$(OBJEXT) $(RUBYSPEC_CAPIEXT)/*.$(DLEXT)
-	-$(Q) $(RMDIRS) $(RUBYSPEC_CAPIEXT) 2> $(NULL) || exit 0
+	-$(Q) $(RMDIRS) $(RUBYSPEC_CAPIEXT) 2> $(NULL) || $(NULLCMD)
 
 check: main test test-tool test-all test-spec
 	$(ECHO) check succeeded
@@ -867,7 +871,7 @@ PHONY: https://github.com/ruby/ruby/blob/trunk/common.mk#L871
 
 $(PLATFORM_D):
 	$(Q) $(MAKEDIRS) $(PLATFORM_DIR) $(@D)
-	@exit > $@
+	@$(NULLCMD) > $@
 
 exe/$(PROGRAM): ruby-runner.c ruby-runner.h exe/.time miniruby$(EXEEXT) {$(VPATH)}config.h
 	$(Q) $(CC) $(CFLAGS) $(INCFLAGS) $(CPPFLAGS) -DRUBY_INSTALL_NAME=$(@F) $(COUTFLAG)ruby-runner.$(OBJEXT) -c $(CSRCFLAG)$(srcdir)/ruby-runner.c
@@ -884,17 +888,17 @@ exe/$(PROGRAM): ruby-runner.c ruby-runner.h exe/.time miniruby$(EXEEXT) {$(VPATH https://github.com/ruby/ruby/blob/trunk/common.mk#L888
 
 exe/.time:
 	$(Q) $(MAKEDIRS) $(@D)
-	@exit > $@
+	@$(NULLCMD) > $@
 
 $(BUILTIN_ENCOBJS) $(BUILTIN_TRANSOBJS): $(ENC_TRANS_D)
 
 $(ENC_TRANS_D):
 	$(Q) $(MAKEDIRS) enc/trans $(@D)
-	@exit > $@
+	@$(NULLCMD) > $@
 
 $(TIMESTAMPDIR)/$(arch)/.time:
 	$(Q)$(MAKEDIRS) $(@D) $(EXTOUT)/$(arch)
-	@exit > $@
+	@$(NULLCMD) > $@
 
 ###
 CCAN_DIR = {$(VPATH)}ccan
@@ -930,7 +934,7 @@ nt.$(OBJEXT): {$(VPATH)}nt.c https://github.com/ruby/ruby/blob/trunk/common.mk#L934
 	$(COROUTINE_H:/Context.h=/.time)
 $(COROUTINE_H:/Context.h=/.time):
 	$(Q) $(MAKEDIRS) $(@D)
-	@exit > $@
+	@$(NULLCMD) > $@
 
 ###
 
@@ -1115,10 +1119,10 @@ $(BUILTIN_RB_INCS): $(top_srcdir)/tool/mk_builtin_loader.rb https://github.com/ruby/ruby/blob/trunk/common.mk#L1119
 
 $(srcdir)/revision.h:
 	$(Q)$(gnumake:yes=#) $(RM) $(@F)
-	$(Q)$(gnumake:yes=#) exit > $@ || exit > $(@F)
+	$(Q)$(gnumake:yes=#) $(NULLCMD) > $@ || $(NULLCMD) > $(@F)
 
 revision.tmp::
-	$(Q)exit > $@
+	$(Q) $(NULLCMD) > $@
 revision.$(HAVE_BASERUBY:yes=tmp):: $(srcdir)/version.h $(srcdir)/tool/file2lastrev.rb $(REVISION_FORCE)
 	$(Q) $(BASERUBY) $(srcdir)/tool/file2lastrev.rb -q --revision.h --srcdir="$(srcdir)" > $@
 
@@ -1440,7 +1444,7 @@ $(UNICODE_SRC_DATA_DIR)/.unicode-tables.time: $(srcdir)/tool/generic_erb.rb \ https://github.com/ruby/ruby/blob/trunk/common.mk#L1444
 		$(UNICODE_DATA_DIR) lib/unicode_normalize
 
 $(UNICODE_SRC_DATA_DIR):
-	$(Q) $(exec) $(MAKEDIRS) $@ || exit && echo $(MAKE)
+	$(gnumake_recursive)$(Q) $(MAKEDIRS) $@
 
 $(UNICODE_HDR_DIR)/$(ALWAYS_UPDATE_UNICODE:yes=name2ctype.h): \
 		$(srcdir)/tool/enc-unicode.rb \
diff --git a/template/Makefile.in b/template/Makefile.in
index ed9e8b6..9c13383 100644
--- a/template/Makefile.in
+++ b/template/Makefile.in
@@ -275,7 +275,7 @@ $(PROGRAM): https://github.com/ruby/ruby/blob/trunk/template/Makefile.in#L275
 		$(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
 		$(Q) $(POSTLINK)
 
-PRE_LIBRUBY_UPDATE = [ -n "$(LIBRUBY_SO_UPDATE)" ] || $(exec) $(RM) $(LIBRUBY_EXTS)
+PRE_LIBRUBY_UPDATE = [ -n "$(LIBRUBY_SO_UPDATE)" ] || $(gnumake:yes=exec) $(RM) $(LIBRUBY_EXTS)
 
 # We must `rm' the library each time this rule is invoked because "updating" a
 # MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not
@@ -456,12 +456,14 @@ probes.$(OBJEXT): $(srcdir)/probes.d $(DTRACE_REBUILD:yes=probes.stamp) https://github.com/ruby/ruby/blob/trunk/template/Makefile.in#L456
 main: mjit-headers
 yes-mjit-headers: $(MJIT_MIN_HEADER)
 clean-local::
-	$(Q)$(RM) $(MJIT_HEADER) $(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX:%=*).h
-	$(Q)$(RM) $(MJIT_MIN_HEADER) $(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX:%=*).h
-	$(Q)$(RM) $(MJIT_HEADER_INSTALL_DIR)/rb_mjit_min_header-*.h
-	$(Q)$(RM) $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time mjit_config.h
+	$(Q)$(RM) \
+	  $(MJIT_HEADER) $(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX:%=*).h \
+	  $(MJIT_MIN_HEADER) $(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX:%=*).h \
+	  $(MJIT_HEADER_INSTALL_DIR)/rb_mjit_min_header-*.h \
+	  $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time mjit_config.h \
+	|| $(NULLCMD)
 	$(Q)$(RM) -r mjit_build_dir.*
-	-$(Q) $(RMDIRS) $(MJIT_HEADER_INSTALL_DIR) $(MJIT_HEADER_BUILD_DIR) $(TIMESTAMPDIR) 2> $(NULL) || exit 0
+	-$(Q) $(RMDIRS) $(MJIT_HEADER_INSTALL_DIR) $(MJIT_HEADER_BUILD_DIR) $(TIMESTAMPDIR) 2> $(NULL) || $(NULLCMD)
 
 # DTrace static library hacks described here:
 # http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-August/000207.html
@@ -470,15 +472,18 @@ ruby-glommed.$(OBJEXT): https://github.com/ruby/ruby/blob/trunk/template/Makefile.in#L472
 	$(Q) $(LD) -r -o $@ $(OBJ (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]