From 85891abba0027f76aa3c02d49db16c9b0494c802 Mon Sep 17 00:00:00 2001 From: MCorange Date: Mon, 17 Jun 2024 12:16:09 +0300 Subject: [PATCH] fixed makefiles --- dim_plugins/battery/Makefile | 14 ++++++++------ dim_plugins/clock/Makefile | 17 ++++++++--------- dim_plugins/counter/Makefile | 17 ++++++++--------- dim_plugins/example_rust/Makefile | 18 ++++++++---------- rust-toolchain | 1 + 5 files changed, 33 insertions(+), 34 deletions(-) create mode 100644 rust-toolchain diff --git a/dim_plugins/battery/Makefile b/dim_plugins/battery/Makefile index 83ff5a2..a3c835a 100644 --- a/dim_plugins/battery/Makefile +++ b/dim_plugins/battery/Makefile @@ -1,15 +1,17 @@ # Must match package name in Cargo.toml PLUGIN_NAME=battery - +# `target` or `debug` +TYPE=target build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim -$(PLUGIN_DIR)/$(PLUGIN_NAME).dim: $(OBJECT_DIR)/$(PLUGIN_NAME)/debug/lib$(PLUGIN_NAME).so - cp $(OBJECT_DIR)/$(PLUGIN_NAME)/debug/lib$(PLUGIN_NAME).so $(PLUGIN_DIR)/$(PLUGIN_NAME).dim +$(PLUGIN_DIR)/$(PLUGIN_NAME).dim: $(OBJECT_DIR)/$(PLUGIN_NAME)/$(TYPE)/lib$(PLUGIN_NAME).so + @mkdir -p $(dir $@) + cp $^ $@ -$(OBJECT_DIR)/$(PLUGIN_NAME)/debug/lib$(PLUGIN_NAME).so: - mkdir -p $(OBJECT_DIR)/$(PLUGIN_NAME) - cargo build --target-dir $(OBJECT_DIR)/$(PLUGIN_NAME) +$(OBJECT_DIR)/$(PLUGIN_NAME)/$(TYPE)/lib$(PLUGIN_NAME).so: + @mkdir -p $(dir $@) + cargo build --release --target-dir $(OBJECT_DIR)/$(PLUGIN_NAME) diff --git a/dim_plugins/clock/Makefile b/dim_plugins/clock/Makefile index 15545f5..763e2d3 100644 --- a/dim_plugins/clock/Makefile +++ b/dim_plugins/clock/Makefile @@ -1,15 +1,14 @@ # Must match package name in Cargo.toml PLUGIN_NAME=clock - +# `target` or `debug` +TYPE=target build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim -$(PLUGIN_DIR)/$(PLUGIN_NAME).dim: $(OBJECT_DIR)/$(PLUGIN_NAME)/debug/lib$(PLUGIN_NAME).so - cp $(OBJECT_DIR)/$(PLUGIN_NAME)/debug/lib$(PLUGIN_NAME).so $(PLUGIN_DIR)/$(PLUGIN_NAME).dim +$(PLUGIN_DIR)/$(PLUGIN_NAME).dim: $(OBJECT_DIR)/$(PLUGIN_NAME)/$(TYPE)/lib$(PLUGIN_NAME).so + @mkdir -p $(dir $@) + cp $^ $@ -$(OBJECT_DIR)/$(PLUGIN_NAME)/debug/lib$(PLUGIN_NAME).so: - mkdir -p $(OBJECT_DIR)/$(PLUGIN_NAME) - cargo build --target-dir $(OBJECT_DIR)/$(PLUGIN_NAME) - - - +$(OBJECT_DIR)/$(PLUGIN_NAME)/$(TYPE)/lib$(PLUGIN_NAME).so: + @mkdir -p $(dir $@) + cargo build --release --target-dir $(OBJECT_DIR)/$(PLUGIN_NAME) diff --git a/dim_plugins/counter/Makefile b/dim_plugins/counter/Makefile index 22cd335..99d2764 100644 --- a/dim_plugins/counter/Makefile +++ b/dim_plugins/counter/Makefile @@ -1,15 +1,14 @@ # Must match package name in Cargo.toml PLUGIN_NAME=counter - +# `target` or `debug` +TYPE=target build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim -$(PLUGIN_DIR)/$(PLUGIN_NAME).dim: $(OBJECT_DIR)/$(PLUGIN_NAME)/debug/lib$(PLUGIN_NAME).so - cp $(OBJECT_DIR)/$(PLUGIN_NAME)/debug/lib$(PLUGIN_NAME).so $(PLUGIN_DIR)/$(PLUGIN_NAME).dim +$(PLUGIN_DIR)/$(PLUGIN_NAME).dim: $(OBJECT_DIR)/$(PLUGIN_NAME)/$(TYPE)/lib$(PLUGIN_NAME).so + @mkdir -p $(dir $@) + cp $^ $@ -$(OBJECT_DIR)/$(PLUGIN_NAME)/debug/lib$(PLUGIN_NAME).so: - mkdir -p $(OBJECT_DIR)/$(PLUGIN_NAME) - cargo build --target-dir $(OBJECT_DIR)/$(PLUGIN_NAME) - - - +$(OBJECT_DIR)/$(PLUGIN_NAME)/$(TYPE)/lib$(PLUGIN_NAME).so: + @mkdir -p $(dir $@) + cargo build --release --target-dir $(OBJECT_DIR)/$(PLUGIN_NAME) diff --git a/dim_plugins/example_rust/Makefile b/dim_plugins/example_rust/Makefile index 5c0a585..6de8e64 100644 --- a/dim_plugins/example_rust/Makefile +++ b/dim_plugins/example_rust/Makefile @@ -1,15 +1,13 @@ # Must match package name in Cargo.toml PLUGIN_NAME=example_rust - - +# `target` or `debug` +TYPE=target build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim -$(PLUGIN_DIR)/$(PLUGIN_NAME).dim: $(OBJECT_DIR)/$(PLUGIN_NAME)/debug/lib$(PLUGIN_NAME).so - cp $(OBJECT_DIR)/$(PLUGIN_NAME)/debug/lib$(PLUGIN_NAME).so $(PLUGIN_DIR)/$(PLUGIN_NAME).dim +$(PLUGIN_DIR)/$(PLUGIN_NAME).dim: $(OBJECT_DIR)/$(PLUGIN_NAME)/$(TYPE)/lib$(PLUGIN_NAME).so + @mkdir -p $(dir $@) + cp $^ $@ -$(OBJECT_DIR)/$(PLUGIN_NAME)/debug/lib$(PLUGIN_NAME).so: - mkdir -p $(OBJECT_DIR)/$(PLUGIN_NAME) - cargo build --target-dir $(OBJECT_DIR)/$(PLUGIN_NAME) - - - +$(OBJECT_DIR)/$(PLUGIN_NAME)/$(TYPE)/lib$(PLUGIN_NAME).so: + @mkdir -p $(dir $@) + cargo build --release --target-dir $(OBJECT_DIR)/$(PLUGIN_NAME) diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 0000000..bf867e0 --- /dev/null +++ b/rust-toolchain @@ -0,0 +1 @@ +nightly