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 ifneq ($(PYTHONPATH),)
39 PYTHONPATH := "$(PYTHONPATH)$(PATHSEP)$(INSTDIR)"
41 PYTHONPATH := "$(INSTDIR)"
44 TRIAL=$(PYTHON) -u "$(TRIALPATH)" --rterrors --reactor=$(REACTOR)
49 PP=PYTHONPATH=$(PYTHONPATH)
52 build: build-zfec build-Crypto
53 $(PYTHON) setup.py $(EXTRA_SETUP_ARGS) install --install-lib="$(INSTDIR)" --install-scripts="$(INSTDIR)/scripts"
56 cd src/zfec && $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --single-version-externally-managed --root="$(INSTDIR)" --install-lib="." --install-scripts="$(INSTDIR)/scripts"
59 -cd src/zfec && python ./setup.py clean --all
63 cd src/Crypto && $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --install-lib="$(INSTDIR)" --install-scripts="$(INSTDIR)/scripts"
66 cd src/Crypto && python ./setup.py clean --all
69 .PHONY: run-queen run-client test
72 cd queen-basedir && PYTHONPATH=.. twistd -noy ../queen.tac
75 cd client-basedir && $(PP) twistd -noy ../client.tac
78 cd client-basedir2 && PYTHONPATH=.. twistd -noy ../client.tac
80 cd client-basedir3 && PYTHONPATH=.. twistd -noy ../client.tac
87 # use 'make test REPORTER=--reporter=bwverbose' from buildbot, to supress the
88 # ansi color sequences
90 $(PP) $(TRIAL) $(REPORTER) $(TEST)
94 $(PP) $(TRIAL) --reporter=bwverbose-figleaf $(TEST)
97 $(PP) $(PYTHON) misc/figleaf2html -d coverage-html -r $(INSTDIR) -x misc/figleaf.excludes
98 @echo "now point your browser at coverage-html/index.html"
99 # after doing test-figleaf and figleaf-output, point your browser at
100 # coverage-html/index.html
102 # this command is meant to be run with an
105 rsync -a coverage-html/ $(UPLOAD_TARGET)
108 echo "this target is meant to be run with UPLOAD_TARGET=host:/path/"
112 .figleaf.el: .figleaf
113 $(PP) $(PYTHON) misc/figleaf2el.py .figleaf $(INSTDIR)
116 $(PYTHON) -OOu /usr/local/bin/pyflakes src/allmydata
120 @find src -name '*.py' |grep -v /build/ |wc --lines
122 @cat `find src -name '*.py' |grep -v /build/` |wc --lines
124 @grep TODO `find src -name '*.py' |grep -v /build/` | wc --lines
127 $(PP) $(PYTHON) src/allmydata/test/check_memory.py
129 clean: clean-zfec clean-Crypto
135 mkdir -p queen-basedir
136 mkdir -p client-basedir
137 mkdir -p client-basedir2
138 mkdir -p client-basedir/storage
139 mkdir -p client-basedir2/storage
141 DEBVER=`head -1 debian/changelog | sed -e 's/^[^(]*(\([^)]*\)).*$$/\1/' | sed -e 's/^\([0-9]\+\.[0-9]\+\.[0-9]\+\).*$$/\1/'`
142 DEBSTRING=$(DEBVER)-T`date +%s`
143 DEBCOMMENTS="'make deb' build"
149 .PHONY: setup-dapper setup-sid setup-edgy setup-feisty
150 .PHONY: deb-dapper deb-sid deb-edgy deb-feisty
151 .PHONY: increment-deb-version
152 .PHONY: deb-dapper-head deb-sid-head deb-edgy-head deb-feisty-head
156 ln -s dapper/debian debian
157 chmod a+x debian/rules
161 ln -s sid/debian debian
162 chmod a+x debian/rules
164 # edgy uses the feisty control files for now
167 ln -s feisty/debian debian
168 chmod a+x debian/rules
172 ln -s feisty/debian debian
173 chmod a+x debian/rules
176 deb-dapper: setup-dapper
177 fakeroot debian/rules binary
179 fakeroot debian/rules binary
181 fakeroot debian/rules binary
182 deb-feisty: setup-feisty
183 fakeroot debian/rules binary
185 increment-deb-version:
186 debchange --newversion $(DEBSTRING) $(DEBCOMMENTS)
187 deb-dapper-head: setup-dapper increment-deb-version
188 fakeroot debian/rules binary
189 deb-sid-head: setup-sid increment-deb-version
190 fakeroot debian/rules binary
191 deb-edgy-head: setup-edgy increment-deb-version
192 fakeroot debian/rules binary
193 deb-feisty-head: setup-feisty increment-deb-version
194 fakeroot debian/rules binary