summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc-xc/tools/makesgml/Makefile1
-rw-r--r--src/gtm/client/Makefile4
-rw-r--r--src/gtm/common/.gitignore1
-rw-r--r--src/gtm/common/Makefile22
-rw-r--r--src/gtm/common/gtm_opt_handler.c17
-rw-r--r--src/gtm/gtm_ctl/Makefile1
-rw-r--r--src/gtm/libpq/Makefile5
-rw-r--r--src/gtm/main/Makefile1
-rw-r--r--src/gtm/path/Makefile2
-rw-r--r--src/gtm/proxy/Makefile1
-rw-r--r--src/gtm/recovery/Makefile4
11 files changed, 27 insertions, 32 deletions
diff --git a/doc-xc/tools/makesgml/Makefile b/doc-xc/tools/makesgml/Makefile
index 5f346ed086..011697f601 100644
--- a/doc-xc/tools/makesgml/Makefile
+++ b/doc-xc/tools/makesgml/Makefile
@@ -34,4 +34,3 @@ uninstall:
clean distclean maintenance-clean maintainer-clean:
rm -rf makesgml$(X) $(OBJS)
-makesgml.o: makesgml.c $(top_builddir)/src/Makefile.global
diff --git a/src/gtm/client/Makefile b/src/gtm/client/Makefile
index fcf2c5d66e..02ae2ebe02 100644
--- a/src/gtm/client/Makefile
+++ b/src/gtm/client/Makefile
@@ -2,7 +2,7 @@
top_builddir=../../..
include $(top_builddir)/src/Makefile.global
-
+subdir=src/gtm/client
NAME=gtmclient
SO_MAJOR_VERSION= 1
@@ -15,7 +15,7 @@ LIBS=-lpthread
all:all-lib
-include $(top_builddir)/src/Makefile.shlib
+include $(top_srcdir)/src/Makefile.shlib
clean:
rm -f $(OBJS)
diff --git a/src/gtm/common/.gitignore b/src/gtm/common/.gitignore
new file mode 100644
index 0000000000..5963e7b19a
--- /dev/null
+++ b/src/gtm/common/.gitignore
@@ -0,0 +1 @@
+/gtm_opt_scanner.c
diff --git a/src/gtm/common/Makefile b/src/gtm/common/Makefile
index 769ed16876..48f9e7a3b2 100644
--- a/src/gtm/common/Makefile
+++ b/src/gtm/common/Makefile
@@ -5,6 +5,8 @@ subdir=src/gtm/common
include $(top_builddir)/src/Makefile.global
+override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
+
NAME=gtm
SO_MAJOR_VERSION= 1
@@ -13,25 +15,27 @@ SO_MINOR_VERSION= 0
LDFLAGS=-L$(top_builddir)/common -L$(top_builddir)/libpq
LIBS=-lpthread
-OBJS=gtm_opt_scanner.o aset.o mcxt.o gtm_utils.o elog.o assert.o stringinfo.o gtm_lock.o gtm_list.o gtm_serialize.o gtm_serialize_debug.o gtm_opt_handler.o
-
-all:gtm_opt_scanner.c all-lib
+OBJS = gtm_opt_handler.o aset.o mcxt.o gtm_utils.o elog.o assert.o stringinfo.o gtm_lock.o \
+ gtm_list.o gtm_serialize.o gtm_serialize_debug.o
-gtm_opt_hander.o:gtm_opt_scanner.h gtm_opt_handler.c
+all:all-lib
-gtm_opt_scanner.h:gtm_opt_scanner.c
+gtm_opt_handler.o: gtm_opt_scanner.c
-gtm_opt_scanner.c:gtm_opt_scanner.l
- $(FLEX) $(FLEXFLAGS) --header-file=gtm_opt_scanner.h -o'$@' $<
+gtm_opt_scanner.c: gtm_opt_scanner.l
+ifdef FLEX
+ $(FLEX) $(FLEXFLAGS) -o'$@' $<
+else
+ @$(missing) flex $< $@
+endif
# Shared library stuff
include $(top_srcdir)/src/Makefile.shlib
+# Note that gtm_opt_scanner.c is not deleted by make clean as we want it in distribution tarballs
clean:
rm -f $(OBJS)
rm -f libgtm.so libgtm.so.1 libgtm.so.1.0
- rm -f gtm_opt_scanner.c
- rm -f gtm_opt_scanner.h
distclean: clean
diff --git a/src/gtm/common/gtm_opt_handler.c b/src/gtm/common/gtm_opt_handler.c
index 63490386b0..40fbcc935d 100644
--- a/src/gtm/common/gtm_opt_handler.c
+++ b/src/gtm/common/gtm_opt_handler.c
@@ -21,31 +21,18 @@
#include "gtm/gtm_opt.h"
#include "gtm/gtm_opt_tables.h"
#include "gtm/elog.h"
-#include "./gtm_opt_scanner.h"
-
+#include "gtm_opt_scanner.c"
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
#undef fprintf
#define fprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
-enum {
- GTMOPT_ID = 1,
- GTMOPT_STRING = 2,
- GTMOPT_INTEGER = 3,
- GTMOPT_REAL = 4,
- GTMOPT_EQUALS = 5,
- GTMOPT_UNQUOTED_STRING = 6,
- GTMOPT_QUALIFIED_ID = 7,
- GTMOPT_EOL = 99,
- GTMOPT_ERROR = 100
-};
-
static unsigned int ConfigFileLineno;
/* flex fails to supply a prototype for GTMOPT_yylex, so provide one */
int GTMOPT_GTMOPT_yylex(void);
-/* Functions defeined in this file */
+/* Functions defined in this file */
static char *GTMOPT_scanstr(const char *s);
static struct config_generic *find_option(const char *name, bool create_placeholders, int elevel);
static char *gtm_opt_strdup(int elevel, const char *src);
diff --git a/src/gtm/gtm_ctl/Makefile b/src/gtm/gtm_ctl/Makefile
index 40dbc4fd51..eb4c210dca 100644
--- a/src/gtm/gtm_ctl/Makefile
+++ b/src/gtm/gtm_ctl/Makefile
@@ -2,6 +2,7 @@
top_builddir=../../..
include $(top_builddir)/src/Makefile.global
+subdir=src/gtm/gtm_ctl
OBJS=gtm_ctl.o
diff --git a/src/gtm/libpq/Makefile b/src/gtm/libpq/Makefile
index 8324f27112..bdf921ffb6 100644
--- a/src/gtm/libpq/Makefile
+++ b/src/gtm/libpq/Makefile
@@ -2,16 +2,17 @@
top_builddir=../../..
include $(top_builddir)/src/Makefile.global
+subdir=src/gtm/libpq
NAME=pqcomm
SO_MAJOR_VERSION= 1
SO_MINOR_VERSION= 0
-OBJS=ip.o pqcomm.o pqformat.o strlcpy.o pqsignal.o
+OBJS=ip.o pqcomm.o pqformat.o strlcpy.o pqsignal.o
all:all-lib
-include $(top_builddir)/src/Makefile.shlib
+include $(top_srcdir)/src/Makefile.shlib
clean:
rm -f $(OBJS)
diff --git a/src/gtm/main/Makefile b/src/gtm/main/Makefile
index 506685cc75..b24f0c28a3 100644
--- a/src/gtm/main/Makefile
+++ b/src/gtm/main/Makefile
@@ -2,6 +2,7 @@
top_builddir=../../..
include $(top_builddir)/src/Makefile.global
+subdir=src/gtm/main
ifneq ($(PORTNAME), win32)
override CFLAGS += $(PTHREAD_CFLAGS)
diff --git a/src/gtm/path/Makefile b/src/gtm/path/Makefile
index aa6c761288..fd3d609f38 100644
--- a/src/gtm/path/Makefile
+++ b/src/gtm/path/Makefile
@@ -10,7 +10,7 @@ OBJS=path.o
all:all-lib
-include $(top_builddir)/src/Makefile.shlib
+include $(top_srcdir)/src/Makefile.shlib
clean:
rm -f $(OBJS)
diff --git a/src/gtm/proxy/Makefile b/src/gtm/proxy/Makefile
index 7d319a609d..8395a4539b 100644
--- a/src/gtm/proxy/Makefile
+++ b/src/gtm/proxy/Makefile
@@ -2,6 +2,7 @@
top_builddir=../../..
include $(top_builddir)/src/Makefile.global
+subdir=src/gtm/proxy
ifneq ($(PORTNAME), win32)
override CFLAGS += $(PTHREAD_CFLAGS)
diff --git a/src/gtm/recovery/Makefile b/src/gtm/recovery/Makefile
index 6dd88a1545..a55e6aa3c6 100644
--- a/src/gtm/recovery/Makefile
+++ b/src/gtm/recovery/Makefile
@@ -2,7 +2,7 @@
top_builddir=../../..
include $(top_builddir)/src/Makefile.global
-
+subdir=src/gtm/recovery
NAME=gtmrecovery
SO_MAJOR_VERSION= 1
@@ -14,7 +14,7 @@ OTHERS=../client/libgtmclient.a
all:all-lib
-include $(top_builddir)/src/Makefile.shlib
+include $(top_srcdir)/src/Makefile.shlib
clean:
rm -f $(OBJS)