criu/scripts/build/Makefile
Adrian Reber 0ca36c95ee ci: combine cross compile container definitions
The cross compile container definitions for each architecture were
almost the same files except for the architecture.

This moves the architecture to variables so that all cross compile
setups can use the same container definition.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-09-03 10:31:00 -07:00

33 lines
994 B
Makefile

ARCHES := x86_64 fedora-asan fedora-rawhide centos7 armv7hf centos8
NON_CLANG := armv7-cross aarch64-cross ppc64-cross mips64el-cross
CREATE_DOCKERFILES := $(ARCHES) $(NON_CLANG)
TARGETS := $(ARCHES) alpine
TARGETS_CLANG := $(addsuffix $(TARGETS),-clang)
CONTAINER_RUNTIME := docker
CONTAINER_TARGETS := $(TARGETS) $(NON_CLANG)
all: $(CONTAINER_TARGETS) $(TARGETS_CLANG)
.PHONY: all
# A build for each architecture requires appropriate Dockerfile
define FILE_DEP
$(1): Dockerfile.$(1)
endef
$(foreach file,$(CREATE_DOCKERFILES),$(eval $(call FILE_DEP,$(file))))
Dockerfile.%: Dockerfile.%.hdr Dockerfile.%.tmpl
cat $^ > $@
$(CONTAINER_TARGETS):
$(CONTAINER_RUNTIME) build -t criu-$@ -f Dockerfile.$@ $(DB_CC) ../..
.PHONY: $(CONTAINER_TARGETS)
# Clang builds add some Docker build env
define CLANG_DEP
$(1)-clang: $(1)
endef
$(foreach t,$(TARGETS),$(eval $(call CLANG_DEP,$(t))))
%-clang: DB_CC=--build-arg CC=clang
s390x-clang: DB_CC=--build-arg CC=clang-3.8
.PHONY: $(TARGETS_CLANG)