LIBDIR = rust/target/release
STATLIB = $(LIBDIR)/libtestrust.a
PKG_LIBS = -L$(LIBDIR) -ltestrust

all: $(SHLIB) rust_clean

$(SHLIB): $(STATLIB)

# Sets RUSTFLAGS itself, like those of savvy and clarabel
$(STATLIB):
	export PATH="$(PATH):$(HOME)/.cargo/bin" && \
	  export RUSTFLAGS="-C debuginfo=0" && \
	  cargo build --release --offline --manifest-path=rust/Cargo.toml

rust_clean: $(SHLIB)
	rm -Rf rust/target
