File: Makefile

package info (click to toggle)
weechat-matrix 0.3.0-3.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 808 kB
  • sloc: python: 7,992; makefile: 27
file content (35 lines) | stat: -rw-r--r-- 971 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.PHONY: install install-lib install-dir uninstall phony test typecheck

WEECHAT_HOME ?= $(HOME)/.weechat
PREFIX ?= $(WEECHAT_HOME)

INSTALLDIR := $(DESTDIR)$(PREFIX)/python/matrix

lib := $(patsubst matrix/%.py, $(INSTALLDIR)/%.py, \
	 $(wildcard matrix/*.py))

.PHONY: help
help:
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

install: install-lib | $(INSTALLDIR) ## Install the plugin to $(DESTDIR)/$(PREFIX)
	install -m644 main.py $(DESTDIR)$(PREFIX)/python/matrix.py

install-lib: $(lib)
$(INSTALLDIR):
	install -d $@

uninstall: ## Uninstall the plugin from $(PREFIX)
	rm $(DESTDIR)$(PREFIX)/python/matrix.py $(INSTALLDIR)/*
	rmdir $(INSTALLDIR)

phony:

$(INSTALLDIR)/%.py: matrix/%.py phony | $(INSTALLDIR)
	install -m644 $< $@

test: ## Run automated tests
	python3 -m pytest

typecheck: ## Run type check
	mypy -p matrix --ignore-missing-imports --warn-redundant-casts