summaryrefslogtreecommitdiff
path: root/src/makefiles
diff options
context:
space:
mode:
Diffstat (limited to 'src/makefiles')
-rw-r--r--src/makefiles/Makefile2
-rw-r--r--src/makefiles/Makefile.cygwin2
-rw-r--r--src/makefiles/Makefile.darwin2
-rw-r--r--src/makefiles/Makefile.irix2
-rw-r--r--src/makefiles/Makefile.solaris2
-rw-r--r--src/makefiles/Makefile.win322
-rw-r--r--src/makefiles/pgxs.mk86
7 files changed, 46 insertions, 52 deletions
diff --git a/src/makefiles/Makefile b/src/makefiles/Makefile
index c39128898d..417c98b914 100644
--- a/src/makefiles/Makefile
+++ b/src/makefiles/Makefile
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/src/makefiles/Makefile,v 1.3 2009/08/26 22:24:43 petere Exp $
+# src/makefiles/Makefile
subdir = src/makefiles
top_builddir = ../..
diff --git a/src/makefiles/Makefile.cygwin b/src/makefiles/Makefile.cygwin
index 1a5bdc85cd..052ce22ddb 100644
--- a/src/makefiles/Makefile.cygwin
+++ b/src/makefiles/Makefile.cygwin
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/src/makefiles/Makefile.cygwin,v 1.15 2010/07/05 23:15:56 tgl Exp $
+# src/makefiles/Makefile.cygwin
DLLTOOL= dlltool
DLLWRAP= dllwrap
ifdef PGXS
diff --git a/src/makefiles/Makefile.darwin b/src/makefiles/Makefile.darwin
index 4fa4954b36..7a8ba3e527 100644
--- a/src/makefiles/Makefile.darwin
+++ b/src/makefiles/Makefile.darwin
@@ -1,5 +1,5 @@
AROPT = crs
-
+
DLSUFFIX = .so
ifdef PGXS
diff --git a/src/makefiles/Makefile.irix b/src/makefiles/Makefile.irix
index 8141a96b1a..d087ba83ff 100644
--- a/src/makefiles/Makefile.irix
+++ b/src/makefiles/Makefile.irix
@@ -14,6 +14,6 @@ LDFLAGS += -Wl,-woff,15 -Wl,-woff,84
# Rule for building a shared library from a single .o file
%.so: %.o
- $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
sqlmansect = 5sql
diff --git a/src/makefiles/Makefile.solaris b/src/makefiles/Makefile.solaris
index 7681441f80..e459de30cf 100644
--- a/src/makefiles/Makefile.solaris
+++ b/src/makefiles/Makefile.solaris
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/src/makefiles/Makefile.solaris,v 1.15 2010/07/05 18:54:38 tgl Exp $
+# src/makefiles/Makefile.solaris
AROPT = crs
diff --git a/src/makefiles/Makefile.win32 b/src/makefiles/Makefile.win32
index e6466304d4..dbeff298d8 100644
--- a/src/makefiles/Makefile.win32
+++ b/src/makefiles/Makefile.win32
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/src/makefiles/Makefile.win32,v 1.17 2010/07/05 23:15:56 tgl Exp $
+# src/makefiles/Makefile.win32
# Use replacement include files for those missing on Win32
override CPPFLAGS+="-I$(top_srcdir)/src/include/port/win32"
diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk
index 7910c35bca..05ed8416a9 100644
--- a/src/makefiles/pgxs.mk
+++ b/src/makefiles/pgxs.mk
@@ -1,6 +1,6 @@
# PGXS: PostgreSQL extensions makefile
-# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.22 2010/07/05 23:40:13 tgl Exp $
+# src/makefiles/pgxs.mk
# This file contains generic rules to build many kinds of simple
# extension modules. You only need to set a few variables and include
@@ -17,16 +17,18 @@
#
# Set one of these three variables to specify what is built:
#
-# MODULES -- list of shared objects to be built from source files with
-# same stem (do not include suffix in this list)
-# MODULE_big -- a shared object to build from multiple source files
+# MODULES -- list of shared-library objects to be built from source files
+# with same stem (do not include library suffixes in this list)
+# MODULE_big -- a shared library to build from multiple source files
# (list object files in OBJS)
-# PROGRAM -- a binary program to build (list object files in OBJS)
+# PROGRAM -- an executable program to build (list object files in OBJS)
#
# The following variables can also be set:
#
-# MODULEDIR -- subdirectory into which DATA and DOCS files should be
-# installed (if not set, default is "contrib")
+# EXTENSION -- name of extension (there must be a $EXTENSION.control file)
+# MODULEDIR -- subdirectory of $PREFIX/share into which DATA and DOCS files
+# should be installed (if not set, default is "extension" if EXTENSION
+# is set, or "contrib" if not)
# DATA -- random files to install into $PREFIX/share/$MODULEDIR
# DATA_built -- random files to install into $PREFIX/share/$MODULEDIR,
# which need to be built first
@@ -71,18 +73,23 @@ override CFLAGS += $(CFLAGS_SL)
endif
ifdef MODULEDIR
-datamoduledir = $(MODULEDIR)
-docmoduledir = $(MODULEDIR)
+datamoduledir := $(MODULEDIR)
+docmoduledir := $(MODULEDIR)
else
-datamoduledir = contrib
-docmoduledir = contrib
+ifdef EXTENSION
+datamoduledir := extension
+docmoduledir := extension
+else
+datamoduledir := contrib
+docmoduledir := contrib
+endif
endif
ifdef PG_CPPFLAGS
override CPPFLAGS := $(PG_CPPFLAGS) $(CPPFLAGS)
endif
-all: $(PROGRAM) $(DATA_built) $(SCRIPTS_built) $(addsuffix $(DLSUFFIX), $(MODULES))
+all: $(PROGRAM) $(DATA_built) $(SCRIPTS_built) $(addsuffix $(DLSUFFIX), $(MODULES)) $(addsuffix .control, $(EXTENSION))
ifdef MODULE_big
# shared library parameters
@@ -95,46 +102,31 @@ endif # MODULE_big
install: all installdirs
+ifneq (,$(EXTENSION))
+ $(INSTALL_DATA) $(addprefix $(srcdir)/, $(addsuffix .control, $(EXTENSION))) '$(DESTDIR)$(datadir)/extension/'
+endif # EXTENSION
ifneq (,$(DATA)$(DATA_built))
- @for file in $(addprefix $(srcdir)/, $(DATA)) $(DATA_built); do \
- echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'"; \
- $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'; \
- done
+ $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) $(DATA_built) '$(DESTDIR)$(datadir)/$(datamoduledir)/'
endif # DATA
ifneq (,$(DATA_TSEARCH))
- @for file in $(addprefix $(srcdir)/, $(DATA_TSEARCH)); do \
- echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/tsearch_data'"; \
- $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/tsearch_data'; \
- done
+ $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA_TSEARCH)) '$(DESTDIR)$(datadir)/tsearch_data/'
endif # DATA_TSEARCH
ifdef MODULES
- @for file in $(addsuffix $(DLSUFFIX), $(MODULES)); do \
- echo "$(INSTALL_SHLIB) $$file '$(DESTDIR)$(pkglibdir)'"; \
- $(INSTALL_SHLIB) $$file '$(DESTDIR)$(pkglibdir)'; \
- done
+ $(INSTALL_SHLIB) $(addsuffix $(DLSUFFIX), $(MODULES)) '$(DESTDIR)$(pkglibdir)/'
endif # MODULES
ifdef DOCS
ifdef docdir
- @for file in $(addprefix $(srcdir)/, $(DOCS)); do \
- echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/$(docmoduledir)'"; \
- $(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/$(docmoduledir)'; \
- done
+ $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DOCS)) '$(DESTDIR)$(docdir)/$(docmoduledir)/'
endif # docdir
endif # DOCS
ifdef PROGRAM
$(INSTALL_PROGRAM) $(PROGRAM)$(X) '$(DESTDIR)$(bindir)'
endif # PROGRAM
ifdef SCRIPTS
- @for file in $(addprefix $(srcdir)/, $(SCRIPTS)); do \
- echo "$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'"; \
- $(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'; \
- done
+ $(INSTALL_SCRIPT) $(addprefix $(srcdir)/, $(SCRIPTS)) '$(DESTDIR)$(bindir)/'
endif # SCRIPTS
ifdef SCRIPTS_built
- @for file in $(SCRIPTS_built); do \
- echo "$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'"; \
- $(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'; \
- done
+ $(INSTALL_SCRIPT) $(SCRIPTS_built) '$(DESTDIR)$(bindir)/'
endif # SCRIPTS_built
ifdef MODULE_big
@@ -167,6 +159,9 @@ endif # MODULE_big
uninstall:
+ifneq (,$(EXTENSION))
+ rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(addsuffix .control, $(EXTENSION))))
+endif
ifneq (,$(DATA)$(DATA_built))
rm -f $(addprefix '$(DESTDIR)$(datadir)/$(datamoduledir)'/, $(notdir $(DATA) $(DATA_built)))
endif
@@ -215,8 +210,7 @@ ifdef EXTRA_CLEAN
endif
ifdef REGRESS
# things created by various check targets
- rm -rf results tmp_check log
- rm -f regression.diffs regression.out regress.out run_check.out
+ rm -rf $(pg_regress_clean_files)
ifeq ($(PORTNAME), win)
rm -f regress.def
endif
@@ -264,16 +258,16 @@ endif
# against installed postmaster
installcheck: submake
- $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
+ $(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
-# in-tree test doesn't work yet (no way to install my shared library)
-#check: all submake
-# $(top_builddir)/src/test/regress/pg_regress --temp-install \
-# --top-builddir=$(top_builddir) $(REGRESS_OPTS) $(REGRESS)
+ifdef PGXS
check:
- @echo "'make check' is not supported."
- @echo "Do 'make install', then 'make installcheck' instead."
- @exit 1
+ @echo '"$(MAKE) check" is not supported.'
+ @echo 'Do "$(MAKE) install", then "$(MAKE) installcheck" instead.'
+else
+check: all submake
+ $(pg_regress_check) --extra-install=$(subdir) $(REGRESS_OPTS) $(REGRESS)
+endif
endif # REGRESS