forked from lacanoid/pgddl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (23 loc) · 976 Bytes
/
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
PG_CONFIG = pg_config
PKG_CONFIG = pkg-config
EXTENSION = ddlx
EXT_VERSION = 0.23
VTESTS = $(shell bin/tests ${VERSION})
DATA_built = ddlx--$(EXT_VERSION).sql
#REGRESS = init manifest role type class fdw tsearch policy misc script ${VTESTS}
REGRESS = init role type class fdw tsearch policy misc ${VTESTS}
#REGRESS = ($shell bin/tests)
REGRESS_OPTS = --inputdir=test
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
$(DATA_built): ddlx.sql
@echo "Building extension version" $(EXT_VERSION) "for Postgres version" $(VERSION)
VERSION=${VERSION} ./bin/pgsqlpp $^ >$@
.PHONY: electric
electric: ddlx.sql
@echo "Generating Electric extension SQL for Postgres version" $(VERSION)
$(eval tmpfile := $(shell mktemp --suffix=.sql))
$(eval outfile = electric-ddlx-${VERSION}.sql)
VERSION=${VERSION} ./bin/pgsqlpp $^ > $(tmpfile)
elixir ./bin/electric.exs --in ${tmpfile} --out $(outfile)
@echo "Extension file written to " $(outfile)