This instance will be upgraded to Heptapod 0.21.0rc2 on 2021-04-16 at 11:00 UTC+2 (a few minutes of down time)

Makefile 2.58 KB
Newer Older
1
FAKEROOT = fakeroot
2
PYTHON = python
3
PYTYPE = pytype
4
RSYNC = rsync
5 6 7 8 9 10 11 12 13 14 15

HGPATH =
ifneq ($(HGPATH),)
export PYTHONPATH := $(realpath $(HGPATH)):$(PYTHONPATH)
endif

.PHONY: help
help:
	@echo 'Commonly used make targets:'
	@echo '  local        - build for inplace usage'
	@echo '  tests        - run all tests in the automatic test suite'
16
	@echo '  app          - create a py2app bundle on Mac OS X'
17
	@echo '  tarball      - create release tarball'
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
	@echo '  clean        - remove files created by other targets'
	@echo '                 (except installed files or dist source tarball)'
	@echo '  distclean    - remove all files created by other targets'
	@echo '  update-pot   - extract translatable strings'

.PHONY: local
local:
	$(PYTHON) setup.py \
		build_ui \
		build_py -c -d . \
		build_mo
	HGRCPATH= $(PYTHON) thg version

.PHONY: tests
tests:
33 34
	@[ -n "$(HGPATH)" ] || { echo "HGPATH not specified"; false; }
	@[ -d "$(HGPATH)" ] || { echo "HGPATH not found: $(HGPATH)"; false; }
35 36
	$(PYTHON) tests/run-tests.py -m 'not largefiles' --doctest-modules tests
	$(PYTHON) tests/run-tests.py -m largefiles tests
37 38
	$(PYTHON) tests/run-hgtests.py

39 40 41 42 43
.PHONY: pytype
pytype: PYTHON_VERSION = 3.7
pytype:
	@[ -n "$(HGPATH)" ] || { echo "HGPATH not specified"; false; }
	@[ -d "$(HGPATH)" ] || { echo "HGPATH not found: $(HGPATH)"; false; }
44
	$(PYTYPE) -P ".:$(HGPATH)" -V "$(PYTHON_VERSION)" --config pytype.cfg
45 46 47
	@echo 'pytype crashed while generating the following type stubs:'
	find .pytype/pyi -name '*.pyi' | xargs grep -l '# Caught error' | sort

48 49 50
.PHONY: app
app: DISTDIR = dist/app
app: SETUPCFG = contrib/setup-py2app.cfg
51
app: export MACOSX_DEPLOYMENT_TARGET=10.7
52
app:
53 54
	@[ -n "$(HGPATH)" ] || { echo "HGPATH not specified"; false; }
	@[ -d "$(HGPATH)" ] || { echo "HGPATH not found: $(HGPATH)"; false; }
55 56 57 58
	[ -z "$(SETUPCFG)" ] || cp "$(SETUPCFG)" setup.cfg
	$(MAKE) -C "$(HGPATH)" local
	FORCE_SETUPTOOLS= $(PYTHON) setup.py py2app -d "$(DISTDIR)"

59 60 61 62
.PHONY: tarball
tarball:
	$(FAKEROOT) $(PYTHON) setup.py sdist
	@echo
63 64 65 66 67 68
	@echo '** Maybe you need to run "make upload-tarballs"'

.PHONY: upload-tarballs
upload-tarballs:
	$(RSYNC) -rtv --include 'tortoisehg-*.tar.gz' --exclude '*' \
		dist/ mercurial-scm.org:/var/www/release/tortoisehg/targz/
69

70 71 72
.PHONY: clean
clean:
	$(PYTHON) setup.py clean
73
	$(RM) -R .pytype
74 75 76 77 78 79 80 81

.PHONY: distclean
distclean: clean
	$(RM) -R build dist

.PHONY: update-pot
update-pot:
	$(PYTHON) setup.py update_pot
82 83 84 85 86 87

docker-centos6:
	$(MAKE) -C contrib/docker build-thg-rpm PLATFORM=centos6

docker-centos7:
	$(MAKE) -C contrib/docker build-thg-rpm PLATFORM=centos7
88 89 90

docker-centos8:
	$(MAKE) -C contrib/docker build-thg-rpm PLATFORM=centos8