Browse Source

Create a Makefile to automatically make the container

latest
Alexander Jung 2 years ago
parent
commit
18470ff9bc
1 changed files with 35 additions and 0 deletions
  1. +35
    -0
      Makefile

+ 35
- 0
Makefile View File

@@ -0,0 +1,35 @@
#
# Dockerized QEMU
#

# Program arguments
APP_NAME ?= qemu
DOCKER_REGISTRY ?= nderjung.net
DOCKER_NAMESPACE ?= qemu
DOCKER_CONTAINER ?= $(subst //,/,$(DOCKER_REGISTRY)/$(DOCKER_NAMESPACE):$(TAG))
TAG := $(shell git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3)

ifdef QEMU_VER
TAG := $(QEMU_VER)
else
QEMU_VER ?= 3.0.0
endif

# Directories
SRC_DIR ?= $(CURDIR)

# Tools
DOCKER ?= docker

# Build targets
.PHONY: container
container: ## Build the container
$(DOCKER) build \
--build-arg QEMU_VER=$(QEMU_VER) \
-f $(SRC_DIR)/Dockerfile \
-t $(DOCKER_CONTAINER) \
$(SRC_DIR)

.PHONY: help
help: ## Show this help menu
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}'

Loading…
Cancel
Save