1 # The default target of this Makefile is...
4 # The external commands used by this Makefile are...
25 FLAKE8_FLAGS
= --max-line-length
=80 --statistics
--doctests
--format
=pylint
26 PYLINT_FLAGS
= --py3k
--output-format
=colorized
--rcfile
=.pylintrc
28 # These values can be overridden on the command-line or via config.mak
30 bindir = $(prefix)/bin
31 datadir = $(prefix)/share
/git-cola
32 coladir
= $(datadir)/lib
33 hicolordir
= $(prefix)/share
/icons
/hicolor
/scalable
/apps
34 darwin_python
= /System
/Library
/Frameworks
/Python.framework
/Resources
/Python.app
/Contents
/MacOS
/Python
38 cola_app_base
= $(cola_base
).app
39 cola_app
= $(CURDIR
)/$(cola_app_base
)
40 cola_version
= $(shell $(PYTHON
) bin
/git-cola version
--brief
)
41 cola_dist
:= $(cola_base
)-$(cola_version
)
43 NOSE_FLAGS
= --with-doctest
44 NOSE_FLAGS
+= --with-id
45 NOSE_FLAGS
+= --exclude
=sphinxtogithub
46 NOSE_FLAGS
+= --exclude
=extras
47 # Allows "make test flags=--stop"
49 NOSE ?
= $(NOSETESTS
) $(NOSE_FLAGS
) $(flags
)
51 SETUP ?
= $(PYTHON
) setup.py
52 setup_args
+= --prefix=$(prefix)
55 setup_args
+= --install-scripts
=$(bindir)
56 setup_args
+= --record
=build
/MANIFEST
57 setup_args
+= --install-lib
=$(coladir
)
59 setup_args
+= --root
=$(DESTDIR
)
64 # If NO_VENDOR_LIBS is specified on the command line then pass it to setup.py
66 setup_args
+= --no-vendor-libs
72 ALL_PYTHON_DIRS
= $(PYTHON_DIRS
)
73 ALL_PYTHON_DIRS
+= extras
75 PYTHON_SOURCES
= bin
/git-cola
76 PYTHON_SOURCES
+= bin
/git-dag
77 PYTHON_SOURCES
+= share
/git-cola
/bin
/git-xbase
78 PYTHON_SOURCES
+= setup.py
91 $(SETUP
) install $(setup_args
)
92 $(MKDIR_P
) $(DESTDIR
)$(hicolordir
)
93 $(LN_S
) $(datadir)/icons
/git-cola.svg
$(DESTDIR
)$(hicolordir
)/git-cola.svg
94 $(LN_S
) git-cola
$(DESTDIR
)$(bindir)/cola
95 $(RM_R
) $(DESTDIR
)$(coladir
)/git_cola
*
96 $(RM_R
) git_cola.egg-info
99 # Maintainer's dist target
101 $(GIT
) archive
--format
=tar --prefix=$(cola_dist
)/ HEAD^
{tree
} | \
102 $(GZIP
) -f
-9 - >$(cola_dist
).
tar.gz
106 $(MAKE
) -C share
/doc
/git-cola
all
110 $(MAKE
) -C share
/doc
/git-cola html
114 $(MAKE
) -C share
/doc
/git-cola man
118 $(MAKE
) -C share
/doc
/git-cola
install
122 $(MAKE
) -C share
/doc
/git-cola install-html
126 $(MAKE
) -C share
/doc
/git-cola install-man
130 $(RM
) $(DESTDIR
)$(prefix)/bin
/git-cola
131 $(RM
) $(DESTDIR
)$(prefix)/bin
/git-dag
132 $(RM
) $(DESTDIR
)$(prefix)/bin
/cola
133 $(RM
) $(DESTDIR
)$(prefix)/share
/applications
/git-cola.desktop
134 $(RM
) $(DESTDIR
)$(prefix)/share
/applications
/git-cola-folder-handler.desktop
135 $(RM
) $(DESTDIR
)$(prefix)/share
/applications
/git-dag.desktop
136 $(RM
) $(DESTDIR
)$(prefix)/share
/icons
/hicolor
/scalable
/apps
/git-cola.svg
137 $(RM_R
) $(DESTDIR
)$(prefix)/share
/git-cola
138 $(RM_R
) $(DESTDIR
)$(prefix)/share
/doc
/git-cola
139 $(RM
) $(DESTDIR
)$(prefix)/share
/locale
/*/LC_MESSAGES
/git-cola.mo
140 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/locale
/*/LC_MESSAGES
2>/dev
/null
141 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/locale
/* 2>/dev
/null
142 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/locale
2>/dev
/null
143 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/doc
2>/dev
/null
144 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/applications
2>/dev
/null
145 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
2>/dev
/null
146 -$(RMDIR
) $(DESTDIR
)$(prefix)/bin
2>/dev
/null
147 -$(RMDIR
) $(DESTDIR
)$(prefix) 2>/dev
/null
151 $(NOSE
) $(PYTHON_DIRS
)
155 $(NOSE
) --with-coverage
--cover-package
=cola
$(PYTHON_DIRS
)
159 $(FIND
) $(ALL_PYTHON_DIRS
) -name
'*.py[cod]' -print0 | xargs
-0 rm -f
160 $(RM_R
) build
dist tags git-cola.app
162 $(MAKE
) -C share
/doc
/git-cola
clean
166 $(FIND
) $(ALL_PYTHON_DIRS
) -name
'*.py' -print0 | xargs
-0 $(CTAGS
) -f
tags
170 $(SETUP
) build_pot
-N
-d po
178 $(MKDIR_P
) $(cola_app
)/Contents
/MacOS
179 $(MKDIR_P
) $(cola_app
)/Contents
/Resources
180 $(CP
) contrib
/darwin
/Info.plist contrib
/darwin
/PkgInfo
$(cola_app
)/Contents
181 $(CP
) contrib
/darwin
/git-cola
$(cola_app
)/Contents
/MacOS
182 $(CP
) contrib
/darwin
/git-cola.icns
$(cola_app
)/Contents
/Resources
183 $(MAKE
) prefix=$(cola_app
)/Contents
/Resources
install install-doc
184 $(LN_S
) $(darwin_python
) $(cola_app
)/Contents
/Resources
/git-cola
187 app-tarball
: git-cola.app
188 $(TAR
) czf
$(cola_dist
).app.
tar.gz
$(cola_app_base
)
191 # Preview the markdown using "make README.html"
196 $(FLAKE8
) $(FLAKE8_FLAGS
) $(PYTHON_SOURCES
) $(PYTHON_DIRS
)
200 $(PYLINT
) $(PYLINT_FLAGS
) $(PYTHON_SOURCES
) $(ALL_PYTHON_DIRS
)
204 $(PIP
) install --requirement requirements.txt
205 $(PIP
) install --requirement extras
/requirements-dev.txt