Removed version file

This commit is contained in:
Héctor Molinero Fernández 2022-02-08 23:23:15 +01:00
parent d1e8f99a06
commit 900242aa90
2 changed files with 9 additions and 19 deletions

View File

@ -1,37 +1,29 @@
#!/usr/bin/make -f

SHELL := /bin/sh
.SHELLFLAGS := -eu -c
.SHELLFLAGS := -euc

DOCKER := $(shell command -v docker 2>/dev/null)
GIT := $(shell command -v git 2>/dev/null)
M4 := $(shell command -v m4 2>/dev/null)

DISTDIR := ./dist
VERSION_FILE = ./VERSION
DOCKERFILE_TEMPLATE := ./Dockerfile.m4

IMAGE_REGISTRY := docker.io
IMAGE_NAMESPACE := hectormolinero
IMAGE_PROJECT := qemu-reactos
IMAGE_NAME := $(IMAGE_REGISTRY)/$(IMAGE_NAMESPACE)/$(IMAGE_PROJECT)

IMAGE_VERSION := v0
ifneq ($(wildcard $(VERSION_FILE)),)
IMAGE_VERSION := $(shell cat '$(VERSION_FILE)')
endif
IMAGE_VERSION := $(shell '$(GIT)' describe --abbrev=0 2>/dev/null || printf 'v0')

IMAGE_BUILD_OPTS :=

IMAGE_NATIVE_DOCKERFILE := $(DISTDIR)/Dockerfile
IMAGE_NATIVE_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).tzst

IMAGE_AMD64_DOCKERFILE := $(DISTDIR)/Dockerfile.amd64
IMAGE_AMD64_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).amd64.tzst

IMAGE_ARM64V8_DOCKERFILE := $(DISTDIR)/Dockerfile.arm64v8
IMAGE_ARM64V8_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).arm64v8.tzst

IMAGE_ARM32V7_DOCKERFILE := $(DISTDIR)/Dockerfile.arm32v7
IMAGE_ARM32V7_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).arm32v7.tzst

@ -72,8 +64,8 @@ $(IMAGE_AMD64_DOCKERFILE): $(DOCKERFILE_TEMPLATE)
mkdir -p '$(DISTDIR)'
'$(M4)' \
--prefix-builtins \
-D CROSS_ARCH=amd64 \
-D CROSS_QEMU=/usr/bin/qemu-x86_64-static \
--define=CROSS_ARCH=amd64 \
--define=CROSS_QEMU=/usr/bin/qemu-x86_64-static \
'$(DOCKERFILE_TEMPLATE)' | cat --squeeze-blank > '$@'
'$(DOCKER)' build $(IMAGE_BUILD_OPTS) \
--tag '$(IMAGE_NAME):$(IMAGE_VERSION)-amd64' \
@ -87,8 +79,8 @@ $(IMAGE_ARM64V8_DOCKERFILE): $(DOCKERFILE_TEMPLATE)
mkdir -p '$(DISTDIR)'
'$(M4)' \
--prefix-builtins \
-D CROSS_ARCH=arm64v8 \
-D CROSS_QEMU=/usr/bin/qemu-aarch64-static \
--define=CROSS_ARCH=arm64v8 \
--define=CROSS_QEMU=/usr/bin/qemu-aarch64-static \
'$(DOCKERFILE_TEMPLATE)' | cat --squeeze-blank > '$@'
'$(DOCKER)' build $(IMAGE_BUILD_OPTS) \
--tag '$(IMAGE_NAME):$(IMAGE_VERSION)-arm64v8' \
@ -102,8 +94,8 @@ $(IMAGE_ARM32V7_DOCKERFILE): $(DOCKERFILE_TEMPLATE)
mkdir -p '$(DISTDIR)'
'$(M4)' \
--prefix-builtins \
-D CROSS_ARCH=arm32v7 \
-D CROSS_QEMU=/usr/bin/qemu-arm-static \
--define=CROSS_ARCH=arm32v7 \
--define=CROSS_QEMU=/usr/bin/qemu-arm-static \
'$(DOCKERFILE_TEMPLATE)' | cat --squeeze-blank > '$@'
'$(DOCKER)' build $(IMAGE_BUILD_OPTS) \
--tag '$(IMAGE_NAME):$(IMAGE_VERSION)-arm32v7' \
@ -238,8 +230,7 @@ binfmt-register:
version:
@if printf '%s' '$(IMAGE_VERSION)' | grep -q '^v[0-9]\{1,\}$$'; then \
NEW_IMAGE_VERSION=$$(awk -v 'v=$(IMAGE_VERSION)' 'BEGIN {printf "v%.0f", substr(v,2)+1}'); \
printf '%s\n' "$${NEW_IMAGE_VERSION:?}" > '$(VERSION_FILE)'; \
'$(GIT)' add '$(VERSION_FILE)'; '$(GIT)' commit -m "$${NEW_IMAGE_VERSION:?}"; \
'$(GIT)' commit --allow-empty -m "$${NEW_IMAGE_VERSION:?}"; \
'$(GIT)' tag -a "$${NEW_IMAGE_VERSION:?}" -m "$${NEW_IMAGE_VERSION:?}"; \
else \
>&2 printf 'Malformed version string: %s\n' '$(IMAGE_VERSION)'; \

View File

@ -1 +0,0 @@
v39