Move pgxc_clean to src/bin
authorPavan Deolasee <pavan.deolasee@gmail.com>
Wed, 1 Aug 2018 05:17:06 +0000 (10:47 +0530)
committerPavan Deolasee <pavan.deolasee@gmail.com>
Wed, 1 Aug 2018 05:17:06 +0000 (10:47 +0530)
contrib/Makefile
contrib/pgxc_clean/Makefile [deleted file]
src/bin/Makefile
src/bin/pgxc_clean/.gitignore [moved from contrib/pgxc_clean/.gitignore with 100% similarity]
src/bin/pgxc_clean/Makefile [new file with mode: 0644]
src/bin/pgxc_clean/pgxc_clean.c [moved from contrib/pgxc_clean/pgxc_clean.c with 100% similarity]
src/bin/pgxc_clean/pgxc_clean.h [moved from contrib/pgxc_clean/pgxc_clean.h with 100% similarity]
src/bin/pgxc_clean/pgxc_clean_test.sh [moved from contrib/pgxc_clean/pgxc_clean_test.sh with 100% similarity]
src/bin/pgxc_clean/txninfo.c [moved from contrib/pgxc_clean/txninfo.c with 100% similarity]
src/bin/pgxc_clean/txninfo.h [moved from contrib/pgxc_clean/txninfo.h with 100% similarity]

index 01084082623ea270289d3bc14e7b8da051b119b2..ba34a7cc267e607e7913f2e758e26f5b284af540 100644 (file)
@@ -39,7 +39,6 @@ SUBDIRS = \
                pgcrypto        \
                pgrowlocks      \
                pgstattuple     \
-               pgxc_clean      \
                pgxc_monitor \
                pg_visibility   \
                postgres_fdw    \
diff --git a/contrib/pgxc_clean/Makefile b/contrib/pgxc_clean/Makefile
deleted file mode 100644 (file)
index 4938573..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#-------------------------------------------------------------------------
-#
-# Makefile for contrib/pgxc_clean
-#
-# Portions Copyright (c) 2011-2012 Postgres-XC Development Group
-#
-# $PostgreSQL$
-#
-#-------------------------------------------------------------------------
-
-PGFILEDESC = "pgxc_clean - Abort prepared transaction for a Postgres-XC Coordinator"
-PGAPPICON = win32
-
-PROGRAM= pgxc_clean
-OBJS= pgxc_clean.o txninfo.o
-
-#Include GTM objects
-gtm_builddir = $(top_builddir)/src/gtm
-EX_OBJS = $(gtm_builddir)/common/assert.o \
-         $(gtm_builddir)/client/libgtmclient.a
-
-PG_CPPFLAGS  = -DFRONTEND -DDLSUFFIX=\"$(DLSUFFIX)\" -I$(srcdir) -I$(libpq_srcdir)
-PG_LIBS = $(libpq_pgport) $(PTHREAD_LIBS)
-
-ifdef USE_PGXS
-PG_CONFIG = pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-include $(PGXS)
-else
-subdir = contrib/pgxc_clean
-top_builddir = ../..
-include $(top_builddir)/src/Makefile.global
-include $(top_srcdir)/contrib/contrib-global.mk
-endif
index 591b9f005052fa2821254d1ef6a38d9d41c61301..c0fbf373362e3815c6dc70658ffac2d64a737eba 100644 (file)
@@ -31,6 +31,7 @@ SUBDIRS = \
        pgbench \
        psql \
        pgxc_ctl \
+       pgxc_clean \
        scripts
 
 ifeq ($(PORTNAME), win32)
diff --git a/src/bin/pgxc_clean/Makefile b/src/bin/pgxc_clean/Makefile
new file mode 100644 (file)
index 0000000..eb8ca81
--- /dev/null
@@ -0,0 +1,56 @@
+#-------------------------------------------------------------------------
+#
+# Makefile for src/bin/pgxc_clean
+#
+# Portions Copyright (c) 2011-2012 Postgres-XC Development Group
+#
+# $PostgreSQL$
+#
+#-------------------------------------------------------------------------
+
+PGFILEDESC = "pgxc_clean - Resolve prepared transactions in PGXL cluster"
+PGAPPICON = win32
+
+subdir = src/bin/pgxc_clean
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
+
+OBJS= pgxc_clean.o txninfo.o
+
+#Include GTM objects
+gtm_builddir = $(top_builddir)/src/gtm
+EX_OBJS = $(gtm_builddir)/common/assert.o \
+         $(gtm_builddir)/client/libgtmclient.a
+
+PG_CPPFLAGS  = -DFRONTEND -DDLSUFFIX=\"$(DLSUFFIX)\" -I$(srcdir) -I$(libpq_srcdir)
+PG_LIBS = $(libpq_pgport) $(PTHREAD_LIBS)
+
+override CPPFLAGS := $(PG_CPPFLAGS) $(CPPFLAGS)
+override LDFLAGS := $(PG_LIBS) $(LDFLAGS)
+
+SUBMAKE_LIBPQ := submake-libpq
+SUBMAKE_GTMLIB := submake-gtmlib
+
+all: pgxc_clean
+
+pgxc_clean: $(OBJS) $(EX_OBJS) | $(SUBMAKE_LIBPQ) $(SUBMAKE_GTMLIB)
+       $(CC) $(CFLAGS) $(OBJS) $(EX_OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
+
+install: all installdirs
+       $(INSTALL_PROGRAM) pgxc_clean$(X) '$(DESTDIR)$(bindir)/pgxc_clean$(X)'
+
+installdirs:
+       $(MKDIR_P) '$(DESTDIR)$(bindir)'
+
+uninstall:
+       rm -f '$(DESTDIR)$(bindir)/pgxc_clean$(X)'
+
+clean distclean maintainer-clean:
+       rm -f pgxc_clean$(X) $(OBJS)
+       rm -rf tmp_check
+
+check:
+       $(prove_check)
+
+installcheck:
+       $(prove_installcheck)