-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (66 loc) · 2 KB
/
Makefile
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
ifeq ("$(ARCH)", "")
UARCH=$(shell uname -m)
ifeq ("$(UARCH)", "aarch64")
export ARCH=arm64
else
export ARCH=x86
endif
endif
ifeq ("$(notdir $(PWD))", "build-$(ARCH)")
export KERNEL_DIR = $(dir $(PWD))
else
export KERNEL_DIR = $(PWD)
endif
export KGDBTEST_DIR = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# Include kdmx in the path
export PATH := $(PATH):$(shell pwd)/agent-proxy/kdmx
test :
pytest-3 $(PYTEST_VERBOSE) $(PYTEST_RESTRICT) $(PYTEST_EXTRAFLAGS)
interact :
ifeq ("$(origin K)", "command line")
tests/interact.py $(K)
else
tests/interact.py
endif
ifeq ("$(origin K)", "command line")
PYTEST_RESTRICT = -k '$(K)'
else
PYTEST_RESTRICT =
endif
ifeq ("$(origin V)", "command line")
PYTEST_VERBOSE = $(V)
else
PYTEST_VERBOSE = 0
endif
ifeq ($(PYTEST_VERBOSE),2)
PYTEST_VERBOSE = -v -s
else ifeq ($(PYTEST_VERBOSE),1)
PYTEST_VERBOSE = -v
else
PYTEST_VERBOSE =
endif
submodule-update :
git submodule update --init
BUILDROOT ?= $(KGDBTEST_DIR)/buildroot/tree
BUILDROOT_INTERMEDIATES = \
$(KGDBTEST_DIR)/buildroot/$(ARCH)/build \
$(KGDBTEST_DIR)/buildroot/$(ARCH)/staging \
$(KGDBTEST_DIR)/buildroot/$(ARCH)/target
buildroot : kdmx buildroot-update buildroot-build buildroot-tidy
buildroot-update : submodule-update buildroot-config
buildroot-config :
(cd $(KGDBTEST_DIR)/buildroot/$(ARCH); $(MAKE) -C $(BUILDROOT) O=$$PWD olddefconfig)
# Remove intermediates, rather than doing a full clean, so we can (mostly)
# keep running tests whilst the rebuild happens
buildroot-build :
$(RM) -r $(BUILDROOT_INTERMEDIATES)
make -C $(KGDBTEST_DIR)/buildroot/$(ARCH)
buildroot-clean :
(cd $(KGDBTEST_DIR)/buildroot/$(ARCH); $(MAKE) -C $(BUILDROOT) O=$$PWD clean)
# This is enough to save disk space (and force a rebuild) but leaves
# the cross-compilers and root images alone.
buildroot-tidy :
$(RM) -r $(BUILDROOT_INTERMEDIATES)
kdmx : submodule-update
$(MAKE) -C agent-proxy/kdmx
.PHONY : submodule-update buildroot buildroot-update buildroot-config buildroot-build buildroot-clean buildroot-tidy