File: Makefile

package info (click to toggle)
emacs-pdf-tools 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,864 kB
  • sloc: lisp: 11,541; ansic: 11,386; sh: 596; makefile: 182
file content (88 lines) | stat: -rw-r--r-- 2,653 bytes parent folder | download | duplicates (3)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# +-----------------------------------------------------------+
# * 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 Podman VM, if it hasn't already been created
create-vm:
	podman machine init --cpus 8 --memory 8192 --disk-size 50 || exit 0

# Start Podman, if it isn't running
start-vm: create-vm
	podman machine start || exit 0
	touch .$@

# Stop Podman
stop-vm:
	podman machine stop

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

# Build the Docker Image. Since we are building a new image, remove the existing container.
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))

test: docker/test

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