diff options
author | Manuel Messner | 2018-02-08 16:43:32 +0100 |
---|---|---|
committer | Manuel Messner | 2018-02-08 16:52:00 +0100 |
commit | ca95e7f621b84eb68912183aa1bc736c98cd7b7a (patch) | |
tree | f7e53dccb0be2087cf86e4c4662b72264d65cf25 /Makefile | |
parent | Makefile: simplify ifndef+def -> ?= (diff) | |
download | packer-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-- | Makefile | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -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 ## |