OSDN Git Service

Avoid use of uninitialized variables
[pgstoreplans/pg_store_plans.git] / Makefile
index d7f8d19..578c3a1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,16 @@
 # pg_stat_plan/Makefile
 
 MODULES = pg_store_plans
-STOREPLANSVER = 1.3
+STOREPLANSVER = 1.6
 
 MODULE_big = pg_store_plans
 OBJS = pg_store_plans.o pgsp_json.o pgsp_json_text.o pgsp_explain.o
 
 EXTENSION = pg_store_plans
-DATA = pg_store_plans--*.sql
+
+PG_VERSION := $(shell pg_config --version | sed "s/^PostgreSQL //" | sed "s/\.[0-9]*$$//")
+
+DATA = pg_store_plans--1.6.sql
 
 REGRESS = convert store
 REGRESS_OPTS = --temp-config=regress.conf
@@ -22,24 +25,22 @@ include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
 endif
 
-STARBALL11 = pg_store_plans11-$(STOREPLANSVER).tar.gz
-STARBALL10 = pg_store_plans10-$(STOREPLANSVER).tar.gz
-STARBALL96 = pg_store_plans96-$(STOREPLANSVER).tar.gz
-STARBALL95 = pg_store_plans95-$(STOREPLANSVER).tar.gz
-STARBALL94 = pg_store_plans94-$(STOREPLANSVER).tar.gz
-STARBALLS = $(STARBALL94) $(STARBALL95) $(STARBALL96) $(STARBALL10) $(STARBALL11)
+STARBALL14 = pg_store_plans14-$(STOREPLANSVER).tar.gz
+STARBALLS = $(STARBALL14)
 
 TARSOURCES = Makefile *.c  *.h \
        pg_store_plans--*.sql \
        pg_store_plans.control \
-       doc/* expected/*.out sql/*.sql \
+       docs/* expected/*.out sql/*.sql \
 
+ifneq ($(shell uname), SunOS)
 LDFLAGS+=-Wl,--build-id
+endif
 
 ## These entries need running server
 DBNAME = postgres
 
-rpms: rpm94 rpm95 rpm96 rpm10 rpm11
+rpms: rpm14
 
 $(STARBALLS): $(TARSOURCES)
        if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi
@@ -51,28 +52,16 @@ $(STARBALLS): $(TARSOURCES)
        tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^)
        rm $(subst .tar.gz,,$@)
 
-rpm94: $(STARBALL94)
-       MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_store_plans94.spec
-
-rpm95: $(STARBALL95)
-       MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_store_plans95.spec
-
-rpm96: $(STARBALL96)
-       MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_store_plans96.spec
-
-rpm10: $(STARBALL10)
-       MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_store_plans10.spec
-
-rpm11: $(STARBALL11)
-       MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_store_plans11.spec
+rpm14: $(STARBALL14)
+       MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_store_plans14.spec
 
 testfiles: convert.out convert.sql
 
 convert.out: convert.sql
-       psql $(DBNAME) -a -q -f convert.sql > $@
+       psql $(DBNAME) -a -q -X -f convert.sql > $@
 
 convert.sql: makeplanfile.sql json2sql.pl
-       psql $(DBNAME) -f makeplanfile.sql |& ./json2sql.pl > $@
+       psql $(DBNAME) -X -f makeplanfile.sql |& ./json2sql.pl > $@
 
 clean-testfiles:
        rm -f convert.out convert.sql