]> arthur.barton.de Git - bup.git/blobdiff - GNUmakefile
make: add check-py2 and check-py3 targets
[bup.git] / GNUmakefile
index 44be77c62bfec2044f27f63395d8ab9a269d054b..f3245f59c872f5f94ee06cf1a2ee8f7c6a4fb961 100644 (file)
@@ -69,7 +69,7 @@ config/config.vars: configure config/configure config/configure.inc config/*.in
 # _XOPEN_SOURCE version, i.e. -Werror crashes on a mismatch, so for
 # now, we're just going to let Python's version win.
 
-helpers_cflags := $(bup_python_cflags) $(bup_shared_cflags)
+helpers_cflags := $(bup_python_cflags) $(bup_shared_cflags) -I$(CURDIR)/src
 helpers_ldflags := $(bup_python_ldflags) $(bup_shared_ldflags)
 
 ifneq ($(strip $(bup_readline_cflags)),)
@@ -206,12 +206,16 @@ get_parallel_n = $(patsubst -j%,%,$(parallel_opt))
 maybe_specific_n = $(if $(filter -j%,$(parallel_opt)),-n$(get_parallel_n))
 xdist_opt = $(if $(filter -j,$(parallel_opt)),-nauto,$(maybe_specific_n))
 
-test: all test/tmp dev/python
-        if test yes = "$$(dev/python -c 'import xdist; print("yes")' 2>/dev/null)"; then \
+lint: dev/bup-exec dev/bup-python
+       ./pylint
+
+test: all test/tmp dev/python lint
+       ./bup features
+       if test yes = "$$(dev/python -c 'import xdist; print("yes")' 2>/dev/null)"; then \
           (set -x; ./pytest $(xdist_opt);) \
-        else \
-          (set -x; ./pytest;) \
-        fi
+       else \
+         (set -x; ./pytest;) \
+       fi
 
 stupid:
        PATH=/bin:/usr/bin $(MAKE) test
@@ -231,10 +235,14 @@ long-test: test
 long-check: export BUP_TEST_LEVEL=11
 long-check: check
 
-.PHONY: check-both
-check-both:
+.PHONY: check-py2 check-py3 check-both
+check-py3:
        $(MAKE) clean && BUP_PYTHON_CONFIG=python3-config $(MAKE) check
+check-py2:
        $(MAKE) clean && BUP_PYTHON_CONFIG=python2.7-config $(MAKE) check
+check-both:
+       $(MAKE) check-py3
+       $(MAKE) check-py2
 
 .PHONY: Documentation/all
 Documentation/all: $(man_roff) $(man_html)
@@ -248,11 +256,11 @@ Documentation/substvars: $(bup_deps)
 
 Documentation/%.1: Documentation/%.md Documentation/substvars
        $(pf); sed -f Documentation/substvars $< \
-         | $(PANDOC) -s -r markdown -w man -o $@
+         | "$(PANDOC)" -s -r markdown -w man -o $@
 
 Documentation/%.html: Documentation/%.md Documentation/substvars
        $(pf); sed -f Documentation/substvars $< \
-         | $(PANDOC) -s -r markdown -w html -o $@
+         | "$(PANDOC)" -s -r markdown -w html -o $@
 
 .PHONY: Documentation/clean
 Documentation/clean: