weechat-matrix/Makefile

36 lines
971 B
Makefile
Raw Normal View History

2019-01-23 16:39:19 +01:00
.PHONY: install install-lib install-dir uninstall phony test typecheck
2018-01-30 10:56:29 +01:00
WEECHAT_HOME ?= $(HOME)/.weechat
PREFIX ?= $(WEECHAT_HOME)
2020-07-03 15:46:11 +02:00
INSTALLDIR := $(DESTDIR)$(PREFIX)/python/matrix
lib := $(patsubst matrix/%.py, $(INSTALLDIR)/%.py, \
2018-01-30 10:56:29 +01:00
$(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}'
2020-07-03 15:46:11 +02:00
install: install-lib | $(INSTALLDIR) ## Install the plugin to $(DESTDIR)/$(PREFIX)
install -m644 main.py $(DESTDIR)$(PREFIX)/python/matrix.py
2018-01-30 10:56:29 +01:00
install-lib: $(lib)
2020-07-03 15:46:11 +02:00
$(INSTALLDIR):
install -d $@
uninstall: ## Uninstall the plugin from $(PREFIX)
2020-07-03 15:46:11 +02:00
rm $(DESTDIR)$(PREFIX)/python/matrix.py $(INSTALLDIR)/*
rmdir $(INSTALLDIR)
2018-01-30 10:56:29 +01:00
2018-01-31 13:56:31 +01:00
phony:
2020-07-03 15:46:11 +02:00
$(INSTALLDIR)/%.py: matrix/%.py phony | $(INSTALLDIR)
install -m644 $< $@
test: ## Run automated tests
2018-03-18 23:30:45 +01:00
python3 -m pytest
2018-09-12 20:13:32 +02:00
typecheck: ## Run type check
2018-09-12 20:13:32 +02:00
mypy -p matrix --ignore-missing-imports --warn-redundant-casts