summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorManuel Messner2018-02-12 14:46:37 +0100
committerManuel Messner2018-02-12 14:46:37 +0100
commit771ba9d4f9b78ef3cde51da540810988828b5cef (patch)
tree655ad81df98d98b3ac0362e754d13f10c679649f /Makefile
parentMakefile: remove unneeded branch (diff)
downloadpacker-templates-771ba9d4f9b78ef3cde51da540810988828b5cef.tar.gz
packer-templates-771ba9d4f9b78ef3cde51da540810988828b5cef.tar.xz
packer-templates-771ba9d4f9b78ef3cde51da540810988828b5cef.zip
Makefile: search builder only if not defined
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 11 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 6f626cc..a8adeae 100644
--- a/Makefile
+++ b/Makefile
@@ -6,16 +6,18 @@ PACKER = packer
ANSIBLE_DIR = ansible-roles
# 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
+ifndef BUILDER
+ ifeq ($(shell which qemu-system-$(shell uname -m | sed 's/i686/i386/') 2>&1 > /dev/null && echo $$?), 0)
+ AVAILABLE_BUILDERS += qemu
+ endif
+ ifeq ($(shell which virtualbox 2>&1 > /dev/null && echo $$?), 0)
+ AVAILABLE_BUILDERS += virtualbox-iso
+ endif
+ ifeq ($(shell which vmplayer 2>&1 > /dev/null && echo $$?), 0)
+ AVAILABLE_BUILDERS += vmware-iso
+ endif
+ BUILDER := $(firstword $(AVAILABLE_BUILDERS))
endif
-ifeq ($(shell which virtualbox 2>&1 > /dev/null && echo $$?), 0)
- AVAILABLE_BUILDERS += virtualbox-iso
-endif
-ifeq ($(shell which vmplayer 2>&1 > /dev/null && echo $$?), 0)
- AVAILABLE_BUILDERS += vmware-iso
-endif
-BUILDER ?= $(firstword $(AVAILABLE_BUILDERS))
##
# Templates and flavors detection