From d4be097b71e419cf528717b37593af6e3b69e53a Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Fri, 29 Nov 2019 13:33:28 +0000 Subject: [PATCH 1/3] Makefile: fix suspicious line Emacs (the good and infalible text editor) detects a suspicious line in Makefile, this line contains both space and tab (something that could be introduced by a less sophisticated text editor) that is not correct for a Makefile. fixes #2286 Signed-off-by: Julio Montes --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d48e7ab568..9f7dc328df 100644 --- a/Makefile +++ b/Makefile @@ -243,7 +243,7 @@ endif ifneq (,$(QEMUVIRTIOFSCMD)) KNOWN_HYPERVISORS += $(HYPERVISOR_QEMU_VIRTIOFS) - CONFIG_FILE_QEMU_VIRTIOFS = configuration-qemu-virtiofs.toml + CONFIG_FILE_QEMU_VIRTIOFS = configuration-qemu-virtiofs.toml CONFIG_QEMU_VIRTIOFS = $(CLI_DIR)/config/$(CONFIG_FILE_QEMU_VIRTIOFS) CONFIG_QEMU_VIRTIOFS_IN = $(CONFIG_QEMU_VIRTIOFS).in From 7bcce3da63015ce7aab7bbfa3ae5f76ee6f94022 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Fri, 29 Nov 2019 15:38:53 +0000 Subject: [PATCH 2/3] Makefile: do not use tabs in if/else blocks tabs should only appear in rules, not in ifeq/ifneq blocks (since otherwise make can get very confused on error). Signed-off-by: Julio Montes --- Makefile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 9f7dc328df..5562469811 100644 --- a/Makefile +++ b/Makefile @@ -241,25 +241,25 @@ ifneq (,$(QEMUCMD)) endif ifneq (,$(QEMUVIRTIOFSCMD)) - KNOWN_HYPERVISORS += $(HYPERVISOR_QEMU_VIRTIOFS) + KNOWN_HYPERVISORS += $(HYPERVISOR_QEMU_VIRTIOFS) - CONFIG_FILE_QEMU_VIRTIOFS = configuration-qemu-virtiofs.toml - CONFIG_QEMU_VIRTIOFS = $(CLI_DIR)/config/$(CONFIG_FILE_QEMU_VIRTIOFS) - CONFIG_QEMU_VIRTIOFS_IN = $(CONFIG_QEMU_VIRTIOFS).in + CONFIG_FILE_QEMU_VIRTIOFS = configuration-qemu-virtiofs.toml + CONFIG_QEMU_VIRTIOFS = $(CLI_DIR)/config/$(CONFIG_FILE_QEMU_VIRTIOFS) + CONFIG_QEMU_VIRTIOFS_IN = $(CONFIG_QEMU_VIRTIOFS).in - CONFIG_PATH_QEMU_VIRTIOFS = $(abspath $(CONFDIR)/$(CONFIG_FILE_QEMU_VIRTIOFS)) - CONFIG_PATHS += $(CONFIG_PATH_QEMU_VIRTIOFS) + CONFIG_PATH_QEMU_VIRTIOFS = $(abspath $(CONFDIR)/$(CONFIG_FILE_QEMU_VIRTIOFS)) + CONFIG_PATHS += $(CONFIG_PATH_QEMU_VIRTIOFS) - SYSCONFIG_QEMU_VIRTIOFS = $(abspath $(SYSCONFDIR)/$(CONFIG_FILE_QEMU_VIRTIOFS)) - SYSCONFIG_PATHS += $(SYSCONFIG_QEMU_VIRTIOFS) + SYSCONFIG_QEMU_VIRTIOFS = $(abspath $(SYSCONFDIR)/$(CONFIG_FILE_QEMU_VIRTIOFS)) + SYSCONFIG_PATHS += $(SYSCONFIG_QEMU_VIRTIOFS) - CONFIGS += $(CONFIG_QEMU_VIRTIOFS) + CONFIGS += $(CONFIG_QEMU_VIRTIOFS) - # qemu-specific options (all should be suffixed by "_QEMU") - DEFBLOCKSTORAGEDRIVER_QEMU_VIRTIOFS := virtio-fs - DEFNETWORKMODEL_QEMU := tcfilter - KERNELNAMEVIRTIOFS = $(call MAKE_KERNEL_VIRTIOFS_NAME,$(KERNELTYPE)) - KERNELVIRTIOFSPATH = $(KERNELDIR)/$(KERNELNAMEVIRTIOFS) + # qemu-specific options (all should be suffixed by "_QEMU") + DEFBLOCKSTORAGEDRIVER_QEMU_VIRTIOFS := virtio-fs + DEFNETWORKMODEL_QEMU := tcfilter + KERNELNAMEVIRTIOFS = $(call MAKE_KERNEL_VIRTIOFS_NAME,$(KERNELTYPE)) + KERNELVIRTIOFSPATH = $(KERNELDIR)/$(KERNELNAMEVIRTIOFS) endif ifneq (,$(CLHCMD)) From 9dd3f13a92313f5bdb10f7c0a1e2372c0f158ea3 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Fri, 29 Nov 2019 15:39:43 +0000 Subject: [PATCH 3/3] Makefile: Move the .git-commit: rule block to below the all: rule the first rule defined becomes the default and the default rule should be all. Signed-off-by: Julio Montes --- Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 5562469811..b1f13fdc9d 100644 --- a/Makefile +++ b/Makefile @@ -200,16 +200,6 @@ SHIMV2_DIR = $(CLI_DIR)/$(SHIMV2) SOURCES := $(shell find . 2>&1 | grep -E '.*\.(c|h|go)$$') VERSION := ${shell cat ./VERSION} -# Targets that depend on .git-commit can use $(shell cat .git-commit) to get a -# git revision string. They will only be rebuilt if the revision string -# actually changes. -.PHONY: .git-commit.tmp -.git-commit: .git-commit.tmp - @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -.git-commit.tmp: - @echo -n "$$(git rev-parse HEAD 2>/dev/null)" >$@ - @test -n "$$(git status --porcelain --untracked-files=no)" && echo -n "-dirty" >>$@ || true - # List of configuration files to build and install CONFIGS = CONFIG_PATHS = @@ -483,6 +473,16 @@ endef all: runtime containerd-shim-v2 netmon +# Targets that depend on .git-commit can use $(shell cat .git-commit) to get a +# git revision string. They will only be rebuilt if the revision string +# actually changes. +.PHONY: .git-commit.tmp +.git-commit: .git-commit.tmp + @cmp $< $@ >/dev/null 2>&1 || cp $< $@ +.git-commit.tmp: + @echo -n "$$(git rev-parse HEAD 2>/dev/null)" >$@ + @test -n "$$(git status --porcelain --untracked-files=no)" && echo -n "-dirty" >>$@ || true + containerd-shim-v2: $(SHIMV2_OUTPUT) netmon: $(NETMON_TARGET_OUTPUT)