rust/Makefile: Consider HAVE_CARGO in the clean target

This fixes `make clean` errors when cargo is not available:

  $ make clean
  ...
  | make[1]: Entering directory '/home/mhartmay/storage/git/poky/build/workspace/sources/s390-tools/rust'
  | cargo clean  --release
  | /bin/bash: cargo: command not found
  | make[1]: *** [Makefile:72: clean] Error 127

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2024-09-25 16:57:04 +00:00
committed by Jan Höppner
parent 77a7e11a51
commit 77d0d1d1a1

View File

@@ -74,7 +74,9 @@ print-rust-targets:
echo $(BUILD_TARGETS)
clean:
ifneq (${HAVE_CARGO},0)
$(CARGO_CLEAN) ${ALL_CARGOFLAGS}
endif # CARGO
$(RM) -- .check-dep-pvtools .detect-openssl.dep.c .check-cargo
rust-test: $(CARGO_TEST_TARGETS)