diff --git a/pkg/rust/Makefile.crate b/pkg/rust/Makefile.crate index e3edcd651b2a..8690a9bee4d2 100644 --- a/pkg/rust/Makefile.crate +++ b/pkg/rust/Makefile.crate @@ -1,17 +1,19 @@ CRATE_NAME ?= $(PKG_NAME) CRATE_TYPE = lib +LIBNAME = lib$(CRATE_NAME:lib%=%) + .PHONY: all all: | git-download $(BINDIR)/rust/$(PKG_NAME).a -$(CRATE_DEPS:%=$(BINDIR)/rust/%.rlib): - "$(MAKE)" -C $(RIOTPKG)/$(patsubst $(BINDIR)/%.rlib,%,$@) +$(CRATE_DEPS:%=$(BINDIR)/rust/%.a): + "$(MAKE)" -C $(RIOTPKG)/$(patsubst $(BINDIR)/%.a,%,$@) -$(BINDIR)/rust/$(PKG_NAME).a: $(BINDIR)/rust/$(PKG_NAME).rlib +$(BINDIR)/rust/$(PKG_NAME).a: $(BINDIR)/rust/$(LIBNAME).rlib $(AD)ln -fs $< $@ -$(BINDIR)/rust/$(PKG_NAME).rlib: $(SOURCE_FILE) $(CRATE_DEPS:%=$(BINDIR)/rust/%.rlib) +$(BINDIR)/rust/$(LIBNAME).rlib: $(SOURCE_FILE) $(CRATE_DEPS:%=$(BINDIR)/rust/%.a) $(AD)mkdir -p $(BINDIR)/rust $(AD)rustc $(RUSTC_FLAGS) -o $@ $(SOURCE_FILE) diff --git a/sys/rust/fmt/Makefile b/sys/rust/fmt/Makefile index ce39e9411d3e..b9dfb4c72f78 100644 --- a/sys/rust/fmt/Makefile +++ b/sys/rust/fmt/Makefile @@ -1,4 +1 @@ -USEPKG = rust/libcore -USEMODULE = - include $(RIOTBASE)/sys/rust/Makefile.crate