##// END OF EJS Templates
Makefile: wrap hg.pot strings at 82 chars...
Martin Geisler -
r9079:70c70731 default
parent child Browse files
Show More
@@ -1,103 +1,103 b''
1 PREFIX=/usr/local
1 PREFIX=/usr/local
2 export PREFIX
2 export PREFIX
3 PYTHON=python
3 PYTHON=python
4 PURE=
4 PURE=
5 PYTHON_FILES:=$(shell find mercurial hgext doc -name '*.py')
5 PYTHON_FILES:=$(shell find mercurial hgext doc -name '*.py')
6
6
7 help:
7 help:
8 @echo 'Commonly used make targets:'
8 @echo 'Commonly used make targets:'
9 @echo ' all - build program and documentation'
9 @echo ' all - build program and documentation'
10 @echo ' install - install program and man pages to PREFIX ($(PREFIX))'
10 @echo ' install - install program and man pages to PREFIX ($(PREFIX))'
11 @echo ' install-home - install with setup.py install --home=HOME ($(HOME))'
11 @echo ' install-home - install with setup.py install --home=HOME ($(HOME))'
12 @echo ' local - build for inplace usage'
12 @echo ' local - build for inplace usage'
13 @echo ' tests - run all tests in the automatic test suite'
13 @echo ' tests - run all tests in the automatic test suite'
14 @echo ' test-foo - run only specified tests (e.g. test-merge1)'
14 @echo ' test-foo - run only specified tests (e.g. test-merge1)'
15 @echo ' dist - run all tests and create a source tarball in dist/'
15 @echo ' dist - run all tests and create a source tarball in dist/'
16 @echo ' clean - remove files created by other targets'
16 @echo ' clean - remove files created by other targets'
17 @echo ' (except installed files or dist source tarball)'
17 @echo ' (except installed files or dist source tarball)'
18 @echo ' update-pot - update i18n/hg.pot'
18 @echo ' update-pot - update i18n/hg.pot'
19 @echo
19 @echo
20 @echo 'Example for a system-wide installation under /usr/local:'
20 @echo 'Example for a system-wide installation under /usr/local:'
21 @echo ' make all && su -c "make install" && hg version'
21 @echo ' make all && su -c "make install" && hg version'
22 @echo
22 @echo
23 @echo 'Example for a local installation (usable in this directory):'
23 @echo 'Example for a local installation (usable in this directory):'
24 @echo ' make local && ./hg version'
24 @echo ' make local && ./hg version'
25
25
26 all: build doc
26 all: build doc
27
27
28 local:
28 local:
29 $(PYTHON) setup.py $(PURE) build_py -c -d . build_ext -i build_mo
29 $(PYTHON) setup.py $(PURE) build_py -c -d . build_ext -i build_mo
30 $(PYTHON) hg version
30 $(PYTHON) hg version
31
31
32 build:
32 build:
33 $(PYTHON) setup.py $(PURE) build
33 $(PYTHON) setup.py $(PURE) build
34
34
35 doc:
35 doc:
36 $(MAKE) -C doc
36 $(MAKE) -C doc
37
37
38 clean:
38 clean:
39 -$(PYTHON) setup.py clean --all # ignore errors from this command
39 -$(PYTHON) setup.py clean --all # ignore errors from this command
40 find . -name '*.py[cdo]' -exec rm -f '{}' ';'
40 find . -name '*.py[cdo]' -exec rm -f '{}' ';'
41 rm -f MANIFEST mercurial/__version__.py mercurial/*.so tests/*.err
41 rm -f MANIFEST mercurial/__version__.py mercurial/*.so tests/*.err
42 rm -rf locale
42 rm -rf locale
43 $(MAKE) -C doc clean
43 $(MAKE) -C doc clean
44
44
45 install: install-bin install-doc
45 install: install-bin install-doc
46
46
47 install-bin: build
47 install-bin: build
48 $(PYTHON) setup.py $(PURE) install --prefix="$(PREFIX)" --force
48 $(PYTHON) setup.py $(PURE) install --prefix="$(PREFIX)" --force
49
49
50 install-doc: doc
50 install-doc: doc
51 cd doc && $(MAKE) $(MFLAGS) install
51 cd doc && $(MAKE) $(MFLAGS) install
52
52
53 install-home: install-home-bin install-home-doc
53 install-home: install-home-bin install-home-doc
54
54
55 install-home-bin: build
55 install-home-bin: build
56 $(PYTHON) setup.py $(PURE) install --home="$(HOME)" --force
56 $(PYTHON) setup.py $(PURE) install --home="$(HOME)" --force
57
57
58 install-home-doc: doc
58 install-home-doc: doc
59 cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install
59 cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install
60
60
61 MANIFEST-doc:
61 MANIFEST-doc:
62 $(MAKE) -C doc MANIFEST
62 $(MAKE) -C doc MANIFEST
63
63
64 MANIFEST: MANIFEST-doc
64 MANIFEST: MANIFEST-doc
65 hg manifest > MANIFEST
65 hg manifest > MANIFEST
66 echo mercurial/__version__.py >> MANIFEST
66 echo mercurial/__version__.py >> MANIFEST
67 cat doc/MANIFEST >> MANIFEST
67 cat doc/MANIFEST >> MANIFEST
68
68
69 dist: tests dist-notests
69 dist: tests dist-notests
70
70
71 dist-notests: doc MANIFEST
71 dist-notests: doc MANIFEST
72 TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist
72 TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist
73
73
74 tests:
74 tests:
75 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
75 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
76
76
77 test-%:
77 test-%:
78 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
78 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
79
79
80 update-pot: i18n/hg.pot
80 update-pot: i18n/hg.pot
81
81
82 i18n/hg.pot: $(PYTHON_FILES)
82 i18n/hg.pot: $(PYTHON_FILES)
83 $(PYTHON) i18n/hggettext mercurial/commands.py \
83 $(PYTHON) i18n/hggettext mercurial/commands.py \
84 hgext/*.py hgext/*/__init__.py > i18n/hg.pot
84 hgext/*.py hgext/*/__init__.py > i18n/hg.pot
85 # All strings marked for translation in Mercurial contain
85 # All strings marked for translation in Mercurial contain
86 # ASCII characters only. But some files contain string
86 # ASCII characters only. But some files contain string
87 # literals like this '\037\213'. xgettext thinks it has to
87 # literals like this '\037\213'. xgettext thinks it has to
88 # parse them even though they are not marked for translation.
88 # parse them even though they are not marked for translation.
89 # Extracting with an explicit encoding of ISO-8859-1 will make
89 # Extracting with an explicit encoding of ISO-8859-1 will make
90 # xgettext "parse" and ignore them.
90 # xgettext "parse" and ignore them.
91 echo $^ | xargs \
91 echo $^ | xargs \
92 xgettext --package-name "Mercurial" \
92 xgettext --width 82 --package-name "Mercurial" \
93 --msgid-bugs-address "<mercurial-devel@selenic.com>" \
93 --msgid-bugs-address "<mercurial-devel@selenic.com>" \
94 --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \
94 --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \
95 --from-code ISO-8859-1 --join --sort-by-file \
95 --from-code ISO-8859-1 --join --sort-by-file \
96 -d hg -p i18n -o hg.pot
96 -d hg -p i18n -o hg.pot
97
97
98 %.po: i18n/hg.pot
98 %.po: i18n/hg.pot
99 msgmerge --no-location --update $@ $^
99 msgmerge --no-location --update $@ $^
100
100
101 .PHONY: help all local build doc clean install install-bin install-doc \
101 .PHONY: help all local build doc clean install install-bin install-doc \
102 install-home install-home-bin install-home-doc dist dist-notests tests \
102 install-home install-home-bin install-home-doc dist dist-notests tests \
103 update-pot
103 update-pot
General Comments 0
You need to be logged in to leave comments. Login now