summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorManuel Messner2018-02-08 16:43:32 +0100
committerManuel Messner2018-02-08 16:52:00 +0100
commitca95e7f621b84eb68912183aa1bc736c98cd7b7a (patch)
treef7e53dccb0be2087cf86e4c4662b72264d65cf25 /Makefile
parentMakefile: simplify ifndef+def -> ?= (diff)
downloadpacker-templates-ca95e7f621b84eb68912183aa1bc736c98cd7b7a.tar.gz
packer-templates-ca95e7f621b84eb68912183aa1bc736c98cd7b7a.tar.xz
packer-templates-ca95e7f621b84eb68912183aa1bc736c98cd7b7a.zip
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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 1 insertions, 4 deletions
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
##