1 # pg_stat_plan/Makefile
3 MODULES = pg_store_plans
6 MODULE_big = pg_store_plans
7 OBJS = pg_store_plans.o pgsp_json.o pgsp_json_text.o pgsp_explain.o
9 EXTENSION = pg_store_plans
11 PG_VERSION := $(shell pg_config --version | sed "s/^PostgreSQL //" | sed "s/\.[0-9]*$$//")
13 DATA = pg_store_plans--1.6.sql
15 REGRESS = convert store
16 REGRESS_OPTS = --temp-config=regress.conf
19 PGXS := $(shell $(PG_CONFIG) --pgxs)
22 subdir = contrib/pg_store_plans
24 include $(top_builddir)/src/Makefile.global
25 include $(top_srcdir)/contrib/contrib-global.mk
28 STARBALL14 = pg_store_plans14-$(STOREPLANSVER).tar.gz
29 STARBALLS = $(STARBALL14)
31 TARSOURCES = Makefile *.c *.h \
32 pg_store_plans--*.sql \
33 pg_store_plans.control \
34 docs/* expected/*.out sql/*.sql \
36 LDFLAGS+=-Wl,--build-id
38 ## These entries need running server
43 $(STARBALLS): $(TARSOURCES)
44 if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi
45 if [ -e $(subst .tar.gz,,$@) ]; then \
46 echo "$(subst .tar.gz,,$@) is not a symlink. Stop."; \
49 ln -s . $(subst .tar.gz,,$@)
50 tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^)
51 rm $(subst .tar.gz,,$@)
54 MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_store_plans14.spec
56 testfiles: convert.out convert.sql
58 convert.out: convert.sql
59 psql $(DBNAME) -a -q -X -f convert.sql > $@
61 convert.sql: makeplanfile.sql json2sql.pl
62 psql $(DBNAME) -X -f makeplanfile.sql |& ./json2sql.pl > $@
65 rm -f convert.out convert.sql
67 deploy-testfiles: testfiles
69 mv convert.out expected/