@@ -12,103 +12,11 @@ OBJS = pglogical_apply.o pglogical_conflict.o pglogical_manager.o \
12
12
pglogical_functions.o pglogical_queue.o pglogical_fe.o \
13
13
pglogical_worker.o pglogical_hooks.o pglogical_sync.o
14
14
15
- # 9.4 needs SCRIPTS set to do anything, even if SCRIPTS_built is set
16
- SCRIPTS =pglogical_create_subscriber
17
-
18
- SCRIPTS_built = pglogical_create_subscriber
19
-
20
-
21
15
PG_CPPFLAGS = -I$(libpq_srcdir )
22
16
SHLIB_LINK = $(libpq )
23
17
24
18
REGRESS = preseed infofuncs init_fail init preseed_check basic extended toasted replication_set add_table matview bidirectional primary_key foreign_key functions copy drop
25
19
26
- EXTRA_CLEAN += pglogical.control compat/pglogical_compat.o
27
-
28
- # The # in #define is taken as a comment, per https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=142043
29
- # so it must be escaped. The $ placeholders in awk must be doubled too.
30
- pglogical_version =$(shell awk '/\#define PGLOGICAL_VERSION[ \t]+\".* \"/ { print substr($$3,2,length($$3) -2) }' $(realpath $(srcdir ) /pglogical.h) )
31
-
32
- ifdef USE_PGXS
33
-
34
-
35
- # For regression checks
36
- # http://www.postgresql.org/message-id/CAB7nPqTsR5o3g-fBi6jbsVdhfPiLFWQ_0cGU5=94Rv_8W3qvFA@mail.gmail.com
37
- # this makes "make check" give a useful error
38
- abs_top_builddir = .
39
- NO_TEMP_INSTALL = yes
40
-
41
- PG_CONFIG = pg_config
42
-
43
- # PG_CPPFLAGS += -Ipglogical_output
44
-
45
- PGVER := $(shell $(PG_CONFIG ) --version | sed 's/[^0-9\.]//g' | awk -F . '{ print $$1$$2 }')
46
-
47
- ifeq ($(PGVER ) ,94)
48
- PG_CPPFLAGS += $(addprefix -I,$(realpath $(srcdir ) /compat) )
49
- OBJS += $(srcdir ) /compat/pglogical_compat.o
50
- DATA += compat/pglogical_origin.control compat/pglogical_origin--1.0.0.sql
51
- REGRESS = preseed infofuncs init_fail init preseed_check basic extended toasted replication_set add_table matview primary_key foreign_key functions copy drop
52
- REGRESS += --dbname=regression
53
- SCRIPTS_built += pglogical_dump/pglogical_dump
54
- SCRIPTS += pglogical_dump/pglogical_dump
55
- endif
56
-
57
- PGXS := $(shell $(PG_CONFIG ) --pgxs)
58
- include $(PGXS )
59
-
60
- pglogical_create_subscriber : pglogical_create_subscriber.o pglogical_fe.o
61
- $(CC ) $(CFLAGS ) $^ $(LDFLAGS ) $(LDFLAGS_EX ) $(libpq_pgport ) $(LIBS ) -o $@ $(X )
62
-
63
- ifeq ($(PGVER ) ,94)
64
- regresscheck : ;
65
-
66
- $(srcdir ) /pglogical_dump/pg_dump.c :
67
- $(warning pglogical_dump empty, trying to fetch as submodule)
68
- git submodule init
69
- git submodule update
70
-
71
- pglogical_dump/pglogical_dump : pglogical_dump/pg_dump.c
72
- mkdir -p pglogical_dump
73
- $(MAKE ) -C pglogical_dump -f $(abspath $(srcdir ) ) /pglogical_dump/Makefile VPATH=$(abspath $(srcdir ) ) /pglogical_dump all
74
-
75
- else
76
- # We can't do a normal 'make check' because PGXS doesn't support
77
- # creating a temp install. We don't want to use a normal PGXS
78
- # 'installcheck' though, because it's a pain to set up a temp install
79
- # manually, with the config overrides needed.
80
- #
81
- # We compromise by using the install we're building against, installing
82
- # pglogical_output (from a submodule) and pglogical into it, then making
83
- # a temp instance. This means that 'check' affects the target DB
84
- # install. Nobody with any sense runs 'make check' under a user with
85
- # write permissions to their production PostgreSQL install (right?)
86
- # but this is still not ideal.
87
- regresscheck :
88
- $(MKDIR_P ) regression_output
89
- $(pg_regress_check ) \
90
- --temp-config ./regress-postgresql.conf \
91
- --temp-instance=./tmp_check \
92
- --outputdir=./regression_output \
93
- --create-role=logical \
94
- $(REGRESS )
95
-
96
- check : install regresscheck ;
97
-
98
- endif
99
-
100
-
101
- # Even if we don't build pglogical_dump we should still clean it
102
- # if the submodule exists
103
- pglogical-dump-clean :
104
- if [ -e pglogical_dump/Makefile ]; then $( MAKE) -C pglogical_dump -f $( abspath $( srcdir) ) /pglogical_dump/Makefile VPATH=$( abspath $( srcdir) ) /pglogical_dump clean; fi
105
-
106
- clean : pglogical-dump-clean
107
-
108
- .PHONY : pglogical-dump-clean
109
-
110
- else
111
-
112
20
# In-tree builds only
113
21
subdir = contrib/pglogical
114
22
top_builddir = ../..
@@ -120,42 +28,8 @@ include $(top_srcdir)/contrib/contrib-global.mk
120
28
@installcheck : ;
121
29
122
30
EXTRA_INSTALL += $(top_srcdir ) /contrib/pglogical_output
123
- EXTRA_REGRESS_OPTS += $(top_srcdir ) /contrib/regress-postgresql.conf
124
-
125
- endif
126
-
127
- pglogical.control : pglogical.control.in pglogical.h
128
- sed ' s/__PGLOGICAL_VERSION__/$(pglogical_version)/' $(realpath $(srcdir ) /pglogical.control.in) > pglogical.control
129
-
130
- all : pglogical.control
131
-
132
- GITHASH =$(shell if [ -e .distgitrev ]; then cat .distgitrev; else git rev-parse --short HEAD; fi)
133
-
134
- dist-common : clean
135
- @if test " $( wanttag) " -eq 1 -a " ` git name-rev --tags --name-only $( GITHASH) ` " = " undefined" ; then echo " cannot 'make dist' on untagged tree; tag it or use make git-dist" ; exit 1; fi
136
- @rm -f .distgitrev .distgittag
137
- @if ! git diff-index --quiet HEAD; then echo >&2 " WARNING: git working tree has uncommitted changes to tracked files which were INCLUDED" ; fi
138
- @if [ -n " ` git ls-files --exclude-standard --others` " ]; then echo >&2 " WARNING: git working tree has unstaged files which were IGNORED!" ; fi
139
- @echo $(GITHASH ) > .distgitrev
140
- @git name-rev --tags --name-only ` cat .distgitrev` > .distgittag
141
- @ (git ls-tree -r -t --full-tree HEAD --name-only \
142
- && cd pglogical_dump\
143
- && git ls-tree -r -t --full-tree HEAD --name-only | sed ' s/^/pglogical_dump\//' \
144
- ) | \
145
- tar cjf " ${distdir} .tar.bz2" --transform=" s|^|${distdir} /|" --no-recursion \
146
- -T - .distgitrev .distgittag
147
- @echo >&2 " Prepared ${distdir} .tar.bz2 for rev=` cat .distgitrev` , tag=` cat .distgittag` "
148
- @rm -f .distgitrev .distgittag
149
- @md5sum " ${distdir} .tar.bz2" > " ${distdir} .tar.bz2.md5"
150
- @if test -n " $( GPGSIGNKEYS) " ; then gpg -q -a -b $(shell for x in $(GPGSIGNKEYS ) ; do echo -u $$x; done) " ${distdir} .tar.bz2" ; else echo " No GPGSIGNKEYS passed, not signing tarball. Pass space separated keyid list as make var to sign." ; fi
151
-
152
- dist : distdir=pglogical-$(pglogical_version )
153
- dist : wanttag=1
154
- dist : dist-common
155
-
156
- git-dist : distdir=pglogical-$(pglogical_version ) _git$(GITHASH )
157
- git-dist : wanttag=0
158
- git-dist : dist-common
31
+ EXTRA_REGRESS_OPTS += $(top_srcdir ) /contrib/pglogical/regress-postgresql.conf
159
32
33
+ override CPPFLAGS := $(CPPFLAGS ) -I$(top_srcdir ) /contrib/pglogical_output
160
34
161
- .PHONY : regresscheck
35
+ .PHONY : pglogical_create_subscriber
0 commit comments