summary refs log tree commit diff stats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile47
1 files changed, 31 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index fd525721..8adae6a0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
+# Copyright (C) 2009, 2010, 2011  Roman Zimbelmann <romanz@lavabit.com>
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,16 +18,16 @@ VERSION = $(shell grep -m 1 -o '[0-9][0-9.]\+' README)
 SNAPSHOT_NAME ?= $(NAME)-$(VERSION)-$(shell git rev-parse HEAD | cut -b 1-8).tar.gz
 # 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)
+	which python || which python3.2 || which python3.1 || which python3 || \
+	which python2.6)
 SETUPOPTS ?= '--record=install_log.txt'
 DOCDIR ?= doc/pydoc
 DESTDIR ?= /
 PYOPTIMIZE ?= 1
-BMCOUNT ?= 5  # how often to run the benchmarks?
 
 CWD = $(shell pwd)
 
-default: compile
+default: test compile
 	@echo 'Run `make options` for a list of all options'
 
 options: help
@@ -38,12 +38,16 @@ options: help
 	@echo 'DOCDIR = $(DOCDIR)'
 
 help:
-	@echo 'make install: Install $(NAME)'
-	@echo 'make doc: Create the pydoc documentation'
-	@echo 'make clean: Remove the compiled files (*.pyc, *.pyo)'
+	@echo 'make:          Test and compile ranger.'
+	@echo 'make install:  Install $(NAME)'
+	@echo 'make clean:    Remove the compiled files (*.pyc, *.pyo)'
+	@echo 'make doc:      Create the pydoc documentation'
 	@echo 'make cleandoc: Remove the pydoc documentation'
+	@echo 'make man:      Compile the manpage with "pod2man"'
+	@echo 'make manhtml:  Compile the html manpage with "pod2html"'
 	@echo 'make snapshot: Create a tar.gz of the current git revision'
-	@echo 'make test: Run all unittests.'
+	@echo 'make test:     Test all testable modules of ranger'
+	@echo 'make todo:     Look for TODO and XXX markers in the source code'
 
 install:
 	$(PYTHON) setup.py install $(SETUPOPTS) \
@@ -53,7 +57,8 @@ compile: clean
 	PYTHONOPTIMIZE=$(PYOPTIMIZE) $(PYTHON) -m compileall -q ranger
 
 clean:
-	find . -regex .\*.py[co]\$$ -exec rm -f -- {} \;
+	find ranger -regex .\*.py[co]\$$ -delete
+	find ranger -depth -name __pycache__ -type d -exec rm -rf -- {} \;
 
 doc: cleandoc
 	mkdir -p $(DOCDIR)
@@ -63,16 +68,26 @@ doc: cleandoc
 		pydoc.writedocs("$(CWD)")'
 	find . -name \*.html -exec sed -i 's|'$(CWD)'|../..|g' -- {} \;
 
-cleandoc:
-	test -d $(DOCDIR) && rm -f -- $(DOCDIR)/*.html || true
-
 test:
-	@$(PYTHON) test/all_tests.py 1
+	@for FILE in $(shell grep -IHm 1 doctest -r ranger | cut -d: -f1); do \
+		echo "Testing $$FILE..."; \
+		PYTHONPATH=".:"$$PYTHONPATH ${PYTHON} $$FILE; \
+	done
+
+man:
+	pod2man --stderr --center='ranger manual' --date='$(NAME)-$(VERSION)' \
+		--release=$(shell date +%x) doc/ranger.pod doc/ranger.1
 
-bm:
-	@$(PYTHON) test/all_benchmarks.py $(BMCOUNT)
+manhtml:
+	pod2html doc/ranger.pod --outfile=doc/ranger.1.html
+
+cleandoc:
+	test -d $(DOCDIR) && rm -f -- $(DOCDIR)/*.html || true
 
 snapshot:
 	git archive --prefix='$(NAME)-$(VERSION)/' --format=tar HEAD | gzip > $(SNAPSHOT_NAME)
 
-.PHONY: default options compile clean doc cleandoc test bm snapshot install
+todo:
+	@grep --color -Ion '\(TODO\|XXX\).*' -r ranger
+
+.PHONY: default options compile clean doc cleandoc snapshot install man todo