]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - GNUmakefile
make pyflakes run faster and with more alacrity
[tahoe-lafs/tahoe-lafs.git] / GNUmakefile
index 4c45f9d0433d628a42b85bf7758d5b8e1c92363c..0150e142f3fdc7c885153c11e2fa2fb9aace7745 100644 (file)
@@ -4,9 +4,15 @@ BASE=$(shell pwd)
 PYTHON=python
 INSTDIR=$(BASE)/instdir
 PATHSEP=$(shell python -c 'import os ; print os.pathsep')
-TRIALPATH=$(shell which trial.py)
+TRIALPATH=$(shell which trial.py 2>/dev/null)
 ifeq ($(TRIALPATH),)
-TRIALPATH=$(shell which trial)
+TRIALPATH=$(shell which trial 2>/dev/null)
+endif
+ifeq ($(TRIALPATH),)
+TRIALPATH=$(shell $(PYTHON) -c "import os, sys; print repr(os.path.join(sys.prefix, \"Scripts\", \"trial.py\"))")
+endif
+ifeq ($(TRIALPATH),)
+TRIALPATH=$(shell $(PYTHON) -c "import os, sys; print repr(os.path.join(sys.prefix, \"Scripts\", \"trial\"))")
 endif
 
 EXTRA_SETUP_ARGS=
@@ -20,7 +26,7 @@ else
  ifeq ($(PLAT),win32)
   # The platform is Windows with cygwin build tools and the native Python interpreter.
   EXTRA_SETUP_ARGS=build -c mingw32
-  REACTOR=iocp
+  REACTOR=select
   INSTDIR := $(shell cygpath -w $(INSTDIR))
   TRIALPATH := $(shell cygpath -w $(TRIALPATH))
   ifneq ($(PYTHONPATH),)
@@ -35,8 +41,7 @@ else
 PYTHONPATH := "$(INSTDIR)"
 endif
 
-TRIAL=$(PYTHON) -u "$(TRIALPATH)" --reactor=$(REACTOR)
-# $(error $(TRIAL))
+TRIAL=$(PYTHON) -u "$(TRIALPATH)" --rterrors --reactor=$(REACTOR)
 
 show-instdir:
        @echo $(INSTDIR)
@@ -44,24 +49,21 @@ show-instdir:
 PP=PYTHONPATH=$(PYTHONPATH)
 
 .PHONY: build
-build: build-pyfec build-Crypto
+build: build-zfec build-Crypto
        $(PYTHON) setup.py $(EXTRA_SETUP_ARGS) install --install-lib="$(INSTDIR)" --install-scripts="$(INSTDIR)/scripts"
 
-build-pyfec:
-       cd src/pyfec && $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --install-lib="$(INSTDIR)" --install-scripts="$(INSTDIR)/scripts"
-
-test-pyfec:
-       $(PP) $(PYTHON) src/pyfec/fec/test/test_pyfec.py
+build-zfec:
+       cd src/zfec && $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --single-version-externally-managed --root="$(INSTDIR)" --install-lib="." --install-scripts="$(INSTDIR)/scripts"
 
-clean-pyfec:
-       cd src/pyfec && python ./setup.py clean
+clean-zfec:
+       -cd src/zfec && python ./setup.py clean --all
 
 
 build-Crypto:
        cd src/Crypto && $(PYTHON) ./setup.py $(EXTRA_SETUP_ARGS) install --install-lib="$(INSTDIR)" --install-scripts="$(INSTDIR)/scripts"
 
 clean-Crypto:
-       cd src/Crypto && python ./setup.py clean
+       cd src/Crypto && python ./setup.py clean --all
 
 
 .PHONY: run-queen run-client test
@@ -78,7 +80,7 @@ run-client3:
        cd client-basedir3 && PYTHONPATH=.. twistd -noy ../client.tac
 
 ifeq ($(TEST),)
-TEST=allmydata fec
+TEST=allmydata zfec
 endif
 REPORTER=
 
@@ -92,7 +94,7 @@ test-figleaf: build
        $(PP) $(TRIAL) --reporter=bwverbose-figleaf $(TEST)
 
 figleaf-output:
-       $(PP) $(PYTHON) misc/figleaf2html -d coverage-html -r $(INSTDIR)
+       $(PP) $(PYTHON) misc/figleaf2html -d coverage-html -r $(INSTDIR) -x misc/figleaf.excludes
        @echo "now point your browser at coverage-html/index.html"
 # after doing test-figleaf and figleaf-output, point your browser at
 # coverage-html/index.html
@@ -111,7 +113,7 @@ endif
        $(PP) $(PYTHON) misc/figleaf2el.py .figleaf $(INSTDIR)
 
 pyflakes:
-       pyflakes src/allmydata
+       $(PYTHON) -OOu /usr/local/bin/pyflakes src/allmydata
 
 count-lines:
        @echo -n "files: "
@@ -124,7 +126,7 @@ count-lines:
 check-memory:
        $(PP) $(PYTHON) src/allmydata/test/check_memory.py
 
-clean: clean-pyfec clean-Crypto
+clean: clean-zfec clean-Crypto
        rm -rf build
        rm -f debian
        rm -rf instdir