Makefile
author Boris Feld <boris.feld@octobus.net>
Fri, 07 Sep 2018 11:18:45 -0400
changeset 39523 b66ea3fc3a86
parent 38853 4ca5932065ca
child 40632 d0a6b2c8f8b6
permissions -rw-r--r--
sparse-revlog: set max delta chain length to on thousand The new snapshot system used in the sparse-revlog case gave us some small size benefit so far. However its most important property is to gracefully handle harder limit on delta chainlength. Long delta chain has a very detrimental impact on read (and write) performance in revlog. Being able to shorter them provide a great boost. However, shorting delta used to result significantly lower compression ratio. The intermediate snapshots effectively suppress most of this effect (even all in some case). # Effect on the test repository The repository we use for test is not "realistic" but can still show this in action using an unreasonably low chain limit. Limiting the chain length show a sizeable increase but stay under control: +6% for limit=15; +15% for limit=10. Without the snapshot system the increase is significantly bigger: +45% for limit=15; +80% for limit=10. Even slightly larger than without delta chain limit, the resulting size is still smaller than before we started doing snapshots. Here is a table for comparison. *Since the repository is not branchy, the initial sparse-revlog version does not bring much benefit compare to the non-sparse one): chain length limit | none | limit=15 | limit=10 | without sparse-revlog | 62 818 987 | 112 664 615 | 131 222 574 | without snapshot | 74 365 490 | 108 211 410 | 133 857 764 | with snapshot | 59 230 936 | 63 002 924 | 68 415 329 | # Effect On Real Life Repositories The series provides significant benefits on all kind of repositories. Using `hg debugupgraderepo -o redeltaparent --run`, we recomputed delta chain for various repositories with different settings: - delta chain length: unlimited or 1000 limit - sparse-revlog: enabled or disabled - this series: applied or not applied We can observe multiple types of effect: - On very branchy repositories: * The delta chain limit as low impact on the repo size. * Intermediate snapshot greatly reduces manifest size: - pypy: -80% - netbeans: -95% * The delta chain limit is effective, without a size impact: - netbeans average: 613 -> 282 - private #1 average: 1 068 -> 307 - On more linear repository: * Intermediate snapshot limit the impact of delta chain limit: - mozilla: without the series: +360% with the series: +25% * The delta chain limit provides large improvement: - mozilla's average chain length: unlimited: 15 338 limited: 469 * Despite the chain length limit, the manifest size is reduced: - mercurial: -25% - mozilla: -30% It is clear that the use of chains of intermediate snapshots provide large benefits both in storage size and delta chains quality. We should now switch our effort toward making sure the write performance are acceptable. Then, `sparse-revlog` will be a suitable format for all new repository. # Raw Statistic * no-sparse: general delta repository not using sparse-revlog * no-snapshot: sparse-revlog repository not using this series * snapshot: sparse-revlog repository using this series mercurial Manifest Size: limit | none | 1000 ------------|-------------|------------ no-sparse | 8 021 373 | 8 199 366 no-snapshot | 8 103 561 | 8 259 719 snapshot | 6 137 116 | 6 126 433 Manifest Chain length data limit || none || 1000 || value || average | max || average | max || ------------||---------|---------||---------|---------|| no-sparse || 307 | 1456 || 279 | 1000 || no-snapshot || 312 | 1456 || 283 | 1000 || snapshot || 248 | 1208 || 241 | 1000 || Full Store Size limit | none | 1000 ------------|-------------|------------ no-sparse | 51 013 198 | 51 201 574 no-snapshot | 50 930 795 | 51 141 006 snapshot | 48 072 037 | 48 093 572 pypy Manifest Size: limit | none | 1000 ------------|-------------|------------ no-sparse | 193 987 784 | 193 987 784 no-snapshot | 163 171 745 | 163 312 229 snapshot | 34 605 900 | 34 600 750 Manifest Chain length data limit || none || 1000 || value || average | max || average | max || ------------||---------|---------||---------|---------|| no-sparse || 101 | 692 || 101 | 692 || no-snapshot || 151 | 1307 || 148 | 1000 || snapshot || 128 | 1309 || 125 | 1000 || Full Store Size limit | none | 1000 ------------|-------------|------------ no-sparse | 495 931 473 | 495 931 473 no-snapshot | 465 441 017 | 465 581 501 snapshot | 355 467 301 | 355 472 451 Mozilla Manifest Size: limit | none | 1000 ------------|----------------|--------------- no-sparse | 416 757 148 | 1 869 009 668 no-snapshot | 401 592 370 | 1 843 493 795 snapshot | 224 359 521 | 284 615 500 Manifest Chain length data limit || none || 1000 || value || average | max || average | max || ------------||---------|---------||---------|---------|| no-sparse || 15 333 | 58 980 || 468 | 1 000 || no-snapshot || 15 336 | 58 980 || 469 | 1 000 || snapshot || 15 338 | 58 983 || 469 | 1 000 || Full Store Size limit | none | 1000 ------------|----------------|--------------- no-sparse | 2 712 477 887 | 4 164 995 451 no-snapshot | 2 698 887 835 | 4 141 054 304 snapshot | 2 518 130 385 | 2 578 587 596 Netbeans Manifest Size: limit | none | 1000 ------------|----------------|--------------- no-sparse | 4 766 794 101 | 4 870 642 687 no-snapshot | 4 334 806 082 | 4 428 681 309 snapshot | 232 659 666 | 240 330 665 Manifest Chain length data limit || none || 1000 || value || average | max || average | max || ------------||---------|---------||---------|---------|| no-sparse || 597 | 6802 || 254 | 1 000 || no-snapshot || 648 | 6 802 || 305 | 1 000 || snapshot || 613 | 6 804 || 282 | 1 000 || Full Store Size limit | none | 1000 ------------|----------------|--------------- no-sparse | 5 807 347 998 | 5 911 196 584 no-snapshot | 5 375 398 602 | 5 469 273 829 snapshot | 1 282 519 928 | 1 290 190 927 Private repo #1 Manifest Size: limit | none | 1000 ------------|-----------------|--------------- no-sparse | 41 389 010 840 | 41 398 162 091 no-snapshot | 9 737 319 435 | 10 223 773 150 snapshot | 744 215 807 | 747 961 822 Manifest Chain length data limit || none || 1000 || value || average | max || average | max || ------------||---------|---------||---------|---------|| no-sparse || 245 | 8 885 || 81 | 1 000 || no-snapshot || 1 225 | 8 885 || 336 | 1 000 || snapshot || 1 068 | 7 909 || 307 | 1 000 || Full Store Size limit | none | 1000 ------------|----------------|--------------- no-sparse | 49 646 065 126 | 49 655 216 377 no-snapshot | 17 924 862 856 | 18 411 316 571 snapshot | 9 009 024 710 | 9 012 770 725 Private repo #2 We currently have less data available for that repository. * Before is a sparse-revlog repository without this series * After is a sparse-revlog repository with this series + 1000 chain limit Manifest Size: Before: 1 531 485 040 bytes After: 1 091 422 451 bytes Manifest Chain: Before: 2 218 avg; 6 575 Max After: 442 avg; 1 000 Max Full Store Size Before: 15 203 955 615 after: 8 207 180 693
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10134
821793e3049c Makefile: added instructions on how to override PREFIX
Martin Geisler <mg@lazybytes.net>
parents: 10073
diff changeset
     1
# If you want to change PREFIX, do not just edit it below. The changed
821793e3049c Makefile: added instructions on how to override PREFIX
Martin Geisler <mg@lazybytes.net>
parents: 10073
diff changeset
     2
# value wont get passed on to recursive make calls. You should instead
821793e3049c Makefile: added instructions on how to override PREFIX
Martin Geisler <mg@lazybytes.net>
parents: 10073
diff changeset
     3
# override the variable on the command like:
821793e3049c Makefile: added instructions on how to override PREFIX
Martin Geisler <mg@lazybytes.net>
parents: 10073
diff changeset
     4
#
821793e3049c Makefile: added instructions on how to override PREFIX
Martin Geisler <mg@lazybytes.net>
parents: 10073
diff changeset
     5
# % make PREFIX=/opt/ install
821793e3049c Makefile: added instructions on how to override PREFIX
Martin Geisler <mg@lazybytes.net>
parents: 10073
diff changeset
     6
29004
145cdc45b0df make: do assignment and export in a single statement
Augie Fackler <augie@google.com>
parents: 29003
diff changeset
     7
export PREFIX=/usr/local
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     8
PYTHON=python
29009
c05cc1b95848 make: backout changeset 51f5fae84e43
Siddharth Agarwal <sid0@fb.com>
parents: 29005
diff changeset
     9
$(eval HGROOT := $(shell pwd))
24194
00809c43d72c Makefile: introduce testpy-% target for testing with a specifc Python
Augie Fackler <augie@google.com>
parents: 23940
diff changeset
    10
HGPYTHONS ?= $(HGROOT)/build/pythons
7706
0ae7f0b312ea use PURE option in Makefile
Martin Geisler <mg@daimi.au.dk>
parents: 7687
diff changeset
    11
PURE=
38853
4ca5932065ca i18n: avoid substitution of PYFILES at runtime for readability of output
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 38562
diff changeset
    12
PYFILESCMD=find mercurial hgext doc -name '*.py'
4ca5932065ca i18n: avoid substitution of PYFILES at runtime for readability of output
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 38562
diff changeset
    13
PYFILES:=$(shell $(PYFILESCMD))
12817
372370923b30 Makefile: var for documentation files
Martin Geisler <mg@lazybytes.net>
parents: 12816
diff changeset
    14
DOCFILES=mercurial/help/*.txt
19427
80983af366b5 doc: make i18n man and html
Takumi IINO <trot.thunder@gmail.com>
parents: 18598
diff changeset
    15
export LANGUAGE=C
80983af366b5 doc: make i18n man and html
Takumi IINO <trot.thunder@gmail.com>
parents: 18598
diff changeset
    16
export LC_ALL=C
24195
250d9cf97fb3 Makefile: allow setting HGTESTFLAGS in shell environment for TESTFLAGS
Augie Fackler <augie@google.com>
parents: 24194
diff changeset
    17
TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)
33595
c5607b65fcb8 osx: wire up genosxversion script
Augie Fackler <augie@google.com>
parents: 33045
diff changeset
    18
OSXVERSIONFLAGS ?= $(shell echo $$OSXVERSIONFLAGS)
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    19
18056
7c9b07f0da73 makefile: allow local builds to work on windows/mingw32
Bryan O'Sullivan <bryano@fb.com>
parents: 17927
diff changeset
    20
# Set this to e.g. "mingw32" to use a non-default compiler.
7c9b07f0da73 makefile: allow local builds to work on windows/mingw32
Bryan O'Sullivan <bryano@fb.com>
parents: 17927
diff changeset
    21
COMPILER=
7c9b07f0da73 makefile: allow local builds to work on windows/mingw32
Bryan O'Sullivan <bryano@fb.com>
parents: 17927
diff changeset
    22
29003
c6b108555dfa make: alter how we compute compiler flags for setup.py
Augie Fackler <augie@google.com>
parents: 28995
diff changeset
    23
COMPILERFLAG_tmp_ =
c6b108555dfa make: alter how we compute compiler flags for setup.py
Augie Fackler <augie@google.com>
parents: 28995
diff changeset
    24
COMPILERFLAG_tmp_${COMPILER} ?= -c $(COMPILER)
c6b108555dfa make: alter how we compute compiler flags for setup.py
Augie Fackler <augie@google.com>
parents: 28995
diff changeset
    25
COMPILERFLAG=${COMPILERFLAG_tmp_${COMPILER}}
c6b108555dfa make: alter how we compute compiler flags for setup.py
Augie Fackler <augie@google.com>
parents: 28995
diff changeset
    26
2244
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    27
help:
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    28
	@echo 'Commonly used make targets:'
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    29
	@echo '  all          - build program and documentation'
20311
8824009d2704 makefile: add $ to environment variables in help message
Matt Mackall <mpm@selenic.com>
parents: 20121
diff changeset
    30
	@echo '  install      - install program and man pages to $$PREFIX ($(PREFIX))'
8824009d2704 makefile: add $ to environment variables in help message
Matt Mackall <mpm@selenic.com>
parents: 20121
diff changeset
    31
	@echo '  install-home - install with setup.py install --home=$$HOME ($(HOME))'
4706
f0aa759b8f93 Makefile: change "make local" to build a fully working local version.
Markus F.X.J. Oberhumer <markus@oberhumer.com>
parents: 3969
diff changeset
    32
	@echo '  local        - build for inplace usage'
2244
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    33
	@echo '  tests        - run all tests in the automatic test suite'
15379
3ca419fb435e Makefile: adjust example, test-merge1 is now test-merge1.t
Thomas Arendsen Hein <thomas@intevation.de>
parents: 14815
diff changeset
    34
	@echo '  test-foo     - run only specified tests (e.g. test-merge1.t)'
2244
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    35
	@echo '  dist         - run all tests and create a source tarball in dist/'
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    36
	@echo '  clean        - remove files created by other targets'
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    37
	@echo '                 (except installed files or dist source tarball)'
7648
02e358a3a8a7 i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents: 4707
diff changeset
    38
	@echo '  update-pot   - update i18n/hg.pot'
2244
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    39
	@echo
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    40
	@echo 'Example for a system-wide installation under /usr/local:'
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    41
	@echo '  make all && su -c "make install" && hg version'
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    42
	@echo
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    43
	@echo 'Example for a local installation (usable in this directory):'
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    44
	@echo '  make local && ./hg version'
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    45
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    46
all: build doc
2235
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    47
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    48
local:
18056
7c9b07f0da73 makefile: allow local builds to work on windows/mingw32
Bryan O'Sullivan <bryano@fb.com>
parents: 17927
diff changeset
    49
	$(PYTHON) setup.py $(PURE) \
7c9b07f0da73 makefile: allow local builds to work on windows/mingw32
Bryan O'Sullivan <bryano@fb.com>
parents: 17927
diff changeset
    50
	  build_py -c -d . \
29003
c6b108555dfa make: alter how we compute compiler flags for setup.py
Augie Fackler <augie@google.com>
parents: 28995
diff changeset
    51
	  build_ext $(COMPILERFLAG) -i \
c6b108555dfa make: alter how we compute compiler flags for setup.py
Augie Fackler <augie@google.com>
parents: 28995
diff changeset
    52
	  build_hgexe $(COMPILERFLAG) -i \
18056
7c9b07f0da73 makefile: allow local builds to work on windows/mingw32
Bryan O'Sullivan <bryano@fb.com>
parents: 17927
diff changeset
    53
	  build_mo
17927
9796d5437e72 makefile: don't use system hgrc when running hg in-place
Bryan O'Sullivan <bryano@fb.com>
parents: 17062
diff changeset
    54
	env HGRCPATH= $(PYTHON) hg version
1020
f1b052db3515 Add default make rule
mpm@selenic.com
parents: 1008
diff changeset
    55
2235
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    56
build:
29003
c6b108555dfa make: alter how we compute compiler flags for setup.py
Augie Fackler <augie@google.com>
parents: 28995
diff changeset
    57
	$(PYTHON) setup.py $(PURE) build $(COMPILERFLAG)
2235
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    58
26601
c5c7c686d6a6 makefile: add wheel build target
Nathan Goldbaum <ngoldbau@ucsc.edu>
parents: 26108
diff changeset
    59
wheel:
29003
c6b108555dfa make: alter how we compute compiler flags for setup.py
Augie Fackler <augie@google.com>
parents: 28995
diff changeset
    60
	FORCE_SETUPTOOLS=1 $(PYTHON) setup.py $(PURE) bdist_wheel $(COMPILERFLAG)
26601
c5c7c686d6a6 makefile: add wheel build target
Nathan Goldbaum <ngoldbau@ucsc.edu>
parents: 26108
diff changeset
    61
2235
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    62
doc:
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    63
	$(MAKE) -C doc
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    64
29640
17b3309bfdff make: introduce a target to clean everything but packages
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 29535
diff changeset
    65
cleanbutpackages:
8365
94e91205d9b6 Makefile: fix grammar in comment
Greg Ward <greg-hg@gerg.ca>
parents: 8273
diff changeset
    66
	-$(PYTHON) setup.py clean --all # ignore errors from this command
33605
92f7dcf9a40b make: add new directory 'hgdemandimport' to cleanbutpackages rule
Sean Farley <sean@farley.io>
parents: 33596
diff changeset
    67
	find contrib doc hgext hgext3rd i18n mercurial tests hgdemandimport \
20007
23edc6673f0d make: restrict recursion in make clean
Matt Mackall <mpm@selenic.com>
parents: 19991
diff changeset
    68
		\( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';'
22375
308ab71207ff build: don't clean __version__.py on 'make clean' in release tarballs
J. Lewis Muir <jlmuir@anl.gov>
parents: 22358
diff changeset
    69
	rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err
28430
17b85d739b62 setup: create a module for the modulepolicy
timeless <timeless@mozdev.org>
parents: 27212
diff changeset
    70
	rm -f mercurial/__modulepolicy__.py
22375
308ab71207ff build: don't clean __version__.py on 'make clean' in release tarballs
J. Lewis Muir <jlmuir@anl.gov>
parents: 22358
diff changeset
    71
	if test -d .hg; then rm -f mercurial/__version__.py; fi
29640
17b3309bfdff make: introduce a target to clean everything but packages
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 29535
diff changeset
    72
	rm -rf build mercurial/locale
1423
76239f0cb0dc Use $(MAKE) not make
levon@movementarian.org
parents: 1020
diff changeset
    73
	$(MAKE) -C doc clean
28974
ef5553fab197 make: add chg to clean rule
Sean Farley <sean@farley.io>
parents: 28457
diff changeset
    74
	$(MAKE) -C contrib/chg distclean
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    75
29640
17b3309bfdff make: introduce a target to clean everything but packages
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 29535
diff changeset
    76
clean: cleanbutpackages
17b3309bfdff make: introduce a target to clean everything but packages
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 29535
diff changeset
    77
	rm -rf packages
17b3309bfdff make: introduce a target to clean everything but packages
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 29535
diff changeset
    78
2527
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    79
install: install-bin install-doc
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    80
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    81
install-bin: build
10961
ce6d56b95f2e Respect the DESTDIR variable during 'make install'
Dévai Tamás <devait@vnet.hu>
parents: 10134
diff changeset
    82
	$(PYTHON) setup.py $(PURE) install --root="$(DESTDIR)/" --prefix="$(PREFIX)" --force
2527
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    83
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    84
install-doc: doc
2235
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    85
	cd doc && $(MAKE) $(MFLAGS) install
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    86
2527
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    87
install-home: install-home-bin install-home-doc
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    88
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    89
install-home-bin: build
20614
1bc68ff4e0a2 setup: specify --prefix="" for install-home-bin to avoid badness with defaults
Augie Fackler <raf@durin42.com>
parents: 20358
diff changeset
    90
	$(PYTHON) setup.py $(PURE) install --home="$(HOME)" --prefix="" --force
2527
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    91
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    92
install-home-doc: doc
2235
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    93
	cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    94
3872
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
    95
MANIFEST-doc:
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
    96
	$(MAKE) -C doc MANIFEST
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
    97
14558
2ce7dfe17bc5 distutils: Create MANIFEST.in instead of MANIFEST in Makefile
Stephen Thorne <stephen@thorne.id.au>
parents: 14315
diff changeset
    98
MANIFEST.in: MANIFEST-doc
2ce7dfe17bc5 distutils: Create MANIFEST.in instead of MANIFEST in Makefile
Stephen Thorne <stephen@thorne.id.au>
parents: 14315
diff changeset
    99
	hg manifest | sed -e 's/^/include /' > MANIFEST.in
2ce7dfe17bc5 distutils: Create MANIFEST.in instead of MANIFEST in Makefile
Stephen Thorne <stephen@thorne.id.au>
parents: 14315
diff changeset
   100
	echo include mercurial/__version__.py >> MANIFEST.in
2ce7dfe17bc5 distutils: Create MANIFEST.in instead of MANIFEST in Makefile
Stephen Thorne <stephen@thorne.id.au>
parents: 14315
diff changeset
   101
	sed -e 's/^/include /' < doc/MANIFEST >> MANIFEST.in
3872
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
   102
2234
9ea93ff67a73 New make target "dist-notests" to create tarballs without running tests first.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2233
diff changeset
   103
dist:	tests dist-notests
9ea93ff67a73 New make target "dist-notests" to create tarballs without running tests first.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2233
diff changeset
   104
14558
2ce7dfe17bc5 distutils: Create MANIFEST.in instead of MANIFEST in Makefile
Stephen Thorne <stephen@thorne.id.au>
parents: 14315
diff changeset
   105
dist-notests:	doc MANIFEST.in
3865
36a957364b1b Make make dist a bit quieter
Matt Mackall <mpm@selenic.com>
parents: 3864
diff changeset
   106
	TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
   107
14172
1a919c3271bf add make check: tests rule
Johan Euphrosine <proppy@google.com>
parents: 13101
diff changeset
   108
check: tests
1a919c3271bf add make check: tests rule
Johan Euphrosine <proppy@google.com>
parents: 13101
diff changeset
   109
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
   110
tests:
3969
edaf68032a27 add possibility to pass flags when testing with the Makefile
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3872
diff changeset
   111
	cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
   112
1426
e84c69b43cdb add a target for running only one test
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1423
diff changeset
   113
test-%:
3969
edaf68032a27 add possibility to pass flags when testing with the Makefile
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3872
diff changeset
   114
	cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
1426
e84c69b43cdb add a target for running only one test
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1423
diff changeset
   115
24194
00809c43d72c Makefile: introduce testpy-% target for testing with a specifc Python
Augie Fackler <augie@google.com>
parents: 23940
diff changeset
   116
testpy-%:
00809c43d72c Makefile: introduce testpy-% target for testing with a specifc Python
Augie Fackler <augie@google.com>
parents: 23940
diff changeset
   117
	@echo Looking for Python $* in $(HGPYTHONS)
00809c43d72c Makefile: introduce testpy-% target for testing with a specifc Python
Augie Fackler <augie@google.com>
parents: 23940
diff changeset
   118
	[ -e $(HGPYTHONS)/$*/bin/python ] || ( \
00809c43d72c Makefile: introduce testpy-% target for testing with a specifc Python
Augie Fackler <augie@google.com>
parents: 23940
diff changeset
   119
	cd $$(mktemp --directory --tmpdir) && \
00809c43d72c Makefile: introduce testpy-% target for testing with a specifc Python
Augie Fackler <augie@google.com>
parents: 23940
diff changeset
   120
        $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python )
00809c43d72c Makefile: introduce testpy-% target for testing with a specifc Python
Augie Fackler <augie@google.com>
parents: 23940
diff changeset
   121
	cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS)
00809c43d72c Makefile: introduce testpy-% target for testing with a specifc Python
Augie Fackler <augie@google.com>
parents: 23940
diff changeset
   122
18598
4723ccb62282 check-code: add Makefile target to run check-code
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 18056
diff changeset
   123
check-code:
4723ccb62282 check-code: add Makefile target to run check-code
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 18056
diff changeset
   124
	hg manifest | xargs python contrib/check-code.py
4723ccb62282 check-code: add Makefile target to run check-code
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 18056
diff changeset
   125
34859
2bf152128d59 makefile: add target to apply clang-format in-place
Augie Fackler <augie@google.com>
parents: 34655
diff changeset
   126
format-c:
2bf152128d59 makefile: add target to apply clang-format in-place
Augie Fackler <augie@google.com>
parents: 34655
diff changeset
   127
	clang-format --style file -i \
37186
0024961aa493 contrib: rename clang-format-blacklist to clang-format-ignorelist
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36928
diff changeset
   128
	  `hg files 'set:(**.c or **.cc or **.h) and not "listfile:contrib/clang-format-ignorelist"'`
34859
2bf152128d59 makefile: add target to apply clang-format in-place
Augie Fackler <augie@google.com>
parents: 34655
diff changeset
   129
7893
606723f4a327 enhance Makefile for language translators
Tobias Bell <tobias.bell@gmail.com>
parents: 7791
diff changeset
   130
update-pot: i18n/hg.pot
606723f4a327 enhance Makefile for language translators
Tobias Bell <tobias.bell@gmail.com>
parents: 7791
diff changeset
   131
20358
4276c906d90e Makefile: hg.pot depends on the scripts generating it
Simon Heimberg <simohe@besonet.ch>
parents: 20311
diff changeset
   132
i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n/posplit i18n/hggettext
8542
de150a942ec8 i18n: accurately generate hg.pot
Martin Geisler <mg@lazybytes.net>
parents: 8365
diff changeset
   133
	$(PYTHON) i18n/hggettext mercurial/commands.py \
16126
0c4bec9596d8 filemerge: create detail of internal merge tools from documentation string
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15379
diff changeset
   134
	  hgext/*.py hgext/*/__init__.py \
0c4bec9596d8 filemerge: create detail of internal merge tools from documentation string
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15379
diff changeset
   135
	  mercurial/fileset.py mercurial/revset.py \
36928
521f6c7e1756 templater: split template functions to new module
Yuya Nishihara <yuya@tcha.org>
parents: 35949
diff changeset
   136
	  mercurial/templatefilters.py \
521f6c7e1756 templater: split template functions to new module
Yuya Nishihara <yuya@tcha.org>
parents: 35949
diff changeset
   137
	  mercurial/templatefuncs.py \
521f6c7e1756 templater: split template functions to new module
Yuya Nishihara <yuya@tcha.org>
parents: 35949
diff changeset
   138
	  mercurial/templatekw.py \
16126
0c4bec9596d8 filemerge: create detail of internal merge tools from documentation string
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15379
diff changeset
   139
	  mercurial/filemerge.py \
24859
64e3f97bdf08 i18n: extract doc string of each web commands as translatable one
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24601
diff changeset
   140
	  mercurial/hgweb/webcommands.py \
33841
fa7e30efe05a i18n: get translation entries for description of each compression engines
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 33707
diff changeset
   141
	  mercurial/util.py \
20121
2af9e1d40dc7 Makefile: temporary copy of hg.pot is hg.pot.tmp instead of hg.pot~
Simon Heimberg <simohe@besonet.ch>
parents: 20120
diff changeset
   142
	  $(DOCFILES) > i18n/hg.pot.tmp
7710
88326ee85a1b i18n: extract strings with xgettext
Martin Geisler <mg@daimi.au.dk>
parents: 7706
diff changeset
   143
        # All strings marked for translation in Mercurial contain
88326ee85a1b i18n: extract strings with xgettext
Martin Geisler <mg@daimi.au.dk>
parents: 7706
diff changeset
   144
        # ASCII characters only. But some files contain string
88326ee85a1b i18n: extract strings with xgettext
Martin Geisler <mg@daimi.au.dk>
parents: 7706
diff changeset
   145
        # literals like this '\037\213'. xgettext thinks it has to
8273
a9c1172a025e Makefile: fixed comment
Martin Geisler <mg@lazybytes.net>
parents: 8272
diff changeset
   146
        # parse them even though they are not marked for translation.
a9c1172a025e Makefile: fixed comment
Martin Geisler <mg@lazybytes.net>
parents: 8272
diff changeset
   147
        # Extracting with an explicit encoding of ISO-8859-1 will make
a9c1172a025e Makefile: fixed comment
Martin Geisler <mg@lazybytes.net>
parents: 8272
diff changeset
   148
        # xgettext "parse" and ignore them.
38853
4ca5932065ca i18n: avoid substitution of PYFILES at runtime for readability of output
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 38562
diff changeset
   149
	$(PYFILESCMD) | xargs \
9278
3d9f77c03105 Makefile: remove non-default wrapping of hg.pot strings
Martin Geisler <mg@lazybytes.net>
parents: 9079
diff changeset
   150
	  xgettext --package-name "Mercurial" \
30868
22a4f664c1a5 misc: replace domain of mercurial-devel ML address by mercurial-scm.org
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 30705
diff changeset
   151
	  --msgid-bugs-address "<mercurial-devel@mercurial-scm.org>" \
8272
79983cfa7efe Makefile: add more meta data to hg.pot
Martin Geisler <mg@lazybytes.net>
parents: 7893
diff changeset
   152
	  --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \
12806
57b9fd75b6f8 i18n: extract comments marked for translator hints
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 12500
diff changeset
   153
	  --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
20121
2af9e1d40dc7 Makefile: temporary copy of hg.pot is hg.pot.tmp instead of hg.pot~
Simon Heimberg <simohe@besonet.ch>
parents: 20120
diff changeset
   154
	  -d hg -p i18n -o hg.pot.tmp
2af9e1d40dc7 Makefile: temporary copy of hg.pot is hg.pot.tmp instead of hg.pot~
Simon Heimberg <simohe@besonet.ch>
parents: 20120
diff changeset
   155
	$(PYTHON) i18n/posplit i18n/hg.pot.tmp
20080
c845b1a95eed Makefile: intermediate steps work with temporary copy of hg.pot
Simon Heimberg <simohe@besonet.ch>
parents: 20007
diff changeset
   156
        # The target file is not created before the last step. So it never is in
c845b1a95eed Makefile: intermediate steps work with temporary copy of hg.pot
Simon Heimberg <simohe@besonet.ch>
parents: 20007
diff changeset
   157
        # an intermediate state.
20121
2af9e1d40dc7 Makefile: temporary copy of hg.pot is hg.pot.tmp instead of hg.pot~
Simon Heimberg <simohe@besonet.ch>
parents: 20120
diff changeset
   158
	mv -f i18n/hg.pot.tmp i18n/hg.pot
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
   159
7893
606723f4a327 enhance Makefile for language translators
Tobias Bell <tobias.bell@gmail.com>
parents: 7791
diff changeset
   160
%.po: i18n/hg.pot
19991
ce5d711475a3 Makefile: do update on a temporary copy of a po file
Simon Heimberg <simohe@besonet.ch>
parents: 19427
diff changeset
   161
        # work on a temporary copy for never having a half completed target
ce5d711475a3 Makefile: do update on a temporary copy of a po file
Simon Heimberg <simohe@besonet.ch>
parents: 19427
diff changeset
   162
	cp $@ $@.tmp
ce5d711475a3 Makefile: do update on a temporary copy of a po file
Simon Heimberg <simohe@besonet.ch>
parents: 19427
diff changeset
   163
	msgmerge --no-location --update $@.tmp $^
20120
872f81de2865 Makefile: fix po file updating by using same file name everywhere
Simon Heimberg <simohe@besonet.ch>
parents: 20080
diff changeset
   164
	mv -f $@.tmp $@
7893
606723f4a327 enhance Makefile for language translators
Tobias Bell <tobias.bell@gmail.com>
parents: 7791
diff changeset
   165
21255
62a2749895e4 build: initial support for in-tree autobuilding recipes
Matt Mackall <mpm@selenic.com>
parents: 21229
diff changeset
   166
# Packaging targets
62a2749895e4 build: initial support for in-tree autobuilding recipes
Matt Mackall <mpm@selenic.com>
parents: 21229
diff changeset
   167
38056
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   168
packaging_targets := \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   169
  centos5 \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   170
  centos6 \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   171
  centos7 \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   172
  deb \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   173
  docker-centos5 \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   174
  docker-centos6 \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   175
  docker-centos7 \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   176
  docker-debian-jessie \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   177
  docker-debian-stretch \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   178
  docker-fedora20 \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   179
  docker-fedora21 \
38562
600d8d9b8551 packaging: add fedora 28
Augie Fackler <augie@google.com>
parents: 38056
diff changeset
   180
  docker-fedora28 \
38056
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   181
  docker-ubuntu-trusty \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   182
  docker-ubuntu-trusty-ppa \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   183
  docker-ubuntu-xenial \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   184
  docker-ubuntu-xenial-ppa \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   185
  docker-ubuntu-artful \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   186
  docker-ubuntu-artful-ppa \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   187
  docker-ubuntu-bionic \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   188
  docker-ubuntu-bionic-ppa \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   189
  fedora20 \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   190
  fedora21 \
38562
600d8d9b8551 packaging: add fedora 28
Augie Fackler <augie@google.com>
parents: 38056
diff changeset
   191
  fedora28 \
38056
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   192
  linux-wheels \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   193
  linux-wheels-x86_64 \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   194
  linux-wheels-i686 \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   195
  ppa
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   196
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   197
# Forward packaging targets for convenience.
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   198
$(packaging_targets):
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   199
	$(MAKE) -C contrib/packaging $@
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   200
21559
9a9de26ad99a make: add a basic osx mpkg target
Matt Mackall <mpm@selenic.com>
parents: 21255
diff changeset
   201
osx:
31616
6359976b43be osx: always purge build/mercurial before starting build
Augie Fackler <augie@google.com>
parents: 31614
diff changeset
   202
	rm -rf build/mercurial
29535
da1848f07c6a osx: explicitly build hg with /usr/bin/python2.7
Augie Fackler <augie@google.com>
parents: 29036
diff changeset
   203
	/usr/bin/python2.7 setup.py install --optimize=1 \
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29024
diff changeset
   204
	  --root=build/mercurial/ --prefix=/usr/local/ \
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29024
diff changeset
   205
	  --install-lib=/Library/Python/2.7/site-packages/
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29024
diff changeset
   206
	make -C doc all install DESTDIR="$(PWD)/build/mercurial/"
32134
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 32080
diff changeset
   207
        # Place a bogon .DS_Store file in the target dir so we can be
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 32080
diff changeset
   208
        # sure it doesn't get included in the final package.
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 32080
diff changeset
   209
	touch build/mercurial/.DS_Store
31152
408dcf7475a7 osx: install bash and zsh completions by default
Augie Fackler <augie@google.com>
parents: 30980
diff changeset
   210
        # install zsh completions - this location appears to be
408dcf7475a7 osx: install bash and zsh completions by default
Augie Fackler <augie@google.com>
parents: 30980
diff changeset
   211
        # searched by default as of macOS Sierra.
31614
8e516f71577a osx: install completion scripts using install(1) to avoid umask badness
Augie Fackler <augie@google.com>
parents: 31152
diff changeset
   212
	install -d build/mercurial/usr/local/share/zsh/site-functions/
32135
501d48bda912 zsh_completion: install as _hg not hg
Kyle Lippincott <spectral@google.com>
parents: 32134
diff changeset
   213
	install -m 0644 contrib/zsh_completion build/mercurial/usr/local/share/zsh/site-functions/_hg
31152
408dcf7475a7 osx: install bash and zsh completions by default
Augie Fackler <augie@google.com>
parents: 30980
diff changeset
   214
        # install bash completions - there doesn't appear to be a
408dcf7475a7 osx: install bash and zsh completions by default
Augie Fackler <augie@google.com>
parents: 30980
diff changeset
   215
        # place that's searched by default for bash, so we'll follow
408dcf7475a7 osx: install bash and zsh completions by default
Augie Fackler <augie@google.com>
parents: 30980
diff changeset
   216
        # the lead of Apple's git install and just put it in a
408dcf7475a7 osx: install bash and zsh completions by default
Augie Fackler <augie@google.com>
parents: 30980
diff changeset
   217
        # location of our own.
31614
8e516f71577a osx: install completion scripts using install(1) to avoid umask badness
Augie Fackler <augie@google.com>
parents: 31152
diff changeset
   218
	install -d build/mercurial/usr/local/hg/contrib/
8e516f71577a osx: install completion scripts using install(1) to avoid umask badness
Augie Fackler <augie@google.com>
parents: 31152
diff changeset
   219
	install -m 0644 contrib/bash_completion build/mercurial/usr/local/hg/contrib/hg-completion.bash
32505
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32504
diff changeset
   220
	make -C contrib/chg \
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32504
diff changeset
   221
	  HGPATH=/usr/local/bin/hg \
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32504
diff changeset
   222
	  PYTHON=/usr/bin/python2.7 \
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32504
diff changeset
   223
	  HGEXTDIR=/Library/Python/2.7/site-packages/hgext \
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32504
diff changeset
   224
	  DESTDIR=../../build/mercurial \
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32504
diff changeset
   225
	  PREFIX=/usr/local \
a38ed42cd23c osx: include chg by default
Augie Fackler <augie@google.com>
parents: 32504
diff changeset
   226
	  clean install
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29024
diff changeset
   227
	mkdir -p $${OUTPUTDIR:-dist}
33662
8de8f8a91f2d osx: delay version computation on macOS builds
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 33605
diff changeset
   228
	HGVER=$$(python contrib/genosxversion.py $(OSXVERSIONFLAGS) build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py) && \
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29024
diff changeset
   229
	OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \
32134
197eb93560b3 osx: override default exclude filter for pkgbuild
Augie Fackler <augie@google.com>
parents: 32080
diff changeset
   230
	pkgbuild --filter \\.DS_Store --root build/mercurial/ \
29788
afa74947a414 osx: stamp the hg version into the version field in the pkg
Augie Fackler <augie@google.com>
parents: 29640
diff changeset
   231
	  --identifier org.mercurial-scm.mercurial \
afa74947a414 osx: stamp the hg version into the version field in the pkg
Augie Fackler <augie@google.com>
parents: 29640
diff changeset
   232
	  --version "$${HGVER}" \
afa74947a414 osx: stamp the hg version into the version field in the pkg
Augie Fackler <augie@google.com>
parents: 29640
diff changeset
   233
	  build/mercurial.pkg && \
38054
e5d2248dcc39 packaging: move contrib/macosx to contrib/packaging/
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38052
diff changeset
   234
	productbuild --distribution contrib/packaging/macosx/distribution.xml \
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29024
diff changeset
   235
	  --package-path build/ \
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29024
diff changeset
   236
	  --version "$${HGVER}" \
38054
e5d2248dcc39 packaging: move contrib/macosx to contrib/packaging/
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38052
diff changeset
   237
	  --resources contrib/packaging/macosx/ \
29027
db5084d27df5 osx: create a modern package including manpages
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 29024
diff changeset
   238
	  "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg
21559
9a9de26ad99a make: add a basic osx mpkg target
Matt Mackall <mpm@selenic.com>
parents: 21255
diff changeset
   239
29640
17b3309bfdff make: introduce a target to clean everything but packages
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 29535
diff changeset
   240
.PHONY: help all local build doc cleanbutpackages clean install install-bin \
17b3309bfdff make: introduce a target to clean everything but packages
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 29535
diff changeset
   241
	install-doc install-home install-home-bin install-home-doc \
34927
c2695cbb5fb1 makefile: put format-c into .PHONY targets
Anton Shestakov <av6@dwimlabs.net>
parents: 34859
diff changeset
   242
	dist dist-notests check tests check-code format-c update-pot \
38056
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   243
	$(packaging_targets) \
768bd75835d7 packaging: move most packaging targets to own Makefile
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38054
diff changeset
   244
	osx