2014-02-13 16:04:35 +00:00
|
|
|
include Makefile.inc
|
|
|
|
|
2014-04-01 20:14:40 +00:00
|
|
|
SUBDIRS = kpatch-build kpatch kmod man contrib
|
2014-02-13 16:04:35 +00:00
|
|
|
BUILD_DIRS = $(SUBDIRS:%=build-%)
|
|
|
|
INSTALL_DIRS = $(SUBDIRS:%=install-%)
|
2014-03-20 14:29:06 +00:00
|
|
|
UNINSTALL_DIRS = $(SUBDIRS:%=uninstall-%)
|
2014-02-13 16:04:35 +00:00
|
|
|
CLEAN_DIRS = $(SUBDIRS:%=clean-%)
|
|
|
|
|
2018-04-13 09:10:42 +00:00
|
|
|
UNITTEST_DIR = test/unit
|
2018-10-18 11:06:24 +00:00
|
|
|
INTEGRATION_DIR = test/integration
|
2018-04-13 09:10:42 +00:00
|
|
|
CLEAN_DIRS += clean-$(UNITTEST_DIR)
|
|
|
|
|
2022-05-23 12:47:18 +00:00
|
|
|
.PHONY: all dependencies install uninstall clean check unit
|
2014-02-13 16:04:35 +00:00
|
|
|
.PHONY: $(SUBDIRS) $(BUILD_DIRS) $(INSTALL_DIRS) $(CLEAN_DIRS)
|
2018-10-18 11:06:24 +00:00
|
|
|
.PHONY: integration integration-slow integration-quick
|
2018-10-30 09:49:59 +00:00
|
|
|
.PHONY: vagrant-integration-slow vagrant-integration-quick vagrant-integration
|
2018-10-30 12:26:57 +00:00
|
|
|
.PHONY: vagrant-install
|
2022-05-23 12:47:18 +00:00
|
|
|
.PHONY: help
|
2014-02-13 16:04:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
all: $(BUILD_DIRS)
|
|
|
|
$(BUILD_DIRS):
|
|
|
|
$(MAKE) -C $(@:build-%=%)
|
|
|
|
|
2022-05-23 12:47:18 +00:00
|
|
|
dependencies: SHELL:=/bin/bash
|
|
|
|
dependencies:
|
|
|
|
source test/integration/lib.sh && kpatch_dependencies
|
|
|
|
|
2014-02-13 16:04:35 +00:00
|
|
|
install: $(INSTALL_DIRS)
|
|
|
|
$(INSTALL_DIRS):
|
|
|
|
$(MAKE) -C $(@:install-%=%) install
|
|
|
|
|
2014-03-20 14:29:06 +00:00
|
|
|
uninstall: $(UNINSTALL_DIRS)
|
|
|
|
$(UNINSTALL_DIRS):
|
|
|
|
$(MAKE) -C $(@:uninstall-%=%) uninstall
|
|
|
|
|
2014-02-13 16:04:35 +00:00
|
|
|
clean: $(CLEAN_DIRS)
|
|
|
|
$(CLEAN_DIRS):
|
|
|
|
$(MAKE) -C $(@:clean-%=%) clean
|
2017-10-13 06:52:16 +00:00
|
|
|
|
2018-04-13 09:10:42 +00:00
|
|
|
unit: $(UNITTEST_DIR)/Makefile build-kpatch-build
|
|
|
|
$(MAKE) -C $(UNITTEST_DIR)
|
|
|
|
|
2018-10-18 11:06:24 +00:00
|
|
|
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
|
|
|
|
|
2018-10-30 12:26:57 +00:00
|
|
|
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
|
|
|
|
|
2018-10-30 09:49:59 +00:00
|
|
|
vagrant-integration: vagrant-integration-quick
|
|
|
|
|
|
|
|
vagrant-integration-slow:
|
|
|
|
$(MAKE) -C $(INTEGRATION_DIR) vagrant-slow
|
|
|
|
|
|
|
|
vagrant-integration-quick:
|
|
|
|
$(MAKE) -C $(INTEGRATION_DIR) vagrant-quick
|
|
|
|
|
2017-10-13 06:52:16 +00:00
|
|
|
check:
|
2021-01-27 10:41:49 +00:00
|
|
|
shellcheck kpatch/kpatch kpatch-build/kpatch-build kpatch-build/kpatch-cc
|
2020-06-03 09:16:15 +00:00
|
|
|
shellcheck test/difftree.sh test/integration/kpatch-test \
|
|
|
|
test/integration/lib.sh test/integration/rebase-patches \
|
|
|
|
test/integration/test-vagrant \
|
|
|
|
test/integration/vm-integration-run
|
2022-05-23 12:47:18 +00:00
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "kpatch Makefile"
|
|
|
|
@echo
|
|
|
|
@echo "Targets:"
|
|
|
|
@echo " make dependencies install build dependencies [1]"
|
|
|
|
@echo " make all build entire project"
|
|
|
|
@echo " make install install programs to system [1]"
|
|
|
|
@echo " make uninstall remove programs from system [1]"
|
|
|
|
@echo " make clean clean build files"
|
|
|
|
@echo
|
|
|
|
@echo "Test targets:"
|
|
|
|
@echo " make check run static code analyzers"
|
|
|
|
@echo " make integration build and run integration tests [2]"
|
|
|
|
@echo " make integration-slow build and run integration tests [2]"
|
|
|
|
@echo " make integration-quick build and run integration tests [2]"
|
|
|
|
@echo " make unit run unit tests"
|
|
|
|
@echo
|
|
|
|
@echo "[1] requires admin privileges"
|
|
|
|
@echo "[2] installs test kpatch kernel modules, run at your own risk"
|
|
|
|
@echo
|