11# Make recipes that deal with the rust code of YJIT and ZJIT.
2+ #
3+ # $(gnumake_recursive) adds the '+' prefix to pass down GNU make's
4+ # jobserver resources to cargo/rustc as rust-lang.org recommends.
5+ # Without it, certain make version trigger a warning. It does not
6+ # add the prefix when `make --dry-run` so dry runs are indeed dry.
27
38ifneq ($(JIT_CARGO_SUPPORT ) ,no)
49
@@ -25,7 +30,7 @@ $(RUST_LIB): $(srcdir)/ruby.rs
2530 elif [ ' $(YJIT_SUPPORT)' != no ]; then \
2631 echo ' building YJIT ($(JIT_CARGO_SUPPORT) mode)' ; \
2732 fi
28- + $(Q ) CARGO_TARGET_DIR=' $(CARGO_TARGET_DIR)' \
33+ $( gnumake_recursive ) $(Q ) CARGO_TARGET_DIR=' $(CARGO_TARGET_DIR)' \
2934 CARGO_TERM_PROGRESS_WHEN=' never' \
3035 MACOSX_DEPLOYMENT_TARGET=11.0 \
3136 $(CARGO ) $(CARGO_VERBOSE ) build --manifest-path ' $(top_srcdir)/Cargo.toml' $(CARGO_BUILD_ARGS )
@@ -34,7 +39,7 @@ else ifneq ($(strip $(RLIB_DIR)),) # combo build
3439
3540$(RUST_LIB ) : $(srcdir ) /ruby.rs
3641 $(ECHO ) ' building $(@F)'
37- $(Q ) $(RUSTC ) --edition=2024 \
42+ $(gnumake_recursive )$( Q ) $(RUSTC ) --edition=2024 \
3843 ' -L$(@D)' \
3944 --extern=yjit \
4045 --extern=zjit \
@@ -50,7 +55,7 @@ $(YJIT_RLIB): $(JIT_RLIB)
5055$(ZJIT_RLIB ) : $(JIT_RLIB )
5156$(JIT_RLIB ) :
5257 $(ECHO ) ' building $(@F)'
53- $(Q ) $(RUSTC ) --crate-name=jit \
58+ $(gnumake_recursive )$( Q ) $(RUSTC ) --crate-name=jit \
5459 --edition=2024 \
5560 $(JIT_RUST_FLAGS ) \
5661 ' --out-dir=$(@D)' \
0 commit comments