OSDN Git Service

Avoid use of uninitialized variables
[pgstoreplans/pg_store_plans.git] / Makefile
index dc5c747..578c3a1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,18 @@
 # pg_stat_plan/Makefile
 
 MODULES = pg_store_plans
-STOREPLANSVER = 1.1
+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--1.1.sql pg_store_plans--1.0--1.1.sql
 
-REGRESS = all
+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
 ifdef USE_PGXS
 PG_CONFIG = pg_config
@@ -22,19 +25,22 @@ include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
 endif
 
-STARBALL95 = pg_store_plans95-$(STOREPLANSVER).tar.gz
-STARBALL94 = pg_store_plans94-$(STOREPLANSVER).tar.gz
-STARBALLS = $(STARBALL94) $(STARBALL95)
+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
+rpms: rpm14
 
 $(STARBALLS): $(TARSOURCES)
        if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi
@@ -46,23 +52,20 @@ $(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
+rpm14: $(STARBALL14)
+       MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_store_plans14.spec
 
-testfiles: all.out all.sql
+testfiles: convert.out convert.sql
 
-all.out: all.sql
-       psql $(DBNAME) -a -q -f all.sql > all.out
+convert.out: convert.sql
+       psql $(DBNAME) -a -q -X -f convert.sql > $@
 
-all.sql: makeplanfile.sql json2sql.pl
-       psql $(DBNAME) -f makeplanfile.sql | ./json2sql.pl > all.sql
+convert.sql: makeplanfile.sql json2sql.pl
+       psql $(DBNAME) -X -f makeplanfile.sql |& ./json2sql.pl > $@
 
 clean-testfiles:
-       rm -f all.out all.sql
+       rm -f convert.out convert.sql
 
 deploy-testfiles: testfiles
-       mv all.sql sql/
-       mv all.out expected/
+       mv convert.sql sql/
+       mv convert.out expected/