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