##// END OF EJS Templates
make: add forgotten hgext3rd to clean rule
Sean Farley -
r28975:1828f13b default
parent child Browse files
Show More
@@ -1,232 +1,232
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 $(eval HGROOT := $(shell pwd))
11 11 HGPYTHONS ?= $(HGROOT)/build/pythons
12 12 PURE=
13 13 PYFILES:=$(shell find mercurial hgext doc -name '*.py')
14 14 DOCFILES=mercurial/help/*.txt
15 15 export LANGUAGE=C
16 16 export LC_ALL=C
17 17 TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)
18 18
19 19 # Set this to e.g. "mingw32" to use a non-default compiler.
20 20 COMPILER=
21 21
22 22 help:
23 23 @echo 'Commonly used make targets:'
24 24 @echo ' all - build program and documentation'
25 25 @echo ' install - install program and man pages to $$PREFIX ($(PREFIX))'
26 26 @echo ' install-home - install with setup.py install --home=$$HOME ($(HOME))'
27 27 @echo ' local - build for inplace usage'
28 28 @echo ' tests - run all tests in the automatic test suite'
29 29 @echo ' test-foo - run only specified tests (e.g. test-merge1.t)'
30 30 @echo ' dist - run all tests and create a source tarball in dist/'
31 31 @echo ' clean - remove files created by other targets'
32 32 @echo ' (except installed files or dist source tarball)'
33 33 @echo ' update-pot - update i18n/hg.pot'
34 34 @echo
35 35 @echo 'Example for a system-wide installation under /usr/local:'
36 36 @echo ' make all && su -c "make install" && hg version'
37 37 @echo
38 38 @echo 'Example for a local installation (usable in this directory):'
39 39 @echo ' make local && ./hg version'
40 40
41 41 all: build doc
42 42
43 43 local:
44 44 $(PYTHON) setup.py $(PURE) \
45 45 build_py -c -d . \
46 46 build_ext $(COMPILER:%=-c %) -i \
47 47 build_hgexe $(COMPILER:%=-c %) -i \
48 48 build_mo
49 49 env HGRCPATH= $(PYTHON) hg version
50 50
51 51 build:
52 52 $(PYTHON) setup.py $(PURE) build $(COMPILER:%=-c %)
53 53
54 54 wheel:
55 55 FORCE_SETUPTOOLS=1 $(PYTHON) setup.py $(PURE) bdist_wheel $(COMPILER:%=-c %)
56 56
57 57 doc:
58 58 $(MAKE) -C doc
59 59
60 60 clean:
61 61 -$(PYTHON) setup.py clean --all # ignore errors from this command
62 find contrib doc hgext i18n mercurial tests \
62 find contrib doc hgext hgext3rd i18n mercurial tests \
63 63 \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';'
64 64 rm -f $(addprefix mercurial/,$(notdir $(wildcard mercurial/pure/[a-z]*.py)))
65 65 rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err
66 66 rm -f mercurial/__modulepolicy__.py
67 67 if test -d .hg; then rm -f mercurial/__version__.py; fi
68 68 rm -rf build mercurial/locale
69 69 $(MAKE) -C doc clean
70 70 $(MAKE) -C contrib/chg distclean
71 71
72 72 install: install-bin install-doc
73 73
74 74 install-bin: build
75 75 $(PYTHON) setup.py $(PURE) install --root="$(DESTDIR)/" --prefix="$(PREFIX)" --force
76 76
77 77 install-doc: doc
78 78 cd doc && $(MAKE) $(MFLAGS) install
79 79
80 80 install-home: install-home-bin install-home-doc
81 81
82 82 install-home-bin: build
83 83 $(PYTHON) setup.py $(PURE) install --home="$(HOME)" --prefix="" --force
84 84
85 85 install-home-doc: doc
86 86 cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install
87 87
88 88 MANIFEST-doc:
89 89 $(MAKE) -C doc MANIFEST
90 90
91 91 MANIFEST.in: MANIFEST-doc
92 92 hg manifest | sed -e 's/^/include /' > MANIFEST.in
93 93 echo include mercurial/__version__.py >> MANIFEST.in
94 94 sed -e 's/^/include /' < doc/MANIFEST >> MANIFEST.in
95 95
96 96 dist: tests dist-notests
97 97
98 98 dist-notests: doc MANIFEST.in
99 99 TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist
100 100
101 101 check: tests
102 102
103 103 tests:
104 104 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
105 105
106 106 test-%:
107 107 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
108 108
109 109 testpy-%:
110 110 @echo Looking for Python $* in $(HGPYTHONS)
111 111 [ -e $(HGPYTHONS)/$*/bin/python ] || ( \
112 112 cd $$(mktemp --directory --tmpdir) && \
113 113 $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python )
114 114 cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS)
115 115
116 116 check-code:
117 117 hg manifest | xargs python contrib/check-code.py
118 118
119 119 update-pot: i18n/hg.pot
120 120
121 121 i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n/posplit i18n/hggettext
122 122 $(PYTHON) i18n/hggettext mercurial/commands.py \
123 123 hgext/*.py hgext/*/__init__.py \
124 124 mercurial/fileset.py mercurial/revset.py \
125 125 mercurial/templatefilters.py mercurial/templatekw.py \
126 126 mercurial/templater.py \
127 127 mercurial/filemerge.py \
128 128 mercurial/hgweb/webcommands.py \
129 129 $(DOCFILES) > i18n/hg.pot.tmp
130 130 # All strings marked for translation in Mercurial contain
131 131 # ASCII characters only. But some files contain string
132 132 # literals like this '\037\213'. xgettext thinks it has to
133 133 # parse them even though they are not marked for translation.
134 134 # Extracting with an explicit encoding of ISO-8859-1 will make
135 135 # xgettext "parse" and ignore them.
136 136 echo $(PYFILES) | xargs \
137 137 xgettext --package-name "Mercurial" \
138 138 --msgid-bugs-address "<mercurial-devel@selenic.com>" \
139 139 --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \
140 140 --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
141 141 -d hg -p i18n -o hg.pot.tmp
142 142 $(PYTHON) i18n/posplit i18n/hg.pot.tmp
143 143 # The target file is not created before the last step. So it never is in
144 144 # an intermediate state.
145 145 mv -f i18n/hg.pot.tmp i18n/hg.pot
146 146
147 147 %.po: i18n/hg.pot
148 148 # work on a temporary copy for never having a half completed target
149 149 cp $@ $@.tmp
150 150 msgmerge --no-location --update $@.tmp $^
151 151 mv -f $@.tmp $@
152 152
153 153 # Packaging targets
154 154
155 155 osx:
156 156 python -c 'import bdist_mpkg.script_bdist_mpkg' || \
157 157 (echo "Missing bdist_mpkg (easy_install bdist_mpkg)"; false)
158 158 rm -rf dist/mercurial-*.mpkg
159 159 python -m bdist_mpkg.script_bdist_mpkg setup.py --
160 160 python contrib/fixpax.py dist/mercurial-*.mpkg/Contents/Packages/*.pkg/Contents/Archive.pax.gz
161 161 mkdir -p packages/osx
162 162 N=`cd dist && echo mercurial-*.mpkg | sed 's,\.mpkg$$,,'` && hdiutil create -srcfolder dist/$$N.mpkg/ -scrub -volname "$$N" -ov packages/osx/$$N.dmg
163 163 rm -rf dist/mercurial-*.mpkg
164 164
165 165 deb:
166 166 contrib/builddeb
167 167
168 168 docker-debian-jessie:
169 169 mkdir -p packages/debian-jessie
170 170 contrib/dockerdeb debian jessie
171 171
172 172 docker-ubuntu-trusty:
173 173 mkdir -p packages/ubuntu-trusty
174 174 contrib/dockerdeb ubuntu trusty
175 175
176 176 fedora20:
177 177 mkdir -p packages/fedora20
178 178 contrib/buildrpm
179 179 cp rpmbuild/RPMS/*/* packages/fedora20
180 180 cp rpmbuild/SRPMS/* packages/fedora20
181 181 rm -rf rpmbuild
182 182
183 183 docker-fedora20:
184 184 mkdir -p packages/fedora20
185 185 contrib/dockerrpm fedora20
186 186
187 187 fedora21:
188 188 mkdir -p packages/fedora21
189 189 contrib/buildrpm
190 190 cp rpmbuild/RPMS/*/* packages/fedora21
191 191 cp rpmbuild/SRPMS/* packages/fedora21
192 192 rm -rf rpmbuild
193 193
194 194 docker-fedora21:
195 195 mkdir -p packages/fedora21
196 196 contrib/dockerrpm fedora21
197 197
198 198 centos5:
199 199 mkdir -p packages/centos5
200 200 contrib/buildrpm --withpython
201 201 cp rpmbuild/RPMS/*/* packages/centos5
202 202 cp rpmbuild/SRPMS/* packages/centos5
203 203
204 204 docker-centos5:
205 205 mkdir -p packages/centos5
206 206 contrib/dockerrpm centos5 --withpython
207 207
208 208 centos6:
209 209 mkdir -p packages/centos6
210 210 contrib/buildrpm
211 211 cp rpmbuild/RPMS/*/* packages/centos6
212 212 cp rpmbuild/SRPMS/* packages/centos6
213 213
214 214 docker-centos6:
215 215 mkdir -p packages/centos6
216 216 contrib/dockerrpm centos6
217 217
218 218 centos7:
219 219 mkdir -p packages/centos7
220 220 contrib/buildrpm
221 221 cp rpmbuild/RPMS/*/* packages/centos7
222 222 cp rpmbuild/SRPMS/* packages/centos7
223 223
224 224 docker-centos7:
225 225 mkdir -p packages/centos7
226 226 contrib/dockerrpm centos7
227 227
228 228 .PHONY: help all local build doc clean install install-bin install-doc \
229 229 install-home install-home-bin install-home-doc \
230 230 dist dist-notests check tests check-code update-pot \
231 231 osx fedora20 docker-fedora20 fedora21 docker-fedora21 \
232 232 centos5 docker-centos5 centos6 docker-centos6 centos7 docker-centos7
General Comments 0
You need to be logged in to leave comments. Login now