views: Add revselect for selecting revisions
[git-cola.git] / Makefile
blob95512f2b92a1151f2836d09a032786a264d50b1d
1 prefix ?= $(HOME)
2 PYTHON ?= python
3 PYTHON_VER ?= $(shell $(PYTHON) -c 'import platform; print platform.python_version()[:3]')
4 PYTHON_SITE ?= $(DESTDIR)$(prefix)/lib/python$(PYTHON_VER)/site-packages
5 COLA_VERSION ?= $(shell git describe --match='v*.*' | sed -e s/v//)
6 APP ?= git-cola.app
7 APPZIP ?= $(shell darwin/name-tarball.py)
8 TAR ?= tar
9 TEST_PYTHONPATH ?= "$(CURDIR)":"$(CURDIR)/thirdparty":"$(PYTHONPATH)"
11 # User customizations
12 -include config.mak
14 ifdef standalone
15 standalone_args ?= --standalone
16 endif
18 all:
19 $(PYTHON) setup.py build
21 darwin: all
22 $(PYTHON) darwin/py2app-setup.py py2app
24 $(APP): darwin
25 rm -rf $(APP)
26 mv dist/$(APP) $(CURDIR)
27 find $(APP) -name '*_debug*' | xargs rm -f
28 tar cjf $(APPZIP) $(APP)
30 install: all
31 $(PYTHON) setup.py --quiet install \
32 $(standalone_args) \
33 --install-scripts=$(DESTDIR)$(prefix)/bin \
34 --prefix=$(DESTDIR)$(prefix) \
35 --force && \
36 rm -f $(PYTHON_SITE)/git_cola*
37 rmdir -p $(PYTHON_SITE) 2>/dev/null || true
38 (cd $(DESTDIR)$(prefix)/bin && \
39 ! test -e cola && ln -s git-cola cola) || true
41 # Maintainer's dist target
42 COLA_TARNAME ?= cola-$(COLA_VERSION)
43 dist: all
44 git archive --format=tar \
45 --prefix=$(COLA_TARNAME)/ HEAD^{tree} > $(COLA_TARNAME).tar
46 @mkdir -p $(COLA_TARNAME)/cola
47 @cp cola/builtin_version.py $(COLA_TARNAME)/cola
48 @cp cola/builtin_version.py $(COLA_TARNAME)/version
49 $(TAR) rf $(COLA_TARNAME).tar \
50 $(COLA_TARNAME)/version \
51 $(COLA_TARNAME)/cola/builtin_version.py
52 @$(RM) -r $(COLA_TARNAME)
53 gzip -f -9 $(COLA_TARNAME).tar
55 doc:
56 $(MAKE) -C share/doc/git-cola prefix=$(prefix) all
58 html:
59 $(MAKE) -C share/doc/git-cola prefix=$(prefix) html
61 install-doc:
62 $(MAKE) -C share/doc/git-cola prefix=$(prefix) install
64 install-html:
65 $(MAKE) -C share/doc/git-cola prefix=$(prefix) install-html
67 uninstall:
68 rm -rf $(DESTDIR)$(prefix)/bin/git-cola \
69 $(DESTDIR)$(prefix)/bin/cola \
70 $(DESTDIR)$(prefix)/share/applications/cola.desktop \
71 $(DESTDIR)$(prefix)/share/git-cola \
72 $(DESTDIR)$(prefix)/share/doc/git-cola
74 test_flags :=
75 all_test_flags ?= --with-doctest $(test_flags)
77 test: all
78 @env PYTHONPATH="$(TEST_PYTHONPATH)" \
79 nosetests $(all_test_flags)
81 coverage:
82 @env PYTHONPATH="$(TEST_PYTHONPATH)" \
83 nosetests --with-coverage --cover-package=cola $(all_test_flags)
85 clean:
86 $(MAKE) -C share/doc/git-cola clean
87 find . -name .noseids -print0 | xargs -0 rm -f
88 find . -name '*.py[co]' -print0 | xargs -0 rm -f
89 rm -rf cola/builtin_version.* build dist tmp tags git-cola.app
90 rm -rf share/locale
92 tags:
93 ctags cola/*.py cola/*/*.py test/*.py
95 pot:
96 $(PYTHON) setup.py build_pot -N -d .
98 mo:
99 $(PYTHON) setup.py build_mo -f
101 .PHONY: all install doc install-doc install-html test clean darwin git-cola.app tags