##// END OF EJS Templates
Makefile: remove *.pyd files on "make clean".
Markus F.X.J. Oberhumer -
r4707:3fd4dde3 default
parent child Browse files
Show More
@@ -1,79 +1,79 b''
1 PREFIX=/usr/local
1 PREFIX=/usr/local
2 export PREFIX
2 export PREFIX
3 PYTHON=python
3 PYTHON=python
4
4
5 help:
5 help:
6 @echo 'Commonly used make targets:'
6 @echo 'Commonly used make targets:'
7 @echo ' all - build program and documentation'
7 @echo ' all - build program and documentation'
8 @echo ' install - install program and man pages to PREFIX ($(PREFIX))'
8 @echo ' install - install program and man pages to PREFIX ($(PREFIX))'
9 @echo ' install-home - install with setup.py install --home=HOME ($(HOME))'
9 @echo ' install-home - install with setup.py install --home=HOME ($(HOME))'
10 @echo ' local - build for inplace usage'
10 @echo ' local - build for inplace usage'
11 @echo ' tests - run all tests in the automatic test suite'
11 @echo ' tests - run all tests in the automatic test suite'
12 @echo ' test-foo - run only specified tests (e.g. test-merge1)'
12 @echo ' test-foo - run only specified tests (e.g. test-merge1)'
13 @echo ' dist - run all tests and create a source tarball in dist/'
13 @echo ' dist - run all tests and create a source tarball in dist/'
14 @echo ' clean - remove files created by other targets'
14 @echo ' clean - remove files created by other targets'
15 @echo ' (except installed files or dist source tarball)'
15 @echo ' (except installed files or dist source tarball)'
16 @echo
16 @echo
17 @echo 'Example for a system-wide installation under /usr/local:'
17 @echo 'Example for a system-wide installation under /usr/local:'
18 @echo ' make all && su -c "make install" && hg version'
18 @echo ' make all && su -c "make install" && hg version'
19 @echo
19 @echo
20 @echo 'Example for a local installation (usable in this directory):'
20 @echo 'Example for a local installation (usable in this directory):'
21 @echo ' make local && ./hg version'
21 @echo ' make local && ./hg version'
22
22
23 all: build doc
23 all: build doc
24
24
25 local:
25 local:
26 $(PYTHON) setup.py build_ext -i
26 $(PYTHON) setup.py build_ext -i
27 $(PYTHON) setup.py build_py -c -d .
27 $(PYTHON) setup.py build_py -c -d .
28 $(PYTHON) hg version
28 $(PYTHON) hg version
29
29
30 build:
30 build:
31 $(PYTHON) setup.py build
31 $(PYTHON) setup.py build
32
32
33 doc:
33 doc:
34 $(MAKE) -C doc
34 $(MAKE) -C doc
35
35
36 clean:
36 clean:
37 -$(PYTHON) setup.py clean --all # ignore errors of this command
37 -$(PYTHON) setup.py clean --all # ignore errors of this command
38 find . -name '*.py[co]' -exec rm -f '{}' ';'
38 find . -name '*.py[cdo]' -exec rm -f '{}' ';'
39 rm -f MANIFEST mercurial/__version__.py mercurial/*.so tests/*.err
39 rm -f MANIFEST mercurial/__version__.py mercurial/*.so tests/*.err
40 $(MAKE) -C doc clean
40 $(MAKE) -C doc clean
41
41
42 install: install-bin install-doc
42 install: install-bin install-doc
43
43
44 install-bin: build
44 install-bin: build
45 $(PYTHON) setup.py install --prefix="$(PREFIX)" --force
45 $(PYTHON) setup.py install --prefix="$(PREFIX)" --force
46
46
47 install-doc: doc
47 install-doc: doc
48 cd doc && $(MAKE) $(MFLAGS) install
48 cd doc && $(MAKE) $(MFLAGS) install
49
49
50 install-home: install-home-bin install-home-doc
50 install-home: install-home-bin install-home-doc
51
51
52 install-home-bin: build
52 install-home-bin: build
53 $(PYTHON) setup.py install --home="$(HOME)" --force
53 $(PYTHON) setup.py install --home="$(HOME)" --force
54
54
55 install-home-doc: doc
55 install-home-doc: doc
56 cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install
56 cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install
57
57
58 MANIFEST-doc:
58 MANIFEST-doc:
59 $(MAKE) -C doc MANIFEST
59 $(MAKE) -C doc MANIFEST
60
60
61 MANIFEST: MANIFEST-doc
61 MANIFEST: MANIFEST-doc
62 hg manifest > MANIFEST
62 hg manifest > MANIFEST
63 echo mercurial/__version__.py >> MANIFEST
63 echo mercurial/__version__.py >> MANIFEST
64 cat doc/MANIFEST >> MANIFEST
64 cat doc/MANIFEST >> MANIFEST
65
65
66 dist: tests dist-notests
66 dist: tests dist-notests
67
67
68 dist-notests: doc MANIFEST
68 dist-notests: doc MANIFEST
69 TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist
69 TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist
70
70
71 tests:
71 tests:
72 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
72 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
73
73
74 test-%:
74 test-%:
75 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
75 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
76
76
77
77
78 .PHONY: help all local build doc clean install install-bin install-doc \
78 .PHONY: help all local build doc clean install install-bin install-doc \
79 install-home install-home-bin install-home-doc dist dist-notests tests
79 install-home install-home-bin install-home-doc dist dist-notests tests
General Comments 0
You need to be logged in to leave comments. Login now