5 INSTDIR=$(BASE)/instdir
6 PATHSEP=$(shell python -c 'import os ; print os.pathsep')
7 TRIALPATH=$(shell which trial.py 2>/dev/null)
9 TRIALPATH=$(shell which trial 2>/dev/null)
12 TRIALPATH=$(shell $(PYTHON) -c "import os, sys; print repr(os.path.join(sys.prefix, \"Scripts\", \"trial.py\"))")
15 TRIALPATH=$(shell $(PYTHON) -c "import os, sys; print repr(os.path.join(sys.prefix, \"Scripts\", \"trial\"))")
21 PLAT = $(strip $(shell python -c "import sys ; print sys.platform"))
23 # The platform is Windows with cygwin build tools and the cygwin Python interpreter.
24 INSTDIR := $(shell cygpath -u $(INSTDIR))
27 # The platform is Windows with cygwin build tools and the native Python interpreter.
28 EXTRA_SETUP_ARGS=build -c mingw32
30 INSTDIR := $(shell cygpath -w $(INSTDIR))
31 TRIALPATH := $(shell cygpath -w $(TRIALPATH))
32 ifneq ($(PYTHONPATH),)
33 PYTHONPATH := $(shell cygpath -w $(PYTHONPATH))
38 ORIGPYTHONPATH=$(PYTHONPATH)
40 # Append instdir/lib instead of prepending it so that people can override
41 # things from lib with alternate packages of their choosing by setting their
44 ifneq ($(PYTHONPATH),)
45 PYTHONPATH := "$(PYTHONPATH)$(PATHSEP)$(INSTDIR)/lib"
47 PYTHONPATH := "$(INSTDIR)/lib"
50 TRIAL=$(PYTHON) -u "$(TRIALPATH)" --rterrors --reactor=$(REACTOR)
55 PP=PYTHONPATH=$(PYTHONPATH)
57 .PHONY: make-version build
59 $(PYTHON) misc/make-version.py
61 build: make-version build-zfec build-Crypto build-foolscap
62 $(PP) $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --prefix="$(INSTDIR)" --install-lib="$(INSTDIR)/lib" --install-scripts="$(INSTDIR)/bin"
66 $(PP) $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --single-version-externally-managed --prefix="$(INSTDIR)" --record="$(INSTDIR)/zfec_install.log" --install-lib="$(INSTDIR)/lib" --install-scripts="$(INSTDIR)/bin"
70 $(PP) $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --prefix="$(INSTDIR)" --record="$(INSTDIR)/foolscap_install.log" --install-lib="$(INSTDIR)/lib" --install-scripts="$(INSTDIR)/bin"
74 $(PP) $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --prefix="$(INSTDIR)" --record="$(INSTDIR)/Crypto_install.log" --install-lib="$(INSTDIR)/lib" --install-scripts="$(INSTDIR)/bin"
78 $(PP) $(PYTHON) ./setup.py clean --all
82 $(PP) $(PYTHON) ./setup.py clean --all
86 $(PP) $(PYTHON) ./setup.py clean --all
91 # these targets let you create a client node in the current directory and
94 .PHONY: create-client start-client stop-client run-client
95 .PHONY: create-introducer start-introducer stop-introducer
98 $(PP) $(PYTHON) bin/allmydata-tahoe create-client -C CLIENTDIR
100 $(PP) $(PYTHON) bin/allmydata-tahoe start -C CLIENTDIR
102 $(PP) $(PYTHON) bin/allmydata-tahoe stop -C CLIENTDIR
104 create-introducer: build
105 $(PP) $(PYTHON) bin/allmydata-tahoe create-introducer -C INTRODUCERDIR
106 start-introducer: build
107 $(PP) $(PYTHON) bin/allmydata-tahoe start -C INTRODUCERDIR
108 stop-introducer: build
109 $(PP) $(PYTHON) bin/allmydata-tahoe stop -C INTRODUCERDIR
115 .PHONY: test-all test test-foolscap test-figleaf figleaf-output
117 # you can use 'make test TEST=allmydata.test.test_introducer' to run just a
118 # specific test. TEST=allmydata.test.test_client.Basic.test_permute works
123 test-all: test-foolscap test
125 # use 'make test REPORTER=--reporter=bwverbose' from buildbot, to supress the
126 # ansi color sequences
129 $(PP) $(TRIAL) $(REPORTER) $(TEST)
131 # foolscap tests need to be run in their own source dir, so that the paths to
132 # the .pyc files are correct (since some of the foolscap tests depend upon
133 # stack traces having actual source code in them, and they don't when the
134 # tests are run from the 'instdir' that the tahoe makefile uses).
136 cd src/foolscap && PYTHONPATH=$(ORIGPYTHONPATH) $(TRIAL) $(REPORTER) foolscap
139 find $(INSTDIR) -name '*.pyc' |xargs rm
141 $(PP) $(TRIAL) --reporter=bwverbose-figleaf $(TEST)
144 $(PP) $(PYTHON) misc/figleaf2html -d coverage-html -r $(INSTDIR)/lib -x misc/figleaf.excludes
145 @echo "now point your browser at coverage-html/index.html"
147 # after doing test-figleaf and figleaf-output, point your browser at
148 # coverage-html/index.html
150 .PHONY: upload-figleaf .figleaf.el pyflakes count-lines check-memory clean
152 # 'upload-figleaf' is meant to be run with an UPLOAD_TARGET=host:/dir setting
155 rsync -a coverage-html/ $(UPLOAD_TARGET)
158 echo "this target is meant to be run with UPLOAD_TARGET=host:/path/"
162 .figleaf.el: .figleaf
163 $(PP) $(PYTHON) misc/figleaf2el.py .figleaf $(INSTDIR)/lib
166 $(PP) $(PYTHON) -OOu `which pyflakes` src/allmydata
170 @find src -name '*.py' |grep -v /build/ |wc --lines
172 @cat `find src -name '*.py' |grep -v /build/` |wc --lines
174 @grep TODO `find src -name '*.py' |grep -v /build/` | wc --lines
177 $(PP) $(PYTHON) src/allmydata/test/check_memory.py
179 test-darcs-boringfile:
181 $(PYTHON) misc/test-darcs-boringfile.py
184 find . |sort >allfiles.tmp.old
187 find . |grep -v allfiles.tmp |sort >allfiles.tmp.new
188 diff allfiles.tmp.old allfiles.tmp.new
190 clean: clean-zfec clean-Crypto clean-foolscap
197 VER=$(shell $(PYTHON) misc/get-version.py)
198 DEBCOMMENTS="'make deb' build"
203 .PHONY: setup-dapper setup-sid setup-edgy setup-feisty setup-etch
204 .PHONY: deb-dapper deb-sid deb-edgy deb-feisty deb-etch
205 .PHONY: increment-deb-version
206 .PHONY: deb-dapper-head deb-sid-head deb-edgy-head deb-feisty-head
207 .PHONY: deb-etch-head
211 ln -s dapper/debian debian
212 chmod a+x debian/rules
216 ln -s sid/debian debian
217 chmod a+x debian/rules
219 # edgy uses the feisty control files for now
222 ln -s feisty/debian debian
223 chmod a+x debian/rules
227 ln -s feisty/debian debian
228 chmod a+x debian/rules
230 # etch uses the fesity control files for now
233 ln -s feisty/debian debian
234 chmod a+x debian/rules
237 deb-dapper: setup-dapper
238 fakeroot debian/rules binary && \
239 make -C src/foolscap debian-dapper && \
240 mv src/python-foolscap*.deb .. && \
242 echo "The newly built .deb packages are in the parent directory from here."
245 fakeroot debian/rules binary && \
246 make -C src/foolscap debian-sid && \
247 mv src/python-foolscap*.deb .. && \
249 echo "The newly built .deb packages are in the parent directory from here."
252 fakeroot debian/rules binary && \
253 make -C src/foolscap debian-edgy && \
254 mv src/python-foolscap*.deb .. && \
256 echo "The newly built .deb packages are in the parent directory from here."
258 deb-feisty: setup-feisty
259 fakeroot debian/rules binary && \
260 make -C src/foolscap debian-feisty && \
261 mv src/python-foolscap*.deb .. && \
263 echo "The newly built .deb packages are in the parent directory from here."
266 fakeroot debian/rules binary && \
267 make -C src/foolscap debian-sid && \
268 mv src/python-foolscap*.deb .. && \
270 echo "The newly built .deb packages are in the parent directory from here."
272 increment-deb-version: make-version
273 debchange --newversion $(VER) $(DEBCOMMENTS)
274 deb-dapper-head: setup-dapper increment-deb-version
275 fakeroot debian/rules binary
276 deb-sid-head: setup-sid increment-deb-version
277 fakeroot debian/rules binary
278 deb-edgy-head: setup-edgy increment-deb-version
279 fakeroot debian/rules binary
280 deb-feisty-head: setup-feisty increment-deb-version
281 fakeroot debian/rules binary
282 deb-etch-head: setup-etch increment-deb-version
283 fakeroot debian/rules binary