Blame Makefile

Packit Service ac8aad
include Makefile.inc
Packit Service ac8aad
Packit Service ac8aad
SUBDIRS     = kpatch-build kpatch kmod man contrib
Packit Service ac8aad
BUILD_DIRS   = $(SUBDIRS:%=build-%)
Packit Service ac8aad
INSTALL_DIRS = $(SUBDIRS:%=install-%)
Packit Service ac8aad
UNINSTALL_DIRS = $(SUBDIRS:%=uninstall-%)
Packit Service ac8aad
CLEAN_DIRS   = $(SUBDIRS:%=clean-%)
Packit Service ac8aad
Packit Service ac8aad
UNITTEST_DIR = test/unit
Packit Service da4517
INTEGRATION_DIR = test/integration
Packit Service ac8aad
CLEAN_DIRS  += clean-$(UNITTEST_DIR)
Packit Service ac8aad
Packit Service ac8aad
.PHONY: all install uninstall clean check unit
Packit Service ac8aad
.PHONY: $(SUBDIRS) $(BUILD_DIRS) $(INSTALL_DIRS) $(CLEAN_DIRS)
Packit Service da4517
.PHONY: integration integration-slow integration-quick
Packit Service da4517
.PHONY: vagrant-integration-slow vagrant-integration-quick vagrant-integration
Packit Service da4517
.PHONY: vagrant-install
Packit Service ac8aad
Packit Service ac8aad
Packit Service ac8aad
all: $(BUILD_DIRS)
Packit Service ac8aad
$(BUILD_DIRS):
Packit Service ac8aad
	$(MAKE) -C $(@:build-%=%)
Packit Service ac8aad
Packit Service ac8aad
install: $(INSTALL_DIRS)
Packit Service ac8aad
$(INSTALL_DIRS):
Packit Service ac8aad
	$(MAKE) -C $(@:install-%=%) install
Packit Service ac8aad
Packit Service ac8aad
uninstall: $(UNINSTALL_DIRS)
Packit Service ac8aad
$(UNINSTALL_DIRS):
Packit Service ac8aad
	$(MAKE) -C $(@:uninstall-%=%) uninstall
Packit Service ac8aad
Packit Service ac8aad
clean: $(CLEAN_DIRS)
Packit Service ac8aad
$(CLEAN_DIRS):
Packit Service ac8aad
	$(MAKE) -C $(@:clean-%=%) clean
Packit Service ac8aad
Packit Service ac8aad
unit: $(UNITTEST_DIR)/Makefile build-kpatch-build
Packit Service ac8aad
	$(MAKE) -C $(UNITTEST_DIR)
Packit Service ac8aad
Packit Service da4517
integration: integration-quick
Packit Service da4517
Packit Service da4517
integration-slow: $(INTEGRATION_DIR)/Makefile build-kpatch-build build-kpatch build-kmod
Packit Service da4517
	$(MAKE) -C $(INTEGRATION_DIR) slow
Packit Service da4517
Packit Service da4517
integration-quick: $(INTEGRATION_DIR)/Makefile build-kpatch-build build-kpatch build-kmod
Packit Service da4517
	$(MAKE) -C $(INTEGRATION_DIR) quick
Packit Service da4517
Packit Service da4517
vagrant-install: $(INTEGRATION_DIR)/lib.sh
Packit Service da4517
ifneq ($(shell id -u), 0)
Packit Service da4517
	@echo "WARNING: This target is intended for use on freshly-installed machines/vms only." && \
Packit Service da4517
	echo "Do not proceed unless you read $(INTEGRATION_DIR)/lib.sh and realise what this target does." && \
Packit Service da4517
	echo "Press ctrl-c to abort, return to proceed." && \
Packit Service da4517
	read
Packit Service da4517
endif
Packit Service da4517
	source $(INTEGRATION_DIR)/lib.sh && kpatch_check_install_vagrant
Packit Service da4517
Packit Service da4517
vagrant-integration: vagrant-integration-quick
Packit Service da4517
Packit Service da4517
vagrant-integration-slow:
Packit Service da4517
	$(MAKE) -C $(INTEGRATION_DIR) vagrant-slow
Packit Service da4517
Packit Service da4517
vagrant-integration-quick:
Packit Service da4517
	$(MAKE) -C $(INTEGRATION_DIR) vagrant-quick
Packit Service da4517
Packit Service ac8aad
check:
Packit Service ac8aad
	shellcheck kpatch/kpatch kpatch-build/kpatch-build kpatch-build/kpatch-gcc
Packit Service da4517
	shellcheck test/difftree.sh test/integration/kpatch-test		\
Packit Service da4517
		   test/integration/lib.sh test/integration/rebase-patches	\
Packit Service da4517
		   test/integration/test-vagrant				\
Packit Service da4517
		   test/integration/vm-integration-run