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 build-foolscap
53 $(PP) $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --prefix="." --root="$(INSTDIR)" --install-lib="." --install-scripts="scripts"
57 $(PP) $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --prefix="." --root="$(INSTDIR)" --install-lib="." --install-scripts="scripts"
61 $(PP) $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --prefix="." --root="$(INSTDIR)" --install-lib="." --install-scripts="scripts"
65 $(PP) $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --prefix="." --root="$(INSTDIR)" --install-lib="." --install-scripts="scripts"
69 $(PP) $(PYTHON) ./setup.py clean --all
73 $(PP) $(PYTHON) ./setup.py clean --all
77 $(PP) $(PYTHON) ./setup.py clean --all
82 # these targets let you create a client node in the current directory and
85 .PHONY: create-client start-client stop-client run-client
86 .PHONY: create-introducer start-introducer stop-introducer
89 $(PP) $(PYTHON) bin/allmydata-tahoe create-client -C CLIENTDIR
91 $(PP) $(PYTHON) bin/allmydata-tahoe start -C CLIENTDIR
93 $(PP) $(PYTHON) bin/allmydata-tahoe stop -C CLIENTDIR
95 create-introducer: build
96 $(PP) $(PYTHON) bin/allmydata-tahoe create-introducer -C INTRODUCERDIR
97 start-introducer: build
98 $(PP) $(PYTHON) bin/allmydata-tahoe start -C INTRODUCERDIR
99 stop-introducer: build
100 $(PP) $(PYTHON) bin/allmydata-tahoe stop -C INTRODUCERDIR
109 TEST=allmydata zfec # foolscap
113 # use 'make test REPORTER=--reporter=bwverbose' from buildbot, to supress the
114 # ansi color sequences
116 $(PP) $(TRIAL) $(REPORTER) $(TEST)
120 $(PP) $(TRIAL) --reporter=bwverbose-figleaf $(TEST)
123 $(PP) $(PYTHON) misc/figleaf2html -d coverage-html -r $(INSTDIR) -x misc/figleaf.excludes
124 @echo "now point your browser at coverage-html/index.html"
125 # after doing test-figleaf and figleaf-output, point your browser at
126 # coverage-html/index.html
128 # this command is meant to be run with an
131 rsync -a coverage-html/ $(UPLOAD_TARGET)
134 echo "this target is meant to be run with UPLOAD_TARGET=host:/path/"
138 .figleaf.el: .figleaf
139 $(PP) $(PYTHON) misc/figleaf2el.py .figleaf $(INSTDIR)
142 $(PP) $(PYTHON) -OOu `which pyflakes` src/allmydata
146 @find src -name '*.py' |grep -v /build/ |wc --lines
148 @cat `find src -name '*.py' |grep -v /build/` |wc --lines
150 @grep TODO `find src -name '*.py' |grep -v /build/` | wc --lines
153 $(PP) $(PYTHON) src/allmydata/test/check_memory.py
155 clean: clean-zfec clean-Crypto clean-foolscap
161 mkdir -p introducer_and_vdrive-basedir
162 mkdir -p client-basedir
163 mkdir -p client-basedir2
164 mkdir -p client-basedir/storage
165 mkdir -p client-basedir2/storage
167 DEBVER=`head -1 debian/changelog | sed -e 's/^[^(]*(\([^)]*\)).*$$/\1/' | sed -e 's/^\([0-9]\+\.[0-9]\+\.[0-9]\+\).*$$/\1/'`
168 DEBSTRING=$(DEBVER)-T`date +%s`
169 DEBCOMMENTS="'make deb' build"
175 .PHONY: setup-dapper setup-sid setup-edgy setup-feisty
176 .PHONY: deb-dapper deb-sid deb-edgy deb-feisty
177 .PHONY: increment-deb-version
178 .PHONY: deb-dapper-head deb-sid-head deb-edgy-head deb-feisty-head
182 ln -s dapper/debian debian
183 chmod a+x debian/rules
187 ln -s sid/debian debian
188 chmod a+x debian/rules
190 # edgy uses the feisty control files for now
193 ln -s feisty/debian debian
194 chmod a+x debian/rules
198 ln -s feisty/debian debian
199 chmod a+x debian/rules
202 deb-dapper: setup-dapper
203 fakeroot debian/rules binary
205 fakeroot debian/rules binary
207 fakeroot debian/rules binary
208 deb-feisty: setup-feisty
209 fakeroot debian/rules binary
211 increment-deb-version:
212 debchange --newversion $(DEBSTRING) $(DEBCOMMENTS)
213 deb-dapper-head: setup-dapper increment-deb-version
214 fakeroot debian/rules binary
215 deb-sid-head: setup-sid increment-deb-version
216 fakeroot debian/rules binary
217 deb-edgy-head: setup-edgy increment-deb-version
218 fakeroot debian/rules binary
219 deb-feisty-head: setup-feisty increment-deb-version
220 fakeroot debian/rules binary