From ec9e3027ed5f3505f2bc92452e79ed6a4909cb74 Mon Sep 17 00:00:00 2001 From: Manuel Messner Date: Mon, 12 Feb 2018 16:11:55 +0100 Subject: Makefile: add spacing --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2146693..da435c4 100644 --- a/Makefile +++ b/Makefile @@ -5,20 +5,25 @@ PACKER = packer ANSIBLE_DIR = ansible-roles + # check which hypervisors are available 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 + ## # Templates and flavors detection ## @@ -32,6 +37,7 @@ PROVTARGETS := $(foreach template, $(TEMPLATES), $(foreach flavor, $(FLAVORS), $ BOOTTARGETS := $(foreach template, $(TEMPLATES), $(template)/base/boot) BOOTTARGETS += $(foreach prov, $(PROVTARGETS), $(prov)/boot) + PACKER_OPTS := -var-file=base.json ifdef DEBUG VERBOSE := 1 @@ -39,6 +45,7 @@ ifdef DEBUG PACKER_OPTS += -var='headless=false' endif + TIMESTAMP := $(shell date "+%Y-%m-%d_%H-%M-%S") @@ -80,6 +87,7 @@ $(BASETARGETS): -var='output_directory=$(@D)/base' \ $(@D).json + ## # Provisioning images ## @@ -99,6 +107,7 @@ $(foreach flav, $(FLAVORS), %/$(flav)): %/base -var='playbook=setup-$(@F).yml' \ $(BUILD_DIR)/$(ANSIBLE_DIR)/run-playbook-only.json + ## # Generating boot files ## @@ -117,10 +126,12 @@ $(BOOTTARGETS): $(BUILD_DIR)/$(ANSIBLE_DIR)/run-playbook-only.json @mv $(BUILD_DIR)/$(ANSIBLE_DIR)/boot_files $(BUILD_DIR)/build/boot + # The builds are directories named after the template name clean: -$(foreach build_dir,$(TEMPLATES),test -d $(build_dir) && rm -rf $(build_dir);) + help: @printf "Usage:\n\tmake