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)
15 PLAT = $(strip $(shell python -c "import sys ; print sys.platform"))
17 # The platform is Windows with cygwin build tools and the cygwin Python interpreter.
18 INSTDIR := $(shell cygpath -u $(INSTDIR))
21 # The platform is Windows with cygwin build tools and the native Python interpreter.
22 EXTRA_SETUP_ARGS=build -c mingw32
24 INSTDIR := $(shell cygpath -w $(INSTDIR))
25 TRIALPATH := $(shell cygpath -w $(TRIALPATH))
26 ifneq ($(PYTHONPATH),)
27 PYTHONPATH := $(shell cygpath -w $(PYTHONPATH))
32 ifneq ($(PYTHONPATH),)
33 PYTHONPATH := "$(PYTHONPATH)$(PATHSEP)$(INSTDIR)"
35 PYTHONPATH := "$(INSTDIR)"
38 TRIAL=$(PYTHON) -u "$(TRIALPATH)" --reactor=$(REACTOR)
44 PP=PYTHONPATH=$(PYTHONPATH)
47 build: build-zfec build-Crypto
48 $(PYTHON) setup.py $(EXTRA_SETUP_ARGS) install --install-lib="$(INSTDIR)" --install-scripts="$(INSTDIR)/scripts"
51 cd src/zfec && $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --single-version-externally-managed --root="$(INSTDIR)" --install-lib="." --install-scripts="$(INSTDIR)/scripts"
54 -cd src/zfec && python ./setup.py clean --all
58 cd src/Crypto && $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --install-lib="$(INSTDIR)" --install-scripts="$(INSTDIR)/scripts"
61 cd src/Crypto && python ./setup.py clean --all
64 .PHONY: run-queen run-client test
67 cd queen-basedir && PYTHONPATH=.. twistd -noy ../queen.tac
70 cd client-basedir && $(PP) twistd -noy ../client.tac
73 cd client-basedir2 && PYTHONPATH=.. twistd -noy ../client.tac
75 cd client-basedir3 && PYTHONPATH=.. twistd -noy ../client.tac
82 # use 'make test REPORTER=--reporter=bwverbose' from buildbot, to supress the
83 # ansi color sequences
85 $(PP) $(TRIAL) $(REPORTER) $(TEST)
89 $(PP) $(TRIAL) --reporter=bwverbose-figleaf $(TEST)
92 $(PP) $(PYTHON) misc/figleaf2html -d coverage-html -r $(INSTDIR) -x misc/figleaf.excludes
93 @echo "now point your browser at coverage-html/index.html"
94 # after doing test-figleaf and figleaf-output, point your browser at
95 # coverage-html/index.html
97 # this command is meant to be run with an
100 rsync -a coverage-html/ $(UPLOAD_TARGET)
103 echo "this target is meant to be run with UPLOAD_TARGET=host:/path/"
107 .figleaf.el: .figleaf
108 $(PP) $(PYTHON) misc/figleaf2el.py .figleaf $(INSTDIR)
111 pyflakes src/allmydata
115 @find src -name '*.py' |grep -v /build/ |wc --lines
117 @cat `find src -name '*.py' |grep -v /build/` |wc --lines
119 @grep TODO `find src -name '*.py' |grep -v /build/` | wc --lines
122 $(PP) $(PYTHON) src/allmydata/test/check_memory.py
124 clean: clean-zfec clean-Crypto
130 mkdir -p queen-basedir
131 mkdir -p client-basedir
132 mkdir -p client-basedir2
133 mkdir -p client-basedir/storage
134 mkdir -p client-basedir2/storage
136 DEBVER=`head -1 debian/changelog | sed -e 's/^[^(]*(\([^)]*\)).*$$/\1/' | sed -e 's/^\([0-9]\+\.[0-9]\+\.[0-9]\+\).*$$/\1/'`
137 DEBSTRING=$(DEBVER)-T`date +%s`
138 DEBCOMMENTS="'make deb' build"
144 .PHONY: setup-dapper setup-sid setup-edgy setup-feisty
145 .PHONY: deb-dapper deb-sid deb-edgy deb-feisty
146 .PHONY: increment-deb-version
147 .PHONY: deb-dapper-head deb-sid-head deb-edgy-head deb-feisty-head
151 ln -s dapper/debian debian
152 chmod a+x debian/rules
156 ln -s sid/debian debian
157 chmod a+x debian/rules
159 # edgy uses the feisty control files for now
162 ln -s feisty/debian debian
163 chmod a+x debian/rules
167 ln -s feisty/debian debian
168 chmod a+x debian/rules
171 deb-dapper: setup-dapper
172 fakeroot debian/rules binary
174 fakeroot debian/rules binary
176 fakeroot debian/rules binary
177 deb-feisty: setup-feisty
178 fakeroot debian/rules binary
180 increment-deb-version:
181 debchange --newversion $(DEBSTRING) $(DEBCOMMENTS)
182 deb-dapper-head: setup-dapper increment-deb-version
183 fakeroot debian/rules binary
184 deb-sid-head: setup-sid increment-deb-version
185 fakeroot debian/rules binary
186 deb-edgy-head: setup-edgy increment-deb-version
187 fakeroot debian/rules binary
188 deb-feisty-head: setup-feisty increment-deb-version
189 fakeroot debian/rules binary