From 582f3519f70332f88fea0055cdd1b2291e029a2e Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 18 Jun 2010 16:04:43 +0200 Subject: Rewrote INSTALL and "make (un)install" --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index fc5b1cf8..2f2417de 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,11 @@ NAME = ranger VERSION = $(shell cat README | grep -m 1 -o '[0-9][0-9.]\+') SNAPSHOT_NAME ?= $(NAME)-$(VERSION)-$(shell git rev-parse HEAD | cut -b 1-8).tar.gz -PYTHON ?= python +# Find suitable python version (need python >= 2.6 or 3.1): +PYTHON ?= $(shell python -c 'import sys; sys.exit(sys.version < "2.6")' && \ + which python || which python3.1 || which python3 || which python2.6) DOCDIR ?= doc/pydoc +DESTDIR ?= / PYOPTIMIZE ?= 1 BMCOUNT ?= 5 # how often to run the benchmarks? @@ -40,6 +43,13 @@ help: @echo 'make snapshot: Create a tar.gz of the current git revision' @echo 'make test: Run all unittests.' +install: + $(PYTHON) setup.py install --record=uninstall_info \ + '--root=$(DESTDIR)' --optimize=$(PYOPTIMIZE) + +uninstall: + cd $(DESTDIR) && cat $(CWD)/uninstall_info | xargs -d "\n" rm -- + compile: clean PYTHONOPTIMIZE=$(PYOPTIMIZE) $(PYTHON) -m compileall -q ranger @@ -66,4 +76,4 @@ bm: snapshot: git archive --prefix='$(NAME)-$(VERSION)/' --format=tar HEAD | gzip > $(SNAPSHOT_NAME) -.PHONY: default options compile clean doc cleandoc test bm snapshot +.PHONY: default options compile clean doc cleandoc test bm snapshot install uninstall -- cgit 1.4.1-2-gfad0