diff options
author | Jonathan Bauer | 2018-02-07 18:13:02 +0100 |
---|---|---|
committer | Jonathan Bauer | 2018-02-07 18:13:02 +0100 |
commit | e2ab3d744a59d0a9296c68fd119d687c27940070 (patch) | |
tree | 0968b6e74361895a7ce27fadb89fe63db90e7887 /Makefile | |
parent | Makefile: small formatting changes (diff) | |
download | packer-templates-e2ab3d744a59d0a9296c68fd119d687c27940070.tar.gz packer-templates-e2ab3d744a59d0a9296c68fd119d687c27940070.tar.xz packer-templates-e2ab3d744a59d0a9296c68fd119d687c27940070.zip |
Makefile: reworked builder detection a bit
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 27 |
1 files changed, 11 insertions, 16 deletions
@@ -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 ## |