1 # The default target of this Makefile is...
4 # The external commands used by this Makefile are...
19 PYTHON_CONFIG
= python-config
20 PYTHON_DARWIN_APP
= $(shell $(PYTHON_CONFIG
) --prefix)/Resources
/Python.app
/Contents
/MacOS
/Python
27 FLAKE8_FLAGS
= --max-line-length
=80 --statistics
--doctests
--format
=pylint
28 PYLINT_FLAGS
= --rcfile
=.pylintrc
30 PYLINT_FLAGS
+= --output-format
=colorized
33 # These values can be overridden on the command-line or via config.mak
35 bindir = $(prefix)/bin
36 datadir = $(prefix)/share
/git-cola
37 coladir
= $(datadir)/lib
38 hicolordir
= $(prefix)/share
/icons
/hicolor
/scalable
/apps
42 cola_app_base
= $(cola_base
).app
43 cola_app
= $(CURDIR
)/$(cola_app_base
)
44 cola_version
= $(shell $(PYTHON
) bin
/git-cola version
--brief
)
45 cola_dist
:= $(cola_base
)-$(cola_version
)
47 NOSE_FLAGS
= --with-doctest
48 NOSE_FLAGS
+= --with-id
49 NOSE_FLAGS
+= --exclude
=sphinxtogithub
50 NOSE_FLAGS
+= --exclude
=extras
51 # Allows "make test flags=--stop"
53 NOSE ?
= $(NOSETESTS
) $(NOSE_FLAGS
) $(flags
)
55 SETUP ?
= $(PYTHON
) setup.py
56 setup_args
+= --prefix=$(prefix)
59 setup_args
+= --install-scripts
=$(bindir)
60 setup_args
+= --record
=build
/MANIFEST
61 setup_args
+= --install-lib
=$(coladir
)
63 setup_args
+= --root
=$(DESTDIR
)
68 # If NO_VENDOR_LIBS is specified on the command line then pass it to setup.py
70 setup_args
+= --no-vendor-libs
76 ALL_PYTHON_DIRS
= $(PYTHON_DIRS
)
77 ALL_PYTHON_DIRS
+= extras
79 PYTHON_SOURCES
= bin
/git-cola
80 PYTHON_SOURCES
+= bin
/git-dag
81 PYTHON_SOURCES
+= share
/git-cola
/bin
/git-xbase
82 PYTHON_SOURCES
+= setup.py
95 $(SETUP
) install $(setup_args
)
96 $(MKDIR_P
) $(DESTDIR
)$(hicolordir
)
97 $(LN_S
) $(datadir)/icons
/git-cola.svg
$(DESTDIR
)$(hicolordir
)/git-cola.svg
98 $(LN_S
) git-cola
$(DESTDIR
)$(bindir)/cola
99 $(RM_R
) $(DESTDIR
)$(coladir
)/git_cola
*
100 $(RM_R
) git_cola.egg-info
103 # Maintainer's dist target
105 $(GIT
) archive
--format
=tar --prefix=$(cola_dist
)/ HEAD^
{tree
} | \
106 $(GZIP
) -f
-9 - >$(cola_dist
).
tar.gz
110 $(MAKE
) -C share
/doc
/git-cola
all
114 $(MAKE
) -C share
/doc
/git-cola html
118 $(MAKE
) -C share
/doc
/git-cola man
122 $(MAKE
) -C share
/doc
/git-cola
install
126 $(MAKE
) -C share
/doc
/git-cola install-html
130 $(MAKE
) -C share
/doc
/git-cola install-man
134 $(RM
) $(DESTDIR
)$(prefix)/bin
/git-cola
135 $(RM
) $(DESTDIR
)$(prefix)/bin
/git-dag
136 $(RM
) $(DESTDIR
)$(prefix)/bin
/cola
137 $(RM
) $(DESTDIR
)$(prefix)/share
/applications
/git-cola.desktop
138 $(RM
) $(DESTDIR
)$(prefix)/share
/applications
/git-cola-folder-handler.desktop
139 $(RM
) $(DESTDIR
)$(prefix)/share
/applications
/git-dag.desktop
140 $(RM
) $(DESTDIR
)$(prefix)/share
/appdata
/git-dag.appdata.xml
141 $(RM
) $(DESTDIR
)$(prefix)/share
/appdata
/git-cola.appdata.xml
142 $(RM
) $(DESTDIR
)$(prefix)/share
/icons
/hicolor
/scalable
/apps
/git-cola.svg
143 $(RM_R
) $(DESTDIR
)$(prefix)/share
/doc
/git-cola
144 $(RM_R
) $(DESTDIR
)$(prefix)/share
/git-cola
145 $(RM
) $(DESTDIR
)$(prefix)/share
/locale
/*/LC_MESSAGES
/git-cola.mo
146 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/applications
2>/dev
/null
147 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/appdata
2>/dev
/null
148 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/doc
2>/dev
/null
149 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/locale
/*/LC_MESSAGES
2>/dev
/null
150 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/locale
/* 2>/dev
/null
151 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/locale
2>/dev
/null
152 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/icons
/hicolor
/scalable
/apps
2>/dev
/null
153 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/icons
/hicolor
/scalable
2>/dev
/null
154 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/icons
/hicolor
2>/dev
/null
155 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/icons
2>/dev
/null
156 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
2>/dev
/null
157 -$(RMDIR
) $(DESTDIR
)$(prefix)/bin
2>/dev
/null
158 -$(RMDIR
) $(DESTDIR
)$(prefix) 2>/dev
/null
162 $(NOSE
) $(PYTHON_DIRS
)
166 $(NOSE
) --with-coverage
--cover-package
=cola
$(PYTHON_DIRS
)
170 $(FIND
) $(ALL_PYTHON_DIRS
) -name
'*.py[cod]' -print0 | xargs
-0 rm -f
171 $(RM_R
) build
dist tags git-cola.app
173 $(MAKE
) -C share
/doc
/git-cola
clean
177 $(FIND
) $(ALL_PYTHON_DIRS
) -name
'*.py' -print0 | xargs
-0 $(CTAGS
) -f
tags
186 git commit
-sm
'i18n: update translation template'
190 $(SETUP
) build_pot
--no-lang
--build-dir
=po
194 $(SETUP
) build_mo
--force
198 $(MKDIR_P
) $(cola_app
)/Contents
/MacOS
199 $(MKDIR_P
) $(cola_app
)/Contents
/Resources
200 $(CP
) contrib
/darwin
/Info.plist contrib
/darwin
/PkgInfo
$(cola_app
)/Contents
201 $(CP
) contrib
/darwin
/git-cola
$(cola_app
)/Contents
/MacOS
202 $(CP
) contrib
/darwin
/git-cola.icns
$(cola_app
)/Contents
/Resources
203 $(MAKE
) prefix=$(cola_app
)/Contents
/Resources
install install-doc
204 $(LN_S
) $(PYTHON_DARWIN_APP
) $(cola_app
)/Contents
/Resources
/git-cola
207 app-tarball
: git-cola.app
208 $(TAR
) czf
$(cola_dist
).app.
tar.gz
$(cola_app_base
)
211 # Preview the markdown using "make README.html"
216 $(FLAKE8
) $(FLAKE8_FLAGS
) $(PYTHON_SOURCES
) $(PYTHON_DIRS
)
220 $(PYLINT
) $(PYLINT_FLAGS
) --py3k
$(flags
) $(PYTHON_SOURCES
) $(ALL_PYTHON_DIRS
)
224 $(PYLINT
) $(PYLINT_FLAGS
) $(flags
) $(PYTHON_SOURCES
) $(ALL_PYTHON_DIRS
)
228 $(PYLINT
) $(PYLINT_FLAGS
) $(flags
) $(file
)
232 $(PIP
) install --requirement requirements
/requirements.txt
236 $(PIP
) install --requirement requirements
/requirements-dev.txt
237 .PHONY
: requirements-dev