Commit c1f3fa64a9
Unsigned
Layout: unified · split
Makefile +17 −7
| @@ -2,18 +2,28 @@ | ||
| 2 | 2 | XDG_DATA_HOME ?= $(HOME)/.local/share |
| 3 | 3 | WEECHAT_DATA_DIR ?= $(XDG_DATA_HOME)/weechat |
| 4 | 4 | |
| 5 | SOURCES := $(wildcard src/*.rs src/commands/*.rs Cargo.lock) | |
| 5 | SOURCES := $(wildcard src/*.rs src/bar_items/*.rs src/commands/*.rs src/room/*.rs Cargo.lock) | |
| 6 | 6 | |
| 7 | .PHONY: install install-dir lint | |
| 7 | PROFILE ?= release | |
| 8 | 8 | |
| 9 | target/debug/libmatrix.so: $(SOURCES) | |
| 9 | .PHONY: install install-dir lint all help | |
| 10 | ||
| 11 | all: help | |
| 12 | ||
| 13 | help: ## Print this help message | |
| 14 | @grep -E '^[a-zA-Z._-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | |
| 15 | ||
| 16 | target/debug/libmatrix.so: $(SOURCES) ## Build plugin in dev profile | |
| 10 | 17 | cargo build |
| 11 | 18 | |
| 12 | install: install-dir target/debug/libmatrix.so | |
| 13 | install -m644 target/debug/libmatrix.so $(DESTDIR)$(WEECHAT_DATA_DIR)/plugins/matrix.so | |
| 19 | target/release/libmatrix.so: $(SOURCES) ## Build plugin release profile | |
| 20 | cargo build --release | |
| 21 | ||
| 22 | install: install-dir target/$(PROFILE)/libmatrix.so ## Install plugin to weechat dir | |
| 23 | install -m644 target/$(PROFILE)/libmatrix.so $(DESTDIR)$(WEECHAT_DATA_DIR)/plugins/matrix.so | |
| 14 | 24 | |
| 15 | install-dir: | |
| 25 | install-dir: ## Create plugins directory | |
| 16 | 26 | install -d $(DESTDIR)$(WEECHAT_DATA_DIR)/plugins |
| 17 | 27 | |
| 18 | lint: | |
| 28 | lint: ## Lint issues with clippy | |
| 19 | 29 | cargo clippy |
README.md +6 −2
| @@ -24,14 +24,18 @@ If you are interested in helping out take a look at the issue tracker. | ||
| 24 | 24 | |
| 25 | 25 | After Rust is installed the plugin can be compiled with: |
| 26 | 26 | |
| 27 | cargo build --release | |
| 28 | ||
| 29 | If you are developing on weechat-matrix-rs, use debug builds which are faster at the expense of plugin performance: | |
| 30 | ||
| 27 | 31 | cargo build |
| 28 | 32 | |
| 29 | On Linux this creates a `libmatrix.so` file in the `target/debug/` folder, this | |
| 33 | On Linux this creates a `libmatrix.so` file in the `target/release/` (`target/debug` for dev builds) folder, this | |
| 30 | 34 | file needs to be renamed to `matrix.so` and copied to your Weechat plugin |
| 31 | 35 | directory. A plugin directory can be created in your `$WEECHAT_HOME` folder, by |
| 32 | 36 | default `.weechat/plugins/`. |
| 33 | 37 | |
| 34 | Alternatively, `make install` will build and install the plugin in your | |
| 38 | Alternatively, `make install` (`make install PROFILE=debug` for dev build) will build and install the plugin in your | |
| 35 | 39 | `$WEECHAT_HOME` as well. |
| 36 | 40 | |
| 37 | 41 | # Configuration |