File: Makefile

package info (click to toggle)
rdiff-backup 2.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,000 kB
  • sloc: python: 16,554; ansic: 575; sh: 269; makefile: 36
file content (64 lines) | stat: -rw-r--r-- 2,010 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Makefile to automate rdiff-backup build and install steps

# Currently all steps are run isolated inside a Docker image, but this could
# be extended to have more options.
RUN_COMMAND ?= docker run --rm -i -v ${PWD}/..:/build/ -w /build/$(shell basename `pwd`) rdiff-backup-dev:debian-sid

# Define SUDO=sudo if you don't want to run the whole thing as root
# we set SUDO="sudo -E env PATH=$PATH" if we want to keep the whole environment
SUDO ?=

all: clean container test build

test: test-static test-runtime

test-static:
	${RUN_COMMAND} tox -c tox.ini -e flake8

test-runtime: test-runtime-base test-runtime-root test-runtime-slow

test-runtime-files:
	@echo "=== Install files required by the tests ==="
	${RUN_COMMAND} ./tools/setup-testfiles.sh  # This must run as root or sudo be available

test-runtime-base: test-runtime-files
	@echo "=== Base tests ==="
	${RUN_COMMAND} tox -c tox.ini -e py

test-runtime-root: test-runtime-files
	@echo "=== Tests that require root permissions ==="
	${RUN_COMMAND} ${SUDO} tox -c tox_root.ini -e py  # This must run as root
	# NOTE! Session will user=root inside Docker)

test-runtime-slow: test-runtime-files
	@echo "=== Long running performance tests ==="
	${RUN_COMMAND} tox -c tox_slow.ini -e py

test-misc: clean build test-static test-runtime-slow

build:
	# Build rdiff-backup (assumes src/ is in directory 'rdiff-backup' and it's
	# parent is writeable)
	${RUN_COMMAND} ./setup.py build

bdist_wheel:
	# Prepare wheel for deployment.
	# See the notes for target "build"
	# auditwheel unfortunately does not work with modern glibc
	${RUN_COMMAND} ./setup.py bdist_wheel
	# ${RUN_COMMAND} auditwheel repair dist/*.whl

sdist:
	# Prepare wheel for deployment.
	${RUN_COMMAND} ./setup.py sdist

dist_deb:
	${RUN_COMMAND} debian/autobuild.sh

container:
	# Build development image
	docker build --pull --tag rdiff-backup-dev:debian-sid .

clean:
	${RUN_COMMAND} rm -rf .tox/ MANIFEST build/ testing/__pycache__/ dist/
	${RUN_COMMAND} ${SUDO} rm -rf .tox.root/