AM_CFLAGS += -fomit-frame-pointer
endif
+# PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo
+# files. Creating .py[co] works OK for any given version of Open
+# vSwitch, but it causes trouble if you switch from a version with
+# foo/__init__.py into an (older) version with plain foo.py, since
+# foo/__init__.pyc will cause Python to ignore foo.py.
+run_python = \
+ PYTHONDONTWRITEBYTECODE=yes \
+ PYTHONPATH=$(top_srcdir)/python:$$PYTHONPATH \
+ $(PYTHON)
+
ALL_LOCAL =
BUILT_SOURCES =
CLEANFILES =
SUFFIXES += .h .hstamp
.h.hstamp:
- $(PYTHON) $(srcdir)/build-aux/check-structs -I$(srcdir)/include $<
+ $(run_python) $(srcdir)/build-aux/check-structs -I$(srcdir)/include $<
touch $@
HSTAMP_FILES = \
$(srcdir)/lib/ofp-errors.inc: \
lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
- $(PYTHON) $(srcdir)/build-aux/extract-ofp-errors \
+ $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
$(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
$(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
-run_python = PYTHONPATH=$(top_srcdir)/python:$$PYTHONPATH $(PYTHON)
-
ovstest_pyfiles = \
python/ovstest/__init__.py \
python/ovstest/args.py \
PYTHONIOENCODING=utf_8
export PYTHONIOENCODING
+# PYTHONDONTWRITEBYTECODE=yes keeps Python 2.6+ from creating .pyc and .pyo
+# files. Creating .py[co] works OK for any given version of Open
+# vSwitch, but it causes trouble if you switch from a version with
+# foo/__init__.py into an (older) version with plain foo.py, since
+# foo/__init__.pyc will cause Python to ignore foo.py.
+#
+# Python before version 2.6 always creates .pyc files, so if you develop
+# with such an older version then you're out of luck.
+PYTHONDONTWRITEBYTECODE=yes
+export PYTHONDONTWRITEBYTECODE
+
if test $HAVE_PYTHON = yes; then
if python -m argparse 2>/dev/null; then
:
COVERAGE = coverage
COVERAGE_FILE='$(abs_srcdir)/.coverage'
check-pycov: all tests/atconfig tests/atlocal $(TESTSUITE) clean-pycov
- COVERAGE_FILE=$(COVERAGE_FILE) PYTHON='$(COVERAGE) run -p' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
+ PYTHONDONTWRITEBYTECODE=yes COVERAGE_FILE=$(COVERAGE_FILE) PYTHON='$(COVERAGE) run -p' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
@cd $(srcdir) && $(COVERAGE) combine && COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) annotate
@echo
@echo '----------------------------------------------------------------------'