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