From e2ab3d744a59d0a9296c68fd119d687c27940070 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 7 Feb 2018 18:13:02 +0100 Subject: Makefile: reworked builder detection a bit --- Makefile | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f4638dd..2e8c054 100644 --- a/Makefile +++ b/Makefile @@ -8,28 +8,23 @@ 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 - BUILDER := qemu + DEFAULT_BUILDER := qemu endif -ifndef BUILDER - ifeq ($(shell which virtualbox 2>&1 > /dev/null && echo $$?), 0) - AVAILABLE_BUILDERS += virtualbox-iso - BUILDER := virtualbox-iso +ifeq ($(shell which virtualbox 2>&1 > /dev/null && echo $$?), 0) + AVAILABLE_BUILDERS += virtualbox-iso + ifndef DEFAULT_BUILDER + DEFAULT_BUILDER := virtualbox-iso endif endif -ifndef BUILDER - ifeq ($(shell which vmplayer 2>&1 > /dev/null && echo $$?), 0) - AVAILABLE_BUILDERS += vmware-iso - BUILDER := vmware-iso +ifeq ($(shell which vmplayer 2>&1 > /dev/null && echo $$?), 0) + AVAILABLE_BUILDERS += vmware-iso + ifndef DEFAULT_BUILDER + DEFAULT_BUILDER := vmware-iso endif endif ifndef BUILDER - $(error No usable builder found! Please install a hypervisor...) -endif -MISSING_BUILDERS = $(filter-out $(AVAILABLE_BUILDERS),$(SUPPORTED_BUILDERS)) -ifneq ($(words $(MISSING_BUILDERS)), 0) - $(info Builders missing on this system: $(MISSING_BUILDERS)) - $(info If you wish to use these, install the corresponding hypervisor and retry.) - $(info ) + $(info # BUILDER not set, using default builder: $(DEFAULT_BUILDER)) + BUILDER := $(DEFAULT_BUILDER) endif ## -- cgit v1.2.3-55-g7522