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

ruby-changes:73550

From: Nobuyoshi <ko1@a...>
Date: Wed, 14 Sep 2022 21:24:56 +0900 (JST)
Subject: [ruby-changes:73550] f2429f0af5 (master): Expand dependency for `$(YJIT_LIBS)`

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

From f2429f0af57536a354159f08aac729d6e4cdef38 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 19 Aug 2022 15:22:22 +0900
Subject: Expand dependency for `$(YJIT_LIBS)`

Currently, miniruby is rebuild **always** when yjit is enabled, even
if nothing is changed.
---
 yjit/yjit.mk | 34 +++++++++++++++-------------------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/yjit/yjit.mk b/yjit/yjit.mk
index 9e3155deb3..315ad9521f 100644
--- a/yjit/yjit.mk
+++ b/yjit/yjit.mk
@@ -5,12 +5,17 @@ CARGO_VERBOSE_0 = -q https://github.com/ruby/ruby/blob/trunk/yjit/yjit.mk#L5
 CARGO_VERBOSE_1 =
 CARGO_VERBOSE = $(CARGO_VERBOSE_$(V))
 
-# Select between different build profiles with macro substitution
-.PHONY: yjit-static-lib
-yjit-static-lib: yjit-static-lib-$(YJIT_SUPPORT)
+YJIT_SRC_FILES = $(wildcard \
+	$(top_srcdir)/yjit/Cargo.* \
+	$(top_srcdir)/yjit/src/*.rs \
+	$(top_srcdir)/yjit/src/*/*.rs \
+	$(top_srcdir)/yjit/src/*/*/*.rs \
+	$(top_srcdir)/yjit/src/*/*/*/*.rs \
+	)
 
 # YJIT_SUPPORT=yes when `configure` gets `--enable-yjit`
-yjit-static-lib-yes:
+ifeq ($(YJIT_SUPPORT),yes)
+$(YJIT_LIBS): $(YJIT_SRC_FILES)
 	$(ECHO) 'building Rust YJIT (release mode)'
 	$(Q) $(RUSTC) \
 	        --crate-name=yjit \
@@ -20,28 +25,19 @@ yjit-static-lib-yes: https://github.com/ruby/ruby/blob/trunk/yjit/yjit.mk#L25
 	        -C overflow-checks=on \
 	        '--out-dir=$(CARGO_TARGET_DIR)/release/' \
 	        $(top_srcdir)/yjit/src/lib.rs
-
-yjit-static-lib-no:
+else ifeq ($(YJIT_SUPPORT),no)
+$(YJIT_LIBS):
 	$(ECHO) 'Error: Tried to build YJIT without configuring it first. Check `make showconfig`?'
 	@false
-
-yjit-static-lib-cargo:
+else ifeq ($(YJIT_SUPPORT),$(filter dev dev_nodebug stats,$(YJIT_SUPPORT)))
+$(YJIT_LIBS): $(YJIT_SRC_FILES)
 	$(ECHO) 'building Rust YJIT ($(YJIT_SUPPORT) mode)'
 	$(Q)$(CHDIR) $(top_srcdir)/yjit && \
 	        CARGO_TARGET_DIR='$(CARGO_TARGET_DIR)' \
 	        CARGO_TERM_PROGRESS_WHEN='never' \
 	        $(CARGO) $(CARGO_VERBOSE) build $(CARGO_BUILD_ARGS)
-
-yjit-static-lib-dev: yjit-static-lib-cargo
-yjit-static-lib-dev_nodebug: yjit-static-lib-cargo
-yjit-static-lib-stats: yjit-static-lib-cargo
-
-# This PHONY prerequisite makes it so that we always run cargo. When there are
-# no Rust changes on rebuild, Cargo does not touch the mtime of the static
-# library and GNU make avoids relinking. $(empty) seems to be important to
-# trigger rebuild each time in release mode.
-$(YJIT_LIBS): yjit-static-lib
-	$(empty)
+else
+endif
 
 # Put this here instead of in common.mk to avoid breaking nmake builds
 # TODO: might need to move for BSD Make support
-- 
cgit v1.2.1


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

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