-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (70 loc) · 2.24 KB
/
Copy pathMakefile
File metadata and controls
96 lines (70 loc) · 2.24 KB
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
89
90
91
92
93
94
95
96
# Copyright (c) 2021 The PostgreSQL Global Development Group.
# Licensed under the PostgreSQL License.
TOP := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
PGCOPYDB ?= $(TOP)src/bin/pgcopydb/pgcopydb
PGVERSION ?= 16
all: bin ;
GIT-VERSION-FILE:
@$(SHELL_PATH) ./GIT-VERSION-GEN > /dev/null 2>&1
bin: GIT-VERSION-FILE
$(MAKE) -C src/bin/ all
sqlite3:
$(MAKE) -C src/bin/lib/sqlite $@
clean:
rm -f GIT-VERSION-FILE
$(MAKE) -C src/bin/ clean
maintainer-clean:
rm -f GIT-VERSION-FILE
$(MAKE) -C src/bin/ maintainer-clean
rm -f version
docs:
$(MAKE) -C docs clean man html
update-docs: bin
bash ./docs/update-help-messages.sh
check-docs:
cat Dockerfile ci/Dockerfile.docs.template > ci/Dockerfile.docs
docker build --file=ci/Dockerfile.docs --tag test-docs .
docker run test-docs
test: build
$(MAKE) -C tests all
tests: test ;
tests/ci:
sh ./ci/banned.h.sh
tests/*: build
$(MAKE) -C tests $(notdir $@)
install: bin
$(MAKE) -C src/bin/ install
indent:
citus_indent
build: version
@docker image inspect pgcopydb > /dev/null 2>&1 \
&& echo "pgcopydb image already present — skipping build (run 'make force-build' to rebuild)" \
|| docker build --build-arg PGVERSION=$(PGVERSION) -t pgcopydb .
# Force a full rebuild even when the pgcopydb image already exists locally
# (use after source-code changes or when switching PGVERSION)
force-build: version
docker build --build-arg PGVERSION=$(PGVERSION) -t pgcopydb .
# Remove cached Docker images so the next build/test starts from scratch
clean-images:
-docker rmi pgcopydb pagila 2>/dev/null; true
echo-version: GIT-VERSION-FILE
@awk '{print $$3}' $<
version: GIT-VERSION-FILE
@awk '{print $$3}' $< > $@
@cat $@
# debian packages built from the current sources
deb:
docker build -f Dockerfile.debian -t pgcopydb_debian .
debsh: deb
docker run --rm -it pgcopydb_debian bash
# debian packages built from latest tag, manually maintained in the Dockerfile
deb-qa:
docker build -f Dockerfile.debian-qa -t pgcopydb_debian_qa .
debsh-qa: deb-qa
docker run --rm -it pgcopydb_debian_qa bash
.PHONY: all
.PHONY: bin clean install docs maintainer-clean update-docs
.PHONY: test tests tests/ci tests/*
.PHONY: build force-build clean-images
.PHONY: deb debsh deb-qa debsh-qa
.PHONY: GIT-VERSION-FILE