defaults/apps.py: Add epdfview to default apps.py
[ranger.git] / Makefile
blobf13de38d8fa15811d3ebb9fb7b1979ffd2a7c06c
1 # Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com>
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 NAME = ranger
17 VERSION = $(shell grep -m 1 -o '[0-9][0-9.]\+' README)
18 SNAPSHOT_NAME ?= $(NAME)-$(VERSION)-$(shell git rev-parse HEAD | cut -b 1-8).tar.gz
19 # Find suitable python version (need python >= 2.6 or 3.1):
20 PYTHON ?= $(shell python -c 'import sys; sys.exit(sys.version < "2.6")' && \
21 which python || which python3.2 || which python3.1 || which python3 || \
22 which python2.6)
23 SETUPOPTS ?= '--record=install_log.txt'
24 DOCDIR ?= doc/pydoc
25 DESTDIR ?= /
26 PYOPTIMIZE ?= 1
28 CWD = $(shell pwd)
30 default: test compile
31 @echo 'Run `make options` for a list of all options'
33 options: help
34 @echo
35 @echo 'Options:'
36 @echo 'PYTHON = $(PYTHON)'
37 @echo 'PYOPTIMIZE = $(PYOPTIMIZE)'
38 @echo 'DOCDIR = $(DOCDIR)'
39 @echo 'DESTDIR = $(DESTDIR)'
41 help:
42 @echo 'make: Test and compile ranger.'
43 @echo 'make install: Install $(NAME)'
44 @echo 'make clean: Remove the compiled files (*.pyc, *.pyo)'
45 @echo 'make doc: Create the pydoc documentation'
46 @echo 'make cleandoc: Remove the pydoc documentation'
47 @echo 'make man: Compile the manpage with "pod2man"'
48 @echo 'make manhtml: Compile the html manpage with "pod2html"'
49 @echo 'make snapshot: Create a tar.gz of the current git revision'
50 @echo 'make test: Test all testable modules of ranger'
51 @echo 'make todo: Look for TODO and XXX markers in the source code'
53 install:
54 $(PYTHON) setup.py install $(SETUPOPTS) \
55 '--root=$(DESTDIR)' --optimize=$(PYOPTIMIZE)
57 compile: clean
58 PYTHONOPTIMIZE=$(PYOPTIMIZE) $(PYTHON) -m compileall -q ranger
60 clean:
61 find ranger -regex .\*.py[co]\$$ -delete
62 find ranger -depth -name __pycache__ -type d -exec rm -rf -- {} \;
64 doc: cleandoc
65 mkdir -p $(DOCDIR)
66 cd $(DOCDIR); \
67 $(PYTHON) -c 'import pydoc, sys; \
68 sys.path[0] = "$(CWD)"; \
69 pydoc.writedocs("$(CWD)")'
70 find . -name \*.html -exec sed -i 's|'$(CWD)'|../..|g' -- {} \;
72 test:
73 @for FILE in $(shell grep -IHm 1 doctest -r ranger | cut -d: -f1); do \
74 echo "Testing $$FILE..."; \
75 PYTHONPATH=".:"$$PYTHONPATH ${PYTHON} $$FILE; \
76 done
78 man:
79 pod2man --stderr --center='ranger manual' --date='$(NAME)-$(VERSION)' \
80 --release=$(shell date +%x) doc/ranger.pod doc/ranger.1
82 manhtml:
83 pod2html doc/ranger.pod --outfile=doc/ranger.1.html
85 cleandoc:
86 test -d $(DOCDIR) && rm -f -- $(DOCDIR)/*.html || true
88 snapshot:
89 git archive --prefix='$(NAME)-$(VERSION)/' --format=tar HEAD | gzip > $(SNAPSHOT_NAME)
91 todo:
92 @grep --color -Ion '\(TODO\|XXX\).*' -r ranger
94 .PHONY: clean cleandoc compile default doc help install man manhtml options snapshot test todo