update openflow code before migration
[nepi.git] / Makefile
index 4909c6c..24e5b15 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
 SRCDIR      = $(CURDIR)/src
 TESTDIR     = $(CURDIR)/test
+TESTLIB  = $(TESTDIR)/lib
 BUILDDIR    = $(CURDIR)/build
 DISTDIR     = $(CURDIR)/dist
 
@@ -16,11 +17,11 @@ else
 BUILDDIR := $(BUILDDIR)/lib
 endif
 
-PYPATH = $(BUILDDIR):$(PYTHONPATH)
+PYPATH = $(BUILDDIR):$(TESTLIB):$(PYTHONPATH)
 COVERAGE = $(or $(shell which coverage), $(shell which python-coverage), \
           coverage)
 
-all:
+all: clean
        PYTHONPATH="$(PYTHONPATH):$(SRCDIR)" ./setup.py build
 
 install: all
@@ -33,6 +34,10 @@ test: all
               PYTHONPATH="$(PYPATH)" $$i -v || retval=$$?; \
               done; exit $$retval
 
+test-one: all
+       echo $(file) $(case)
+       PYTHONPATH="$(PYPATH)" python $(file) $(case)
+
 coverage: all
        rm -f .coverage
        for i in `find "$(TESTDIR)" -perm -u+x -type f`; do \
@@ -44,8 +49,8 @@ coverage: all
        rm -f .coverage
 
 clean:
-       ./setup.py clean
        rm -f `find -name \*.pyc` .coverage *.pcap
+       rm -rf "$(BUILDDIR)"
 
 distclean: clean
        rm -rf "$(DISTDIR)"