forked from dynup/kpatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (48 loc) · 1.89 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
include Makefile.inc
SUBDIRS = kpatch-build kpatch kmod man contrib
BUILD_DIRS = $(SUBDIRS:%=build-%)
INSTALL_DIRS = $(SUBDIRS:%=install-%)
UNINSTALL_DIRS = $(SUBDIRS:%=uninstall-%)
CLEAN_DIRS = $(SUBDIRS:%=clean-%)
UNITTEST_DIR = test/unit
INTEGRATION_DIR = test/integration
CLEAN_DIRS += clean-$(UNITTEST_DIR)
.PHONY: all install uninstall clean check unit
.PHONY: $(SUBDIRS) $(BUILD_DIRS) $(INSTALL_DIRS) $(CLEAN_DIRS)
.PHONY: integration integration-slow integration-quick
.PHONY: vagrant-integration-slow vagrant-integration-quick vagrant-integration
.PHONY: vagrant-install
all: $(BUILD_DIRS)
$(BUILD_DIRS):
$(MAKE) -C $(@:build-%=%)
install: $(INSTALL_DIRS)
$(INSTALL_DIRS):
$(MAKE) -C $(@:install-%=%) install
uninstall: $(UNINSTALL_DIRS)
$(UNINSTALL_DIRS):
$(MAKE) -C $(@:uninstall-%=%) uninstall
clean: $(CLEAN_DIRS)
$(CLEAN_DIRS):
$(MAKE) -C $(@:clean-%=%) clean
unit: $(UNITTEST_DIR)/Makefile build-kpatch-build
$(MAKE) -C $(UNITTEST_DIR)
integration: integration-quick
integration-slow: $(INTEGRATION_DIR)/Makefile build-kpatch-build build-kpatch build-kmod
$(MAKE) -C $(INTEGRATION_DIR) slow
integration-quick: $(INTEGRATION_DIR)/Makefile build-kpatch-build build-kpatch build-kmod
$(MAKE) -C $(INTEGRATION_DIR) quick
vagrant-install: $(INTEGRATION_DIR)/lib.sh
ifneq ($(shell id -u), 0)
@echo "WARNING: This target is intended for use on freshly-installed machines/vms only." && \
echo "Do not proceed unless you read $(INTEGRATION_DIR)/lib.sh and realise what this target does." && \
echo "Press ctrl-c to abort, return to proceed." && \
read
endif
source $(INTEGRATION_DIR)/lib.sh && kpatch_check_install_vagrant
vagrant-integration: vagrant-integration-quick
vagrant-integration-slow:
$(MAKE) -C $(INTEGRATION_DIR) vagrant-slow
vagrant-integration-quick:
$(MAKE) -C $(INTEGRATION_DIR) vagrant-quick
check:
shellcheck kpatch/kpatch kpatch-build/kpatch-build kpatch-build/kpatch-gcc