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