From ca95e7f621b84eb68912183aa1bc736c98cd7b7a Mon Sep 17 00:00:00 2001 From: Manuel Messner Date: Thu, 8 Feb 2018 16:43:32 +0100 Subject: Makefile: simplify BUILDER selection Instead of checking and/or defining the DEFAULT_BUILDER in every single step, we can safely skip that and use the first entry of AVAILABLE_BUILDERS instead. This should have the same result. --- Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e278c52..6e8bc6d 100644 --- a/Makefile +++ b/Makefile @@ -8,21 +8,18 @@ SUPPORTED_BUILDERS = qemu virtualbox-iso vmware-iso # check which hypervisors are available ifeq ($(shell which qemu-system-$(shell uname -m | sed 's/i686/i386/') 2>&1 > /dev/null && echo $$?), 0) AVAILABLE_BUILDERS += qemu - DEFAULT_BUILDER := qemu endif ifeq ($(shell which virtualbox 2>&1 > /dev/null && echo $$?), 0) AVAILABLE_BUILDERS += virtualbox-iso - DEFAULT_BUILDER ?= virtualbox-iso endif ifeq ($(shell which vmplayer 2>&1 > /dev/null && echo $$?), 0) AVAILABLE_BUILDERS += vmware-iso - DEFAULT_BUILDER ?= vmware-iso endif ifndef BUILDER $(info # BUILDER not set, using default builder: $(DEFAULT_BUILDER)) $(info # Detected builders: $(AVAILABLE_BUILDERS)) $(info ) - BUILDER := $(DEFAULT_BUILDER) + BUILDER := $(firstword $(AVAILABLE_BUILDERS)) endif ## -- cgit v1.2.3-55-g7522