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