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 --install-lib="$(INSTDIR)" --install-scripts="$(INSTDIR)/scripts"
54 $(PP) $(PYTHON) src/zfec/fec/test/test_zfec.py
57 -cd src/zfec && python ./setup.py clean --all
61 cd src/Crypto && $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --install-lib="$(INSTDIR)" --install-scripts="$(INSTDIR)/scripts"
64 cd src/Crypto && python ./setup.py clean --all
67 .PHONY: run-queen run-client test
70 cd queen-basedir && PYTHONPATH=.. twistd -noy ../queen.tac
73 cd client-basedir && $(PP) twistd -noy ../client.tac
76 cd client-basedir2 && PYTHONPATH=.. twistd -noy ../client.tac
78 cd client-basedir3 && PYTHONPATH=.. twistd -noy ../client.tac
85 # use 'make test REPORTER=--reporter=bwverbose' from buildbot, to supress the
86 # ansi color sequences
88 $(PP) $(TRIAL) $(REPORTER) $(TEST)
92 $(PP) $(TRIAL) --reporter=bwverbose-figleaf $(TEST)
95 $(PP) $(PYTHON) misc/figleaf2html -d coverage-html -r $(INSTDIR) -x misc/figleaf.excludes
96 @echo "now point your browser at coverage-html/index.html"
97 # after doing test-figleaf and figleaf-output, point your browser at
98 # coverage-html/index.html
100 # this command is meant to be run with an
103 rsync -a coverage-html/ $(UPLOAD_TARGET)
106 echo "this target is meant to be run with UPLOAD_TARGET=host:/path/"
110 .figleaf.el: .figleaf
111 $(PP) $(PYTHON) misc/figleaf2el.py .figleaf $(INSTDIR)
114 pyflakes src/allmydata
118 @find src -name '*.py' |grep -v /build/ |wc --lines
120 @cat `find src -name '*.py' |grep -v /build/` |wc --lines
122 @grep TODO `find src -name '*.py' |grep -v /build/` | wc --lines
125 $(PP) $(PYTHON) src/allmydata/test/check_memory.py
127 clean: clean-zfec clean-Crypto
133 mkdir -p queen-basedir
134 mkdir -p client-basedir
135 mkdir -p client-basedir2
136 mkdir -p client-basedir/storage
137 mkdir -p client-basedir2/storage
139 DEBVER=`head -1 debian/changelog | sed -e 's/^[^(]*(\([^)]*\)).*$$/\1/' | sed -e 's/^\([0-9]\+\.[0-9]\+\.[0-9]\+\).*$$/\1/'`
140 DEBSTRING=$(DEBVER)-T`date +%s`
141 DEBCOMMENTS="'make deb' build"
147 .PHONY: setup-dapper setup-sid setup-edgy setup-feisty
148 .PHONY: deb-dapper deb-sid deb-edgy deb-feisty
149 .PHONY: increment-deb-version
150 .PHONY: deb-dapper-head deb-sid-head deb-edgy-head deb-feisty-head
154 ln -s dapper/debian debian
155 chmod a+x debian/rules
159 ln -s sid/debian debian
160 chmod a+x debian/rules
162 # edgy uses the feisty control files for now
165 ln -s feisty/debian debian
166 chmod a+x debian/rules
170 ln -s feisty/debian debian
171 chmod a+x debian/rules
174 deb-dapper: setup-dapper
175 fakeroot debian/rules binary
177 fakeroot debian/rules binary
179 fakeroot debian/rules binary
180 deb-feisty: setup-feisty
181 fakeroot debian/rules binary
183 increment-deb-version:
184 debchange --newversion $(DEBSTRING) $(DEBCOMMENTS)
185 deb-dapper-head: setup-dapper increment-deb-version
186 fakeroot debian/rules binary
187 deb-sid-head: setup-sid increment-deb-version
188 fakeroot debian/rules binary
189 deb-edgy-head: setup-edgy increment-deb-version
190 fakeroot debian/rules binary
191 deb-feisty-head: setup-feisty increment-deb-version
192 fakeroot debian/rules binary