1 # The default target of this Makefile is...
4 # The external commands used by this Makefile are...
24 FLAKE8_FLAGS
= --max-line-length
=80 --statistics
--doctests
--format
=pylint
25 PYLINT_FLAGS
= --py3k
--output-format
=colorized
--rcfile
=.pylintrc
27 # These values can be overridden on the command-line or via config.mak
29 bindir = $(prefix)/bin
30 datadir = $(prefix)/share
/git-cola
31 coladir
= $(datadir)/lib
32 hicolordir
= $(prefix)/share
/icons
/hicolor
/scalable
/apps
33 darwin_python
= /System
/Library
/Frameworks
/Python.framework
/Resources
/Python.app
/Contents
/MacOS
/Python
37 cola_app_base
= $(cola_base
).app
38 cola_app
= $(CURDIR
)/$(cola_app_base
)
39 cola_version
= $(shell $(PYTHON
) bin
/git-cola version
--brief
)
40 cola_dist
:= $(cola_base
)-$(cola_version
)
42 # Allows e.g. "make test flags=--stop"
44 NOSE ?
= $(NOSETESTS
) --with-doctest
--with-id
--exclude
=sphinxtogithub
$(flags
)
46 SETUP ?
= $(PYTHON
) setup.py
47 setup_args
+= --prefix=$(prefix)
50 setup_args
+= --install-scripts
=$(bindir)
51 setup_args
+= --record
=build
/MANIFEST
52 setup_args
+= --install-lib
=$(coladir
)
54 setup_args
+= --root
=$(DESTDIR
)
62 ALL_PYTHON_DIRS
= $(PYTHON_DIRS
)
63 ALL_PYTHON_DIRS
+= extras
65 PYTHON_SOURCES
= bin
/git-cola
66 PYTHON_SOURCES
+= bin
/git-dag
67 PYTHON_SOURCES
+= share
/git-cola
/bin
/git-xbase
68 PYTHON_SOURCES
+= setup.py
81 $(SETUP
) install $(setup_args
)
82 $(MKDIR_P
) $(DESTDIR
)$(hicolordir
)
83 $(LN_S
) $(datadir)/icons
/git-cola.svg
$(DESTDIR
)$(hicolordir
)/git-cola.svg
84 $(LN_S
) git-cola
$(DESTDIR
)$(bindir)/cola
85 $(RM_R
) $(DESTDIR
)$(coladir
)/git_cola
*
86 $(RM_R
) git_cola.egg-info
89 # Maintainer's dist target
91 $(GIT
) archive
--format
=tar --prefix=$(cola_dist
)/ HEAD^
{tree
} | \
92 $(GZIP
) -f
-9 - >$(cola_dist
).
tar.gz
96 $(MAKE
) -C share
/doc
/git-cola
all
100 $(MAKE
) -C share
/doc
/git-cola html
104 $(MAKE
) -C share
/doc
/git-cola man
108 $(MAKE
) -C share
/doc
/git-cola
install
112 $(MAKE
) -C share
/doc
/git-cola install-html
116 $(MAKE
) -C share
/doc
/git-cola install-man
120 $(RM
) $(DESTDIR
)$(prefix)/bin
/git-cola
121 $(RM
) $(DESTDIR
)$(prefix)/bin
/git-dag
122 $(RM
) $(DESTDIR
)$(prefix)/bin
/cola
123 $(RM
) $(DESTDIR
)$(prefix)/share
/applications
/git-cola.desktop
124 $(RM
) $(DESTDIR
)$(prefix)/share
/applications
/git-cola-folder-handler.desktop
125 $(RM
) $(DESTDIR
)$(prefix)/share
/applications
/git-dag.desktop
126 $(RM
) $(DESTDIR
)$(prefix)/share
/icons
/hicolor
/scalable
/apps
/git-cola.svg
127 $(RM_R
) $(DESTDIR
)$(prefix)/share
/git-cola
128 $(RM_R
) $(DESTDIR
)$(prefix)/share
/doc
/git-cola
129 $(RM
) $(DESTDIR
)$(prefix)/share
/locale
/*/LC_MESSAGES
/git-cola.mo
130 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/locale
/*/LC_MESSAGES
2>/dev
/null
131 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/locale
/* 2>/dev
/null
132 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/locale
2>/dev
/null
133 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/doc
2>/dev
/null
134 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
/applications
2>/dev
/null
135 -$(RMDIR
) $(DESTDIR
)$(prefix)/share
2>/dev
/null
136 -$(RMDIR
) $(DESTDIR
)$(prefix)/bin
2>/dev
/null
137 -$(RMDIR
) $(DESTDIR
)$(prefix) 2>/dev
/null
141 $(NOSE
) $(PYTHON_DIRS
)
145 $(NOSE
) --with-coverage
--cover-package
=cola
$(PYTHON_DIRS
)
149 $(FIND
) $(ALL_PYTHON_DIRS
) -name
'*.py[cod]' -print0 | xargs
-0 rm -f
150 $(RM_R
) build
dist tags git-cola.app
152 $(MAKE
) -C share
/doc
/git-cola
clean
156 $(FIND
) $(ALL_PYTHON_DIRS
) -name
'*.py' -print0 | xargs
-0 $(CTAGS
) -f
tags
160 $(SETUP
) build_pot
-N
-d po
168 $(MKDIR_P
) $(cola_app
)/Contents
/MacOS
169 $(MKDIR_P
) $(cola_app
)/Contents
/Resources
170 $(CP
) contrib
/darwin
/Info.plist contrib
/darwin
/PkgInfo
$(cola_app
)/Contents
171 $(CP
) contrib
/darwin
/git-cola
$(cola_app
)/Contents
/MacOS
172 $(CP
) contrib
/darwin
/git-cola.icns
$(cola_app
)/Contents
/Resources
173 $(MAKE
) prefix=$(cola_app
)/Contents
/Resources
install install-doc
174 $(LN_S
) $(darwin_python
) $(cola_app
)/Contents
/Resources
/git-cola
177 app-tarball
: git-cola.app
178 $(TAR
) czf
$(cola_dist
).app.
tar.gz
$(cola_app_base
)
181 # Preview the markdown using "make README.html"
186 $(FLAKE8
) $(FLAKE8_FLAGS
) $(PYTHON_SOURCES
) $(PYTHON_DIRS
)
190 $(PYLINT
) $(PYLINT_FLAGS
) $(PYTHON_SOURCES
) $(ALL_PYTHON_DIRS
)