1 # The default target of this Makefile is...
7 # make prefix=<path> install # Install git-cola
9 # make doc # Build documentation
10 # make prefix=<path> install-doc # Install documentation
14 # prefix - Installation prefix.
15 # DESTDIR - Temporary staging directory.
17 # The external commands used by this Makefile are...
28 # These values can be overridden on the command-line or via config.mak
31 python_version
:= $(shell $(PYTHON
) -c
'import sys; print("%s.%s" % sys.version_info[:2])')
32 python_lib
= python
$(python_version
)/site-packages
33 pythondir
= $(prefix)/lib
/$(python_lib
)
36 cola_app_base
= $(cola_base
).app
37 cola_app
= $(CURDIR
)/$(cola_app_base
)
38 cola_app_resources
= $(cola_app
)/Contents
/Resources
40 # Read $(VERSION) from cola/_version.py and strip quotes.
41 include cola
/_version.py
42 cola_version
:= $(subst ',,$(VERSION))
46 install_args += --root="$(DESTDIR)"
49 install_args += --prefix="$(prefix)"
50 install_args += --disable-pip-version-check
51 install_args += --ignore-installed
52 install_args += --no-deps
58 ALL_PYTHON_DIRS = $(PYTHON_DIRS)
67 $(PIP) install $(install_args) .
83 $(MAKE) -C docs install
87 $(MAKE) -C docs install-html
91 $(MAKE) -C docs install-man
95 $(RM) "$(DESTDIR)$(prefix)"/bin/cola
96 $(RM) "$(DESTDIR)$(prefix)"/bin/git-cola
97 $(RM) "$(DESTDIR)$(prefix)"/bin/git-cola-sequence-editor
98 $(RM) "$(DESTDIR)$(prefix)"/bin/git-dag
99 $(RM) "$(DESTDIR)$(prefix)"/share/applications/git-cola.desktop
100 $(RM) "$(DESTDIR)$(prefix)"/share/applications/git-cola-folder-handler.desktop
101 $(RM) "$(DESTDIR)$(prefix)"/share/applications/git-dag.desktop
102 $(RM) "$(DESTDIR)$(prefix)"/share/metainfo/git-dag.appdata.xml
103 $(RM) "$(DESTDIR)$(prefix)"/share/metainfo/git-cola.appdata.xml
104 $(RM) "$(DESTDIR)$(prefix)"/share/icons/hicolor/scalable/apps/git-cola.svg
105 $(RM_R) "$(DESTDIR)$(prefix)"/share/doc/git-cola
106 $(RM_R) "$(DESTDIR)$(pythondir)"/git_cola-*
107 $(RM_R) "$(DESTDIR)$(pythondir)"/cola
108 $(RMDIR) -p "$(DESTDIR)$(pythondir)" 2>/dev/null || true
109 $(RMDIR) "$(DESTDIR)$(prefix)"/share/applications 2>/dev/null || true
110 $(RMDIR) "$(DESTDIR)$(prefix)"/share/metainfo 2>/dev/null || true
111 $(RMDIR) "$(DESTDIR)$(prefix)"/share/doc 2>/dev/null || true
112 $(RMDIR) "$(DESTDIR)$(prefix)"/share/icons/hicolor/scalable/apps 2>/dev/null || true
113 $(RMDIR) "$(DESTDIR)$(prefix)"/share/icons/hicolor/scalable 2>/dev/null || true
114 $(RMDIR) "$(DESTDIR)$(prefix)"/share/icons/hicolor 2>/dev/null || true
115 $(RMDIR) "$(DESTDIR)$(prefix)"/share/icons 2>/dev/null || true
116 $(RMDIR) "$(DESTDIR)$(prefix)"/share 2>/dev/null || true
117 $(RMDIR) "$(DESTDIR)$(prefix)"/bin 2>/dev/null || true
118 $(RMDIR) "$(DESTDIR)$(prefix)" 2>/dev/null || true
122 $(FIND) $(ALL_PYTHON_DIRS) -name '*.py
[cod
]' -print0 | $(XARGS) -0 $(RM)
123 $(FIND) $(ALL_PYTHON_DIRS) -name __pycache__ -print0 | $(XARGS) -0 $(RM_R)
124 $(RM_R) build dist git-cola.app
125 $(MAKE) -C docs clean
127 # Build a git-cola.app bundle.
130 cola_full_version := $(shell ./bin/git-cola version --brief)
133 $(MKDIR_P) $(cola_app)/Contents/MacOS
134 $(MKDIR_P) $(cola_app_resources)
135 $(PYTHON) -m venv $(cola_app_resources)
136 $(cola_app_resources)/bin/pip install '.
[docs
,extras
,pyqt6
]'
137 $(CP) contrib/darwin/Info.plist contrib/darwin/PkgInfo $(cola_app)/Contents
138 ifneq ($(cola_full_version),)
139 sed -i -e s/0.0.0.0/$(cola_full_version)/ $(cola_app)/Contents/Info.plist
141 sed -i -e s/0.0.0/$(cola_version)/ $(cola_app)/Contents/Info.plist
142 $(CP) contrib/darwin/git-cola $(cola_app)/Contents/MacOS
143 $(CP) contrib/darwin/git-cola.icns $(cola_app)/Contents/Resources
144 $(MAKE) PIP=$(cola_app_resources)/bin/pip \
145 prefix=$(cola_app_resources) install
146 $(MAKE) SPHINXBUILD=$(cola_app_resources)/bin/sphinx-build \
147 prefix=$(cola_app_resources) install-doc
151 @if type garden >/dev/null 2>&1; then \
154 echo 'warning
: "make test" requires
"garden" https
://gitlab.com
/garden-rs
/garden
'; \
155 echo 'tip
: run
"cargo install garden-tools" to
install "garden".
'; \