@@ -19,30 +19,20 @@ ZJIT_SRC_FILES = $(wildcard \
1919# rebuild at the next build.
2020ZJIT_LIB_TOUCH = touch $@
2121
22+ # Absolute path to match RUST_LIB rules to avoid picking
23+ # the "target" dir in the source directory through VPATH.
24+ BUILD_ZJIT_LIBS = $(TOP_BUILD_DIR ) /$(ZJIT_LIBS )
25+
2226# ZJIT_SUPPORT=yes when `configure` gets `--enable-zjit`
2327ifeq ($(ZJIT_SUPPORT ) ,yes)
24- $(ZJIT_LIBS ) : $(ZJIT_SRC_FILES )
28+ $(BUILD_ZJIT_LIBS ) : $(ZJIT_SRC_FILES )
2529 $(ECHO ) ' building Rust ZJIT (release mode)'
2630 +$(Q ) $(RUSTC ) $(ZJIT_RUSTC_ARGS )
2731 $(ZJIT_LIB_TOUCH )
2832else ifeq ($(ZJIT_SUPPORT),no)
29- $(ZJIT_LIBS ) :
33+ $(BUILD_ZJIT_LIBS ) :
3034 $(ECHO ) ' Error: Tried to build ZJIT without configuring it first. Check `make showconfig`?'
3135 @false
32- else ifeq ($(ZJIT_SUPPORT),$(filter dev dev_nodebug stats,$(ZJIT_SUPPORT)))
33- # NOTE: MACOSX_DEPLOYMENT_TARGET to match `rustc --print deployment-target` to avoid the warning below.
34- # ld: warning: object file (zjit/target/debug/libzjit.a(<libcapstone object>)) was built for
35- # newer macOS version (15.2) than being linked (15.0)
36- # We don't use newer macOS feature as of yet.
37- $(ZJIT_LIBS ) : $(ZJIT_SRC_FILES )
38- $(ECHO ) ' building Rust ZJIT ($(ZJIT_SUPPORT) mode)'
39- +$(Q )$(CHDIR ) $(top_srcdir ) /zjit && \
40- CARGO_TARGET_DIR=' $(ZJIT_CARGO_TARGET_DIR)' \
41- CARGO_TERM_PROGRESS_WHEN=' never' \
42- MACOSX_DEPLOYMENT_TARGET=11.0 \
43- $(CARGO ) $(CARGO_VERBOSE ) build $(ZJIT_CARGO_BUILD_ARGS )
44- $(ZJIT_LIB_TOUCH )
45- else
4636endif
4737
4838# By using ZJIT_BENCH_OPTS instead of RUN_OPTS, you can skip passing the options to `make install`
0 commit comments