TARGET ?= debug cargoflags.debug := cargoflags.release := --release CARGOFLAGS ?= ${cargoflags.${TARGET}} LIB = target/$(TARGET)/libxflag.rlib all: $(LIB) $(LIB): xflag.rs Cargo.toml cargo build $(CARGOFLAGS) test: $(LIB) | lint RUST_BACKTRACE=1 cargo test -- --test-threads=1 --nocapture RUST_BACKTRACE=1 cargo test --examples fmt: $(LIB) cargo fmt lint: $(LIB) cargo clippy doc: $(LIB) cargo doc clean: rm -rf target/ .PHONY: all test fmt lint doc clean