-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathMakefile
32 lines (24 loc) · 1.14 KB
/
Makefile
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
PG_CONFIG = pg_config
PKG_CONFIG = pkg-config
EXTENSION = ddlx
EXT_VERSION = 0.29
DATA_built = ${EXTENSION}--$(EXT_VERSION).sql
VTESTS = $(shell bin/tests ${VERSION})
#REGRESS = init manifest role type class fdw tsearch policy misc script ${VTESTS}
REGRESS = init role type class fdw tsearch policy misc execute ${VTESTS}
REGRESS_OPTS = --inputdir=test
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
$(DATA_built): ${EXTENSION}.sql
@echo "Building extension version" $(EXT_VERSION) "for Postgres version" $(VERSION)
VERSION=${VERSION} ./bin/pgsqlpp $^ >$@
testall.sh:
pg_lsclusters -h | perl -ne '@_=split("\\s+",$$_); print "make PGPORT=$$_[2] PG_CONFIG=/usr/lib/postgresql/$$_[0]/bin/pg_config clean install installcheck\n";' > testall.sh
.PHONY: electric
electric: ${EXTENSION}.sql
@echo "Generating Electric extension SQL for Postgres version" $(VERSION)
$(eval tmpfile := $(shell mktemp --suffix=.sql))
$(eval outfile = electric-${EXTENSION}-${VERSION}.sql)
VERSION=${VERSION} ./bin/pgsqlpp $^ > $(tmpfile)
elixir ./bin/electric.exs --in ${tmpfile} --out $(outfile)
@echo "Extension file written to " $(outfile)