From 206ffc66aa2b96bb624240574309ba6de36a5ee5 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Thu, 21 Mar 2019 11:24:09 +0000 Subject: [PATCH 1/3] build: Don't build the runtime when building shim binary The `containerd-shim-v2` binary does not need the `kata-runtime` binary to be built first, so remove the dependency. Signed-off-by: James O. D. Hunt --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7340add51f..fab2b976cd 100644 --- a/Makefile +++ b/Makefile @@ -447,7 +447,7 @@ $(GENERATED_CONFIG): Makefile VERSION $(TARGET_OUTPUT): $(EXTRA_DEPS) $(SOURCES) $(GENERATED_GO_FILES) $(GENERATED_FILES) Makefile | show-summary $(QUIET_BUILD)(cd $(CLI_DIR) && go build $(BUILDFLAGS) -o $@ .) -$(SHIMV2_OUTPUT): $(TARGET_OUTPUT) +$(SHIMV2_OUTPUT): $(QUIET_BUILD)(cd $(SHIMV2_DIR)/ && go build -i -o $@ .) .PHONY: \ From e6a7091981cc4e97a54baec10bb99bb6df2c5239 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Thu, 21 Mar 2019 11:27:03 +0000 Subject: [PATCH 2/3] build: Allow runtime to be built+installed without shim Add `install-runtime` and `install-netmon` targets. This allows the `install` target to be simplified and also allows the runtime to be built without having to build the `containerd-shim-v2` binary which is slow to build: ``` $ make runtime && sudo -E PATH=$PATH make install-runtime ``` Fixes #1402. Signed-off-by: James O. D. Hunt --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fab2b976cd..40138c0707 100644 --- a/Makefile +++ b/Makefile @@ -534,11 +534,15 @@ check-go-static: coverage: $(QUIET_TEST).ci/go-test.sh html-coverage -install: default runtime install-scripts install-completions install-configs install-bin install-containerd-shim-v2 install-bin-libexec +install: default install-runtime install-containerd-shim-v2 install-netmon install-bin: $(BINLIST) $(QUIET_INST)$(foreach f,$(BINLIST),$(call INSTALL_EXEC,$f,$(BINDIR))) +install-runtime: runtime install-scripts install-completions install-configs install-bin + +install-netmon: install-bin-libexec + install-containerd-shim-v2: $(SHIMV2) $(QUIET_INST)$(call INSTALL_EXEC,$<,$(BINDIR)) From ad228e3c3b6ac22a23998366f31e1842fab8a26c Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Thu, 21 Mar 2019 11:27:49 +0000 Subject: [PATCH 3/3] build: Add missing targets to show-usage Add a number of useful build and install targets to the `show-usage` target which are visible when the user runs `make help`. Signed-off-by: James O. D. Hunt --- Makefile | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 40138c0707..d690b5598c 100644 --- a/Makefile +++ b/Makefile @@ -571,15 +571,21 @@ show-usage: show-header @printf "\n" @printf "• Additional targets:\n" @printf "\n" - @printf "\tbuild : standard build.\n" - @printf "\tcheck : run tests.\n" - @printf "\tclean : remove built files.\n" - @printf "\tcoverage : run coverage tests.\n" - @printf "\tdefault : same as 'make build' (or just 'make').\n" - @printf "\tgenerate-config : create configuration file.\n" - @printf "\tinstall : install files.\n" - @printf "\tshow-arches : show supported architectures (ARCH variable values).\n" - @printf "\tshow-summary : show install locations.\n" + @printf "\tbuild : standard build (build everything).\n" + @printf "\tcheck : run tests.\n" + @printf "\tclean : remove built files.\n" + @printf "\tcontainerd-shim-v2 : only build containerd shim v2.\n" + @printf "\tcoverage : run coverage tests.\n" + @printf "\tdefault : same as 'make build' (or just 'make').\n" + @printf "\tgenerate-config : create configuration file.\n" + @printf "\tinstall : install everything.\n" + @printf "\tinstall-containerd-shim-v2 : only install containerd shim v2 files.\n" + @printf "\tinstall-netmon : only install netmon files.\n" + @printf "\tinstall-runtime : only install runtime files.\n" + @printf "\tnetmon : only build netmon.\n" + @printf "\truntime : only build runtime.\n" + @printf "\tshow-arches : show supported architectures (ARCH variable values).\n" + @printf "\tshow-summary : show install locations.\n" @printf "\n" handle_help: show-usage show-summary show-variables show-footer