@@ -47,13 +47,15 @@ if RUST_CROSS_COMPILE
4747RUST_TARGET = --target $(host_triplet )
4848endif
4949
50+ CARGO_ENV = RUSTC="$(RUSTC ) " RUSTDOC="$(RUSTDOC ) "
51+
5052if HAVE_CYGPATH
51- CARGO_ENV = @rustup_home@ \
53+ CARGO_ENV + = @rustup_home@ \
5254 CARGO_HOME="$(CARGO_HOME ) " \
5355 CARGO_TARGET_DIR="$(e_rustdir ) /target" \
5456 SURICATA_LUA_SYS_HEADER_DST="$(e_rustdir ) /gen"
5557else
56- CARGO_ENV = @rustup_home@ \
58+ CARGO_ENV + = @rustup_home@ \
5759 CARGO_HOME="$(CARGO_HOME ) " \
5860 CARGO_TARGET_DIR="$(abs_top_builddir ) /rust/target" \
5961 SURICATA_LUA_SYS_HEADER_DST="$(abs_top_builddir ) /rust/gen"
@@ -124,15 +126,14 @@ endif
124126
125127check :
126128 cd $(abs_top_srcdir ) /rust && \
127- $(CARGO_ENV ) RUSTDOC= $( RUSTDOC ) \
129+ $(CARGO_ENV ) \
128130 $(CARGO ) test --all $(RELEASE ) --features " $( RUST_FEATURES) "
129131 $(MAKE ) check-bindgen-bindings
130132
131133vendor :
132134 $(CARGO_ENV ) $(CARGO ) vendor
133135
134136update-bindings :
135- if HAVE_BINDGEN
136137 $(BINDGEN ) \
137138 -o sys/src/sys.rs.tmp \
138139 --rust-target 1.68 \
@@ -172,7 +173,7 @@ endif
172173if HAVE_CBINDGEN
173174gen/rust-bindings.h : $(RUST_SURICATA_LIB ) cbindgen.toml
174175 cd $(abs_top_srcdir ) /rust && \
175- CARGO=$(CARGO ) $(CBINDGEN ) --config $(abs_top_srcdir ) /rust/cbindgen.toml \
176+ $( CARGO_ENV ) CARGO=$(CARGO ) $(CBINDGEN ) --config $(abs_top_srcdir ) /rust/cbindgen.toml \
176177 --quiet --verify --output $(abs_top_builddir ) /rust/gen/rust-bindings.h || true
177178else
178179gen/rust-bindings.h :
@@ -181,18 +182,18 @@ endif
181182if HAVE_CBINDGEN
182183gen/htp/htp_rs.h : $(RUST_SURICATA_LIB ) htp/cbindgen.toml
183184 cd $(abs_top_srcdir ) /rust/htp && \
184- CARGO=$(CARGO ) $(CBINDGEN ) --config $(abs_top_srcdir ) /rust/htp/cbindgen.toml \
185+ $( CARGO_ENV ) CARGO=$(CARGO ) $(CBINDGEN ) --config $(abs_top_srcdir ) /rust/htp/cbindgen.toml \
185186 --quiet --verify --output $(abs_top_builddir ) /rust/gen/htp/htp_rs.h || true
186187else
187188gen/htp/htp_rs.h :
188189endif
189190
190191doc :
191- CARGO_HOME= $( CARGO_HOME ) RUSTDOC= $( RUSTDOC ) $(CARGO ) doc --all-features --no-deps
192+ $( CARGO_ENV ) $(CARGO ) doc --all-features --no-deps
192193
193194if HAVE_CBINDGEN
194195dist/rust-bindings.h :
195- CARGO=$(CARGO ) $(CBINDGEN ) --config $(abs_top_srcdir ) /rust/cbindgen.toml \
196+ $( CARGO_ENV ) CARGO=$(CARGO ) $(CBINDGEN ) --config $(abs_top_srcdir ) /rust/cbindgen.toml \
196197 --quiet --output $(abs_top_builddir ) /rust/dist/rust-bindings.h
197198else
198199dist/rust-bindings.h :
@@ -201,7 +202,7 @@ endif
201202if HAVE_CBINDGEN
202203dist/htp/htp_rs.h :
203204 cd $(abs_top_srcdir ) /rust/htp && \
204- CARGO=$(CARGO ) $(CBINDGEN ) --config cbindgen.toml \
205+ $( CARGO_ENV ) CARGO=$(CARGO ) $(CBINDGEN ) --config cbindgen.toml \
205206 --quiet --output $(abs_top_builddir ) /rust/dist/htp/htp_rs.h
206207else
207208dist/htp/htp_rs.h :
@@ -210,5 +211,5 @@ endif
210211Cargo.toml : Cargo.toml.in
211212
212213update-lock : Cargo.toml
213- $(CARGO ) update
214+ $(CARGO_ENV ) $( CARGO ) update
214215 mv Cargo.lock Cargo.lock.in
0 commit comments