Commit 006576a6 authored by Martín Ferrari's avatar Martín Ferrari

Some improvements to the Makefile.

parent 75f3762b
......@@ -2,9 +2,11 @@ SRC = src
TEST = test
BUILDDIR = build
DISTDIR = dist
COVERDIR = coverage
SRCFILES := $(shell find $(SRC) -type f)
# stupid distutils, it's broken in so many ways
SUBBUILDDIR = $(shell python -c 'import distutils.util, sys; \
SUBBUILDDIR := $(shell python -c 'import distutils.util, sys; \
print "lib.%s-%s" % (distutils.util.get_platform(), \
sys.version[0:3])')
PYTHON25 := $(shell python -c 'import sys; v = sys.version_info; \
......@@ -16,11 +18,13 @@ else
BUILDDIR := $(BUILDDIR)/lib
endif
COVERAGE = $(or $(shell which coverage), $(shell which python-coverage), \
coverage)
COVERAGE := $(or $(shell which coverage), $(shell which python-coverage), \
coverage)
all:
all: build_stamp
build_stamp: $(SRCFILES)
./setup.py build
touch $@
install: all
./setup.py install
......@@ -32,25 +36,32 @@ test: all
PYTHONPATH="$(BUILDDIR)" $$i || retval=$$?; \
done; exit $$retval
coverage: all
rm -f .coverage
coverage: coverage_stamp
$(COVERAGE) -r -m `find "$(BUILDDIR)" -name \\*.py -type f`
coverage-report: coverage_stamp
rm -rf $(COVERDIR)
$(COVERAGE) -b -d $(COVERDIR) `find "$(BUILDDIR)" -name \\*.py -type f`
@echo "Coverage report created in $(COVERDIR)/index.html"
coverage_stamp: build_stamp
for i in `find "$(TEST)" -perm -u+x -type f`; do \
set -e; \
PYTHONPATH="$(BUILDDIR)" $(COVERAGE) -x $$i; \
done
$(COVERAGE) -c
$(COVERAGE) -r -m `find "$(BUILDDIR)" -name \\*.py -type f`
rm -f .coverage
touch $@
clean:
./setup.py clean
rm -f `find -name \*.pyc` .coverage *.pcap
rm -f `find -name \*.pyc` .coverage *.pcap *_stamp
rm -rf $(COVERDIR)
$(MAKE) -C $(CURDIR)/benchmarks/ clean
distclean: clean
rm -rf "$(DISTDIR)"
MANIFEST:
MANIFEST: distclean
find . -path ./.hg -prune -o -path ./build -prune -o \
-name \*.pyc -prune -o -name \*.swp -prune -o \
-name MANIFEST -prune -o -type f -print | \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment