source: trunk/Makefile

Last change on this file was 4f649f3, checked in by Jean-Paul Calderone <exarkun@…>, at 2019-01-26T15:02:08Z

Don't upload because we can't

  • Property mode set to 100644
File size: 7.6 KB
Line 
1
2# NOTE: this Makefile requires GNU make
3
4default:
5        @echo "no default target"
6
7PYTHON=python
8export PYTHON
9PYFLAKES=pyflakes
10export PYFLAKES
11
12SOURCES=src/allmydata static misc setup.py
13APPNAME=tahoe-lafs
14
15# This is necessary only if you want to automatically produce a new
16# _version.py file from the current git history (without doing a build).
17.PHONY: make-version
18make-version:
19        $(PYTHON) ./setup.py update_version
20
21.built:
22        $(MAKE) build
23
24src/allmydata/_version.py:
25        $(MAKE) make-version
26
27# Build OS X pkg packages.
28.PHONY: build-osx-pkg test-osx-pkg upload-osx-pkg
29build-osx-pkg:
30        misc/build_helpers/build-osx-pkg.sh $(APPNAME)
31
32test-osx-pkg:
33        $(PYTHON) misc/build_helpers/test-osx-pkg.py
34
35upload-osx-pkg:
36        # [Failure instance: Traceback: <class 'OpenSSL.SSL.Error'>: [('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert unknown ca'), ('SSL routines', 'ssl3_write_bytes', 'ssl handshake failure')]
37        #
38        # @echo "uploading to ~tahoe-tarballs/OS-X-packages/ via flappserver"
39        # @if [ "X${BB_BRANCH}" = "Xmaster" ] || [ "X${BB_BRANCH}" = "X" ]; then \
40        #   flappclient --furlfile ~/.tahoe-osx-pkg-upload.furl upload-file tahoe-lafs-*-osx.pkg; \
41        #  else \
42        #   echo not uploading tahoe-lafs-osx-pkg because this is not trunk but is branch \"${BB_BRANCH}\" ; \
43        # fi
44
45.PHONY: smoketest
46smoketest:
47        -python ./src/allmydata/test/check_magicfolder_smoke.py kill
48        -rm -rf smoke_magicfolder/
49        python ./src/allmydata/test/check_magicfolder_smoke.py
50
51# code coverage-based testing is disabled temporarily, as we switch to tox.
52# This will eventually be added to a tox environment. The following comments
53# and variable settings are retained as notes for that future effort.
54
55## # code coverage: install the "coverage" package from PyPI, do "make
56## # test-coverage" to do a unit test run with coverage-gathering enabled, then
57## # use "make coverage-output" to generate an HTML report. Also see "make
58## # .coverage.el" and misc/coding_tools/coverage.el for Emacs integration.
59##
60## # This might need to be python-coverage on Debian-based distros.
61## COVERAGE=coverage
62##
63## COVERAGEARGS=--branch --source=src/allmydata
64##
65## # --include appeared in coverage-3.4
66## COVERAGE_OMIT=--include '$(CURDIR)/src/allmydata/*' --omit '$(CURDIR)/src/allmydata/test/*'
67
68
69.PHONY: code-checks
70#code-checks: build version-and-path check-interfaces check-miscaptures -find-trailing-spaces -check-umids pyflakes
71code-checks: check-interfaces check-debugging check-miscaptures -find-trailing-spaces -check-umids pyflakes
72
73.PHONY: check-interfaces
74        $(PYTHON) misc/coding_tools/check-interfaces.py 2>&1 |tee violations.txt
75        @echo
76
77.PHONY: check-debugging
78check-debugging:
79        $(PYTHON) misc/coding_tools/check-debugging.py
80        @echo
81
82.PHONY: check-miscaptures
83check-miscaptures:
84        $(PYTHON) misc/coding_tools/check-miscaptures.py $(SOURCES) 2>&1 |tee miscaptures.txt
85        @echo
86
87.PHONY: pyflakes
88pyflakes:
89        $(PYFLAKES) $(SOURCES) |sort |uniq
90        @echo
91
92.PHONY: check-umids
93check-umids:
94        $(PYTHON) misc/coding_tools/check-umids.py `find $(SOURCES) -name '*.py' -not -name 'old.py'`
95        @echo
96
97.PHONY: -check-umids
98-check-umids:
99        -$(PYTHON) misc/coding_tools/check-umids.py `find $(SOURCES) -name '*.py' -not -name 'old.py'`
100        @echo
101
102.PHONY: doc-checks
103doc-checks: check-rst
104
105.PHONY: check-rst
106check-rst:
107        @for x in `find *.rst docs -name "*.rst"`; do rst2html -v $${x} >/dev/null; done 2>&1 |grep -v 'Duplicate implicit target name:'
108        @echo
109
110.PHONY: count-lines
111count-lines:
112        @echo -n "files: "
113        @find src -name '*.py' |grep -v /build/ |wc -l
114        @echo -n "lines: "
115        @cat `find src -name '*.py' |grep -v /build/` |wc -l
116        @echo -n "TODO: "
117        @grep TODO `find src -name '*.py' |grep -v /build/` | wc -l
118        @echo -n "XXX: "
119        @grep XXX `find src -name '*.py' |grep -v /build/` | wc -l
120
121
122# Here is a list of testing tools that can be run with 'python' from a
123# virtualenv in which Tahoe has been installed. There used to be Makefile
124# targets for each, but the exact path to a suitable python is now up to the
125# developer. But as a hint, after running 'tox', ./.tox/py27/bin/python will
126# probably work.
127
128# src/allmydata/test/bench_dirnode.py
129
130
131# The check-speed and check-grid targets are disabled, since they depend upon
132# the pre-located $(TAHOE) executable that was removed when we switched to
133# tox. They will eventually be resurrected as dedicated tox environments.
134
135# The check-speed target uses a pre-established client node to run a canned
136# set of performance tests against a test network that is also
137# pre-established (probably on a remote machine). Provide it with the path to
138# a local directory where this client node has been created (and populated
139# with the necessary FURLs of the test network). This target will start that
140# client with the current code and then run the tests. Afterwards it will
141# stop the client.
142#
143# The 'sleep 5' is in there to give the new client a chance to connect to its
144# storageservers, since check_speed.py has no good way of doing that itself.
145
146##.PHONY: check-speed
147##check-speed: .built
148##      if [ -z '$(TESTCLIENTDIR)' ]; then exit 1; fi
149##      @echo "stopping any leftover client code"
150##      -$(TAHOE) stop $(TESTCLIENTDIR)
151##      $(TAHOE) start $(TESTCLIENTDIR)
152##      sleep 5
153##      $(TAHOE) @src/allmydata/test/check_speed.py $(TESTCLIENTDIR)
154##      $(TAHOE) stop $(TESTCLIENTDIR)
155
156# The check-grid target also uses a pre-established client node, along with a
157# long-term directory that contains some well-known files. See the docstring
158# in src/allmydata/test/check_grid.py to see how to set this up.
159##.PHONY: check-grid
160##check-grid: .built
161##      if [ -z '$(TESTCLIENTDIR)' ]; then exit 1; fi
162##      $(TAHOE) @src/allmydata/test/check_grid.py $(TESTCLIENTDIR) bin/tahoe
163
164.PHONY: test-get-ignore
165test-git-ignore:
166        $(MAKE)
167        $(PYTHON) misc/build_helpers/test-git-ignore.py
168
169.PHONY: test-clean
170test-clean:
171        find . |grep -vEe "allfiles.tmp|src/allmydata/_(version|appname).py" |sort >allfiles.tmp.old
172        $(MAKE)
173        $(MAKE) distclean
174        find . |grep -vEe "allfiles.tmp|src/allmydata/_(version|appname).py" |sort >allfiles.tmp.new
175        diff allfiles.tmp.old allfiles.tmp.new
176
177# It would be nice if 'make clean' deleted any automatically-generated
178# _version.py too, so that 'make clean; make all' could be useable as a
179# "what the heck is going on, get me back to a clean state', but we need
180# 'make clean' to work on non-checkout trees without destroying useful information.
181# Use 'make distclean' instead to delete all generated files.
182.PHONY: clean
183clean:
184        rm -rf build _trial_temp _test_memory .built
185        rm -f `find src *.egg -name '*.so' -or -name '*.pyc'`
186        rm -rf support dist
187        rm -rf `ls -d *.egg | grep -vEe"setuptools-|setuptools_darcs-|darcsver-"`
188        rm -rf *.pyc
189        rm -f bin/tahoe bin/tahoe.pyscript
190        rm -f *.pkg
191
192.PHONY: distclean
193distclean: clean
194        rm -rf src/*.egg-info
195        rm -f src/allmydata/_version.py
196        rm -f src/allmydata/_appname.py
197
198
199.PHONY: find-trailing-spaces
200find-trailing-spaces:
201        $(PYTHON) misc/coding_tools/find-trailing-spaces.py -r $(SOURCES)
202        @echo
203
204.PHONY: -find-trailing-spaces
205-find-trailing-spaces:
206        -$(PYTHON) misc/coding_tools/find-trailing-spaces.py -r $(SOURCES)
207        @echo
208
209.PHONY: fetch-and-unpack-deps
210fetch-and-unpack-deps:
211        @echo "test-and-unpack-deps is obsolete"
212
213.PHONY: test-desert-island
214test-desert-island:
215        @echo "test-desert-island is obsolete"
216
217.PHONY: test-pip-install
218test-pip-install:
219        @echo "test-pip-install is obsolete"
220
221# TARBALL GENERATION
222.PHONY: tarballs
223tarballs: # delegated to tox, so setup.py can update setuptools if needed
224        tox -e tarballs
225
226.PHONY: upload-tarballs
227upload-tarballs:
228        @if [ "X${BB_BRANCH}" = "Xmaster" ] || [ "X${BB_BRANCH}" = "X" ]; then for f in dist/*; do flappclient --furlfile ~/.tahoe-tarball-upload.furl upload-file $$f; done ; else echo not uploading tarballs because this is not trunk but is branch \"${BB_BRANCH}\" ; fi
Note: See TracBrowser for help on using the repository browser.