Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 115 lines (90 sloc) 3.059 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
# The default target of this Makefile is...
all::

# The external commands used by this Makefile are...
GIT = git
NOSETESTS = nosetests
PYTHON = python
TAR = tar

# These values can be overridden on the command-line or via config.mak
prefix = $(HOME)
bindir = $(prefix)/bin
# DESTDIR =

cola_app = git-cola.app
cola_version = $(shell env TERM=dummy $(PYTHON) cola/version.py)
cola_dist := cola-$(cola_version)

python_path = $(CURDIR):$(CURDIR)/thirdparty:$(PYTHONPATH)
python_version = $(shell env TERM=dummy $(PYTHON) -c 'import distutils.sysconfig as sc; print(sc.get_python_version())')
python_site := $(prefix)/lib*/python$(python_version)/site-packages

test_flags =
all_test_flags = --with-doctest $(test_flags)

# User customizations
-include config.mak

ifdef standalone
standalone_args ?= --standalone
endif


all::
$(PYTHON) setup.py build

install: all
$(PYTHON) setup.py --quiet install \
$(standalone_args) \
--prefix=$(DESTDIR)$(prefix) \
--install-scripts=$(DESTDIR)$(bindir) \
--force && \
rm -f $(DESTDIR)$(python_site)/git_cola*
rmdir -p $(DESTDIR)$(python_site) 2>/dev/null || true
(cd $(DESTDIR)$(bindir) && \
! test -e cola && ln -s git-cola cola) || true

# Maintainer's dist target
dist: all
$(GIT) archive --format=tar --prefix=$(cola_dist)/ HEAD^{tree} \
>$(cola_dist).tar
mkdir -p $(cola_dist)/cola
cp cola/builtin_version.py $(cola_dist)/cola
echo $(cola_version) > $(cola_dist)/version
$(TAR) rf $(cola_dist).tar \
$(cola_dist)/version \
$(cola_dist)/cola/builtin_version.py
rm -r $(cola_dist)
gzip -f -9 $(cola_dist).tar

doc:
$(MAKE) -C share/doc/git-cola prefix=$(prefix) all

html:
$(MAKE) -C share/doc/git-cola prefix=$(prefix) html

install-doc:
$(MAKE) -C share/doc/git-cola prefix=$(prefix) install

install-html:
$(MAKE) -C share/doc/git-cola prefix=$(prefix) install-html

uninstall:
rm -rf $(DESTDIR)$(prefix)/bin/git-cola \
$(DESTDIR)$(prefix)/bin/cola \
$(DESTDIR)$(prefix)/share/applications/cola.desktop \
$(DESTDIR)$(prefix)/share/git-cola \
$(DESTDIR)$(prefix)/share/doc/git-cola

test: all
@env PYTHONPATH=$(python_path) \
$(NOSETESTS) $(all_test_flags)

coverage:
@env PYTHONPATH=$(python_path) \
$(NOSETESTS) --with-coverage --cover-package=cola $(all_test_flags)

clean:
$(MAKE) -C share/doc/git-cola clean
find . -name .noseids -print0 | xargs -0 rm -f
find . -name '*.py[co]' -print0 | xargs -0 rm -f
rm -rf build dist tmp tags git-cola.app
rm -rf share/locale

tags:
find . -name '*.py' -print0 | xargs -0 ctags -f tags

pot:
$(PYTHON) setup.py build_pot -N -d .

mo:
$(PYTHON) setup.py build_mo -f

git-cola.app:
mkdir -p $(cola_app)/Contents/MacOS
cp darwin/git-cola $(cola_app)/Contents/MacOS
cp darwin/Info.plist darwin/PkgInfo $(cola_app)/Contents
$(MAKE) prefix=$(cola_app)/Contents/Resources install
cp darwin/git-cola.icns $(cola_app)/Contents/Resources

app-tarball: git-cola.app
$(TAR) czf git-cola-$(cola_version).app.tar.gz $(cola_app)

.PHONY: all install doc install-doc install-html test clean tags
.PHONY: git-cola.app app-tarball
Something went wrong with that request. Please try again.