-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
71 lines (53 loc) · 1.66 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
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
# pg_stat_plan/Makefile
MODULES = pg_store_plans
STOREPLANSVER = 1.8
MODULE_big = pg_store_plans
OBJS = pg_store_plans.o pgsp_json.o pgsp_json_text.o pgsp_explain.o
EXTENSION = pg_store_plans
PG_VERSION := $(shell pg_config --version | sed "s/^PostgreSQL //" | sed "s/\.[0-9]*$$//")
DATA = pg_store_plans--1.8.sql
REGRESS = convert store
REGRESS_OPTS = --temp-config=regress.conf
ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/pg_store_plans
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
STARBALL16 = pg_store_plans16-$(STOREPLANSVER).tar.gz
STARBALLS = $(STARBALL16)
TARSOURCES = Makefile *.c *.h \
pg_store_plans--*.sql \
pg_store_plans.control \
docs/* expected/*.out sql/*.sql \
ifneq ($(shell uname), SunOS)
LDFLAGS+=-Wl,--build-id
endif
## These entries need running server
DBNAME = postgres
rpms: rpm16
$(STARBALLS): $(TARSOURCES)
if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi
if [ -e $(subst .tar.gz,,$@) ]; then \
echo "$(subst .tar.gz,,$@) is not a symlink. Stop."; \
exit 1; \
fi
ln -s . $(subst .tar.gz,,$@)
tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^)
rm $(subst .tar.gz,,$@)
rpm16: $(STARBALL16)
MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_store_plans16.spec
testfiles: convert.out convert.sql
convert.out: convert.sql
psql $(DBNAME) -a -q -X -f convert.sql > $@
convert.sql: makeplanfile.sql json2sql.pl
psql $(DBNAME) -X -f makeplanfile.sql |& ./json2sql.pl > $@
clean-testfiles:
rm -f convert.out convert.sql
deploy-testfiles: testfiles
mv convert.sql sql/
mv convert.out expected/