diff --git a/Makefile b/Makefile index bf9ee6856..d47c720e4 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ BUILDFLAGS := --release --strip DEVFLAGS := $(BUILDFLAGS) RUNFLAGS := CHECKABLE_PY := pylib qt -CHECKABLE_RS := rslib +CHECKABLE_RS := rslib rspy DEVEL := rslib rspy pylib qt .PHONY: all @@ -155,14 +155,8 @@ clean-dist: buildhash check: pyenv buildhash prepare @set -eu -o pipefail ${SHELLFLAGS}; \ .github/scripts/trailing-newlines.sh; \ - $(SUBMAKE) -C rslib develop; \ - for dir in $(CHECKABLE_RS); do \ - $(SUBMAKE) -C $$dir check; \ - done; \ . "${ACTIVATE_SCRIPT}"; \ - $(SUBMAKE) -C rspy develop; \ - $(SUBMAKE) -C pylib develop; \ - for dir in $(CHECKABLE_PY); do \ + for dir in $(CHECKABLE_RS) $(CHECKABLE_PY); do \ $(SUBMAKE) -C $$dir check; \ done; @echo diff --git a/rslib/Makefile b/rslib/Makefile index 4f5eb06aa..3886df07c 100644 --- a/rslib/Makefile +++ b/rslib/Makefile @@ -17,7 +17,7 @@ $(shell mkdir -p .build) all: check -check: ftl/repo .build/check +check: .build/check fix: cargo fmt @@ -41,7 +41,7 @@ RUST_TOOLCHAIN := $(shell cat rust-toolchain) rustup component add clippy-preview --toolchain $(RUST_TOOLCHAIN) @touch $@ -.build/check: .build/rs-tools $(ALL_SOURCE) +.build/check: ftl/repo .build/rs-tools $(ALL_SOURCE) cargo test --lib -- --nocapture cargo fmt -- --check cargo clippy -- -D warnings diff --git a/rspy/Makefile b/rspy/Makefile index 0aa87b712..20ee97e28 100644 --- a/rspy/Makefile +++ b/rspy/Makefile @@ -90,8 +90,12 @@ RUST_TOOLCHAIN := $(shell cat rust-toolchain) rustup component add clippy-preview --toolchain $(RUST_TOOLCHAIN) @touch $@ -.build/check: build +# cargo clippy also run build.rs, thus it must be called before calling .build/develop +.build/check: .build/clippy .build/develop cargo fmt -- --check + @touch $@ + +.build/clippy: $(DEPS) cargo clippy -- -D warnings @touch $@