RUST_PKG=$(SRCDIR)/rust_component .PHONY: all clean RustComponent csonar_facing all: RustComponent # The regular Rust build is managed by cargo. # In this example the package only has one source file, main.rs. # If there were other source files, they would be dependencies too. RustComponent: $(RUST_PKG)/src/main.rs $(RUST_PKG)/Cargo.toml cargo build --manifest-path $(RUST_PKG)/Cargo.toml # Invoke codesonar rust_scan.py to: # - Analyze our Rust source files (in this case, $(RUST_PKG)/src/main.rs) with Clippy. # - Convert the Clippy results to SARIF format with clippy-sarif. # - Import the SARIF and Rust source files into the CodeSonar project. csonar_facing: $(RUST_PKG)/src/main.rs "$(CSONAR)"/codesonar/bin/codesonar rust_scan.py $(RUST_PKG) clean: cd $(RUST_PKG) && cargo clean