43 lines
1001 B
Makefile
43 lines
1001 B
Makefile
VERSION := $(shell git tag --points-at HEAD)
|
|
GIT_REF := $(shell git log -1 --format=%H)
|
|
GIT_AUTHOR := $(shell git log -1 --format=%an)
|
|
GIT_KEY := $(shell git log -1 --format=%GP)
|
|
GIT_TIMESTAMP := $(shell git log -1 --format=%cd --date=iso)
|
|
|
|
.DEFAULT_GOAL :=
|
|
.PHONY: default
|
|
default: \
|
|
out/airgap.iso
|
|
|
|
.PHONY: vm
|
|
vm: vm-bios
|
|
|
|
.PHONY: vm-bios
|
|
vm-bios: out/airgap.iso
|
|
qemu-system-x86_64 \
|
|
-m 4G \
|
|
-machine pc \
|
|
-serial stdio \
|
|
-cdrom "out/airgap.iso"
|
|
|
|
.PHONY: vm-efi
|
|
vm-efi: out/airgap.iso
|
|
qemu-system-x86_64 \
|
|
-m 4G \
|
|
-machine pc \
|
|
-serial stdio \
|
|
-bios /usr/share/ovmf/OVMF.fd \
|
|
-cdrom "out/airgap.iso"
|
|
|
|
out/airgap.iso: Containerfile $(shell git ls-files rootfs)
|
|
docker build \
|
|
--progress=plain \
|
|
--output type=local,dest=out \
|
|
--build-arg VERSION="$(or $(VERSION),"development")" \
|
|
--build-arg GIT_REF="$(GIT_REF)" \
|
|
--build-arg GIT_AUTHOR="$(GIT_AUTHOR)" \
|
|
--build-arg GIT_KEY="$(GIT_KEY)" \
|
|
--build-arg GIT_TIMESTAMP="$(GIT_TIMESTAMP)" \
|
|
-f Containerfile \
|
|
.
|