File: Makefile

package info (click to toggle)
kpatch 0.9.11-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,796 kB
  • sloc: ansic: 9,950; sh: 2,677; makefile: 260; asm: 35
file content (51 lines) | stat: -rw-r--r-- 1,240 bytes parent folder | download | duplicates (2)
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
include /etc/os-release

PATCH_DIR?=${ID}-${VERSION_ID}

all:
	$(error please specify local or remote)

local: slow

remote: remote_slow

slow: clean
	./kpatch-test --kpatch-build-opts="$(KPATCH_BUILD_OPTS)" -d $(PATCH_DIR) $(PATCHES)

quick: clean
	./kpatch-test --kpatch-build-opts="$(KPATCH_BUILD_OPTS)" -d $(PATCH_DIR) --quick $(PATCHES)

cached:
	./kpatch-test --kpatch-build-opts="$(KPATCH_BUILD_OPTS)" -d $(PATCH_DIR) --cached $(PATCHES)

vagrant: vagrant-quick

vagrant-quick:
	./test-vagrant

vagrant-slow:
	./test-vagrant --slow

clean:
	rm -f *.ko *.log COMBINED.patch

check_host:
ifndef SSH_HOST
	$(error SSH_HOST is undefined)
endif

SSH_USER ?= root

remote_setup: check_host
	ssh $(SSH_USER)@$(SSH_HOST) exit
	ssh $(SSH_USER)@$(SSH_HOST) "ls kpatch-setup &> /dev/null" || \
	(scp remote-setup $(SSH_USER)@$(SSH_HOST):kpatch-setup && \
	 ssh $(SSH_USER)@$(SSH_HOST) "./kpatch-setup")

remote_sync: remote_setup
	ssh $(SSH_USER)@$(SSH_HOST) "rm -rf kpatch-test"
	rsync -Cavz --include=core $(shell readlink -f ../../..) $(SSH_USER)@$(SSH_HOST):kpatch-test
	ssh $(SSH_USER)@$(SSH_HOST) "cd kpatch-test/kpatch && make"

remote_slow: remote_sync
	ssh $(SSH_USER)@$(SSH_HOST) "cd kpatch-test/kpatch/test/integration && make slow"