Makefile
author Martin Geisler <mg@daimi.au.dk>
Sun, 25 Jan 2009 12:33:47 +0100
changeset 7687 1ac4dc64cf2a
parent 7653 0641fd8a4bb4
child 7706 0ae7f0b312ea
permissions -rw-r--r--
i18n: sort by file when generating hg.pot This will make the order more stable and give smaller patches when translations merge in new and deleted strings from the hg.pot file.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2233
3840cefa5222 Added install target.
wilde@trapperkeeper.sha-bang.de
parents: 2207
diff changeset
     1
PREFIX=/usr/local
3840cefa5222 Added install target.
wilde@trapperkeeper.sha-bang.de
parents: 2207
diff changeset
     2
export PREFIX
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     3
PYTHON=python
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     4
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
     5
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
     6
	@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
     7
	@echo '  all          - build program and documentation'
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
     8
	@echo '  install      - install program and man pages to PREFIX ($(PREFIX))'
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
     9
	@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
    10
	@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
    11
	@echo '  tests        - run all tests in the automatic test suite'
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    12
	@echo '  test-foo     - run only specified tests (e.g. test-merge1)'
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    13
	@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
    14
	@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
    15
	@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
    16
	@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
    17
	@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
    18
	@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
    19
	@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
    20
	@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
    21
	@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
    22
	@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
    23
76be4e66ddc8 Just using 'make' now shows help. 'make all' doesn't perform inplace build.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2235
diff changeset
    24
all: build doc
2235
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    25
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    26
local:
1020
f1b052db3515 Add default make rule
mpm@selenic.com
parents: 1008
diff changeset
    27
	$(PYTHON) setup.py build_ext -i
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
    28
	$(PYTHON) setup.py build_py -c -d .
7653
0641fd8a4bb4 i18n: make local now builds .mo files
Martin Geisler <mg@daimi.au.dk>
parents: 7648
diff changeset
    29
	$(PYTHON) setup.py build_mo
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
    30
	$(PYTHON) hg version
1020
f1b052db3515 Add default make rule
mpm@selenic.com
parents: 1008
diff changeset
    31
2235
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    32
build:
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    33
	$(PYTHON) setup.py build
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    34
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    35
doc:
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    36
	$(MAKE) -C doc
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    37
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    38
clean:
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    39
	-$(PYTHON) setup.py clean --all # ignore errors of this command
4707
3fd4dde37628 Makefile: remove *.pyd files on "make clean".
Markus F.X.J. Oberhumer <markus@oberhumer.com>
parents: 4706
diff changeset
    40
	find . -name '*.py[cdo]' -exec rm -f '{}' ';'
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
    41
	rm -f MANIFEST mercurial/__version__.py mercurial/*.so tests/*.err
1423
76239f0cb0dc Use $(MAKE) not make
levon@movementarian.org
parents: 1020
diff changeset
    42
	$(MAKE) -C doc clean
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    43
2527
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    44
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
    45
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    46
install-bin: build
2235
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    47
	$(PYTHON) setup.py install --prefix="$(PREFIX)" --force
2527
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    48
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    49
install-doc: doc
2235
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    50
	cd doc && $(MAKE) $(MFLAGS) install
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    51
2527
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    52
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
    53
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    54
install-home-bin: build
2235
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    55
	$(PYTHON) setup.py install --home="$(HOME)" --force
2527
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    56
c51fad25e59e Split installation targets into install-bin and install-doc.
Sascha Wilde <wilde@sha-bang.de>
parents: 2244
diff changeset
    57
install-home-doc: doc
2235
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    58
	cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install
457e4247315d New make targets:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2234
diff changeset
    59
3872
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
    60
MANIFEST-doc:
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
    61
	$(MAKE) -C doc MANIFEST
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
    62
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
    63
MANIFEST: MANIFEST-doc
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
    64
	hg manifest > MANIFEST
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
    65
	echo mercurial/__version__.py >> MANIFEST
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
    66
	cat doc/MANIFEST >> MANIFEST
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
    67
2234
9ea93ff67a73 New make target "dist-notests" to create tarballs without running tests first.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2233
diff changeset
    68
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
    69
3872
9d7ac8613340 fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3865
diff changeset
    70
dist-notests:	doc MANIFEST
3865
36a957364b1b Make make dist a bit quieter
Matt Mackall <mpm@selenic.com>
parents: 3864
diff changeset
    71
	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
    72
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    73
tests:
3969
edaf68032a27 add possibility to pass flags when testing with the Makefile
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3872
diff changeset
    74
	cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    75
1426
e84c69b43cdb add a target for running only one test
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1423
diff changeset
    76
test-%:
3969
edaf68032a27 add possibility to pass flags when testing with the Makefile
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3872
diff changeset
    77
	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
    78
7648
02e358a3a8a7 i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents: 4707
diff changeset
    79
update-pot:
02e358a3a8a7 i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents: 4707
diff changeset
    80
	mkdir -p i18n
02e358a3a8a7 i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents: 4707
diff changeset
    81
	pygettext -d doc -p i18n --docstrings \
02e358a3a8a7 i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents: 4707
diff changeset
    82
	mercurial/commands.py hgext/*.py hgext/*/__init__.py
02e358a3a8a7 i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents: 4707
diff changeset
    83
	pygettext -d all -p i18n mercurial hgext doc
7687
1ac4dc64cf2a i18n: sort by file when generating hg.pot
Martin Geisler <mg@daimi.au.dk>
parents: 7653
diff changeset
    84
	msgcat --sort-by-file i18n/doc.pot i18n/all.pot > i18n/hg.pot
7648
02e358a3a8a7 i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents: 4707
diff changeset
    85
	rm i18n/doc.pot i18n/all.pot
1008
85272e96b96a Add Makefile for generating release tarballs.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
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
.PHONY: help all local build doc clean install install-bin install-doc \
7648
02e358a3a8a7 i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents: 4707
diff changeset
    88
	install-home install-home-bin install-home-doc dist dist-notests tests \
02e358a3a8a7 i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents: 4707
diff changeset
    89
	update-pot