From d249e40687d1daabce56c48bd109c339d961ac8e Mon Sep 17 00:00:00 2001 From: Tyler Weaver Date: Mon, 2 Apr 2018 08:20:52 -0600 Subject: [PATCH] Makefile: Fix make install for mac os and add uninstall. --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1278ac4..d023780 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: install install-lib phony test +.PHONY: install install-lib install-dir uninstall phony test WEECHAT_HOME ?= $(HOME)/.weechat PREFIX ?= $(WEECHAT_HOME) @@ -7,15 +7,21 @@ PYTHON ?= python lib := $(patsubst matrix/%.py, $(DESTDIR)$(PREFIX)/python/matrix/%.py, \ $(wildcard matrix/*.py)) -install: install-lib - install -Dm644 main.py $(DESTDIR)$(PREFIX)/python/matrix.py +install: install-dir install-lib + install -m644 main.py $(DESTDIR)$(PREFIX)/python/matrix.py install-lib: $(lib) +install-dir: + install -d $(DESTDIR)$(PREFIX)/python/matrix + +uninstall: + rm $(DESTDIR)$(PREFIX)/python/matrix.py $(DESTDIR)$(PREFIX)/python/matrix/* + rmdir $(DESTDIR)$(PREFIX)/python/matrix phony: $(DESTDIR)$(PREFIX)/python/matrix/%.py: matrix/%.py phony - install -Dm644 $< $@ + install -m644 $< $@ test: python3 -m pytest