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