Commit c1f3fa64a9

c1f3fa64a9829a6cbbea06711fbc48002c3c7db9

parent: b351239335

Unsigned

Jakub Panek <me@panekj.dev> · 2025-09-16 07:57 UTC

docs: update README to include dev/release builds instructions

Layout: unified · split

Makefile +17 −7
@@ -2,18 +2,28 @@
22XDG_DATA_HOME ?= $(HOME)/.local/share
33WEECHAT_DATA_DIR ?= $(XDG_DATA_HOME)/weechat
44
5SOURCES := $(wildcard src/*.rs src/commands/*.rs Cargo.lock)
5SOURCES := $(wildcard src/*.rs src/bar_items/*.rs src/commands/*.rs src/room/*.rs Cargo.lock)
66
7.PHONY: install install-dir lint
7PROFILE ?= release
88
9target/debug/libmatrix.so: $(SOURCES)
9.PHONY: install install-dir lint all help
10
11all: help
12
13help: ## 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
16target/debug/libmatrix.so: $(SOURCES) ## Build plugin in dev profile
1017 cargo build
1118
12install: install-dir target/debug/libmatrix.so
13 install -m644 target/debug/libmatrix.so $(DESTDIR)$(WEECHAT_DATA_DIR)/plugins/matrix.so
19target/release/libmatrix.so: $(SOURCES) ## Build plugin release profile
20 cargo build --release
21
22install: 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
1424
15install-dir:
25install-dir: ## Create plugins directory
1626 install -d $(DESTDIR)$(WEECHAT_DATA_DIR)/plugins
1727
18lint:
28lint: ## Lint issues with clippy
1929 cargo clippy
README.md +6 −2
@@ -24,14 +24,18 @@ If you are interested in helping out take a look at the issue tracker.
2424
2525After Rust is installed the plugin can be compiled with:
2626
27 cargo build --release
28
29If you are developing on weechat-matrix-rs, use debug builds which are faster at the expense of plugin performance:
30
2731 cargo build
2832
29On Linux this creates a `libmatrix.so` file in the `target/debug/` folder, this
33On Linux this creates a `libmatrix.so` file in the `target/release/` (`target/debug` for dev builds) folder, this
3034file needs to be renamed to `matrix.so` and copied to your Weechat plugin
3135directory. A plugin directory can be created in your `$WEECHAT_HOME` folder, by
3236default `.weechat/plugins/`.
3337
34Alternatively, `make install` will build and install the plugin in your
38Alternatively, `make install` (`make install PROFILE=debug` for dev build) will build and install the plugin in your
3539`$WEECHAT_HOME` as well.
3640
3741# Configuration