summaryrefslogtreecommitdiff
path: root/server/test/Makefile
blob: 12b18ec041e6f365f98d6da60350f94c34f6580d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# +-----------------------------------------------------------+
# * Docker tests for the autobuild script
# +-----------------------------------------------------------+

# List of available OS.
DOCKER_OS = $(patsubst %.Dockerfile.in, %, \
		$(notdir $(wildcard docker/templates/*.Dockerfile.in)))

# Arguments to pass to docker build .
DOCKER_BUILD_ARGS = -q -t

# Advice make not to delete these "intermediate" files.
.PRECIOUS: docker/%.Dockerfile docker/.%.build docker/.%.container

# Avoid conflicts with real files
SUBDIRS = docker
.PHONY: subdirs $(SUBDIRS)

all: docker/test
test: docker/test
check: docker/test

# Create the Dockerfile
docker/%.Dockerfile: docker/templates/%.Dockerfile.in \
	docker/templates/Dockerfile.common.in
	@echo Creating Dockerfile for target $*
	cat $^ > $@

# Build the Docker Image
docker/.%.build: docker/%.Dockerfile ../autobuild docker/lib
	@echo Building target image $*
	podman image build $(DOCKER_BUILD_ARGS) epdfinfo/$* -f $< ../
	touch $@

# Build the Docker Container
docker/.%.container: docker/.%.build
	@echo Building target container $*
	podman container create $(DOCKER_BUILD_ARGS) --name epdfinfo-$* epdfinfo/$*
	touch $@

# Run the Containers generated by the dockerfile
docker/%: docker/.%.container
	@echo Running tests on target $*
	podman container start -a epdfinfo-$*

# Run all Dockerfiles
docker/test: docker/build $(patsubst %, docker/%, $(DOCKER_OS))

# Build all Dockerfiles
docker/build: $(patsubst %, docker/.%.build, $(DOCKER_OS))

docker/.%.clean:
	@echo Cleaning target $*
	podman container rm epdfinfo-$* || exit 0

docker/clean: $(patsubst %, docker/.%.clean, $(DOCKER_OS))

clean: docker/clean
	rm -f -- docker/.[^.]*.build
	rm -f -- docker/.[^.]*.container
	rm -f -- docker/*.Dockerfile

print:
	@echo List of Operating systems where server compilation is tested [via Docker]:
	@for os in $(DOCKER_OS); do echo - $$os; done | sort

print-failing: FAILING_OS := $(patsubst %.Dockerfile.in.FAILING, %, \
	$(notdir $(wildcard docker/templates/*.Dockerfile.in.FAILING)))

print-failing:
	@echo List of Operating systems where server compilation is not tested:
	@for os in $(FAILING_OS); do echo - $$os; done | sort
	@echo PLEASE help support your favorite OS! More details at: https://pdftools.wiki/A401543C