@ -62,8 +62,20 @@ top_builddir := $(dir $(PGXS))../..
i n c l u d e $( top_builddir ) / s r c / M a k e f i l e . g l o b a l
top_srcdir = $( top_builddir)
# If USE_VPATH is set or Makefile is not in current directory we are building
# the extension with VPATH so we set the variable here
i f d e f U S E _ V P A T H
srcdir = $( USE_VPATH)
VPATH = $( USE_VPATH)
e l s e
i f e q ( $( CURDIR ) , $( dir $ ( firstword $ ( MAKEFILE_LIST ) ) ) )
srcdir = .
VPATH =
e l s e
srcdir = $( dir $( firstword $( MAKEFILE_LIST) ) )
VPATH = $( srcdir)
e n d i f
e n d i f
# These might be set in Makefile.global, but if they were not found
# during the build of PostgreSQL, supply default values so that users
@ -112,33 +124,40 @@ all: all-lib
e n d i f # MODULE_big
install : all installdirs
i f n e q ( , $( EXTENSION ) )
$( INSTALL_DATA) $( addprefix $( srcdir) /, $( addsuffix .control, $( EXTENSION) ) ) '$(DESTDIR)$(datadir)/extension/'
e n d i f # EXTENSION
i f n e q ( , $( DATA ) $( DATA_built ) )
$( INSTALL_DATA) $( addprefix $( srcdir) /, $( DATA) ) $( DATA_built) '$(DESTDIR)$(datadir)/$(datamoduledir)/'
e n d i f # DATA
i f n e q ( , $( DATA_TSEARCH ) )
$( INSTALL_DATA) $( addprefix $( srcdir) /, $( DATA_TSEARCH) ) '$(DESTDIR)$(datadir)/tsearch_data/'
e n d i f # DATA_TSEARCH
install : all installdirs installcontrol installdata installdatatsearch installdocs installscripts
i f d e f M O D U L E S
$( INSTALL_SHLIB) $( addsuffix $( DLSUFFIX) , $( MODULES) ) '$(DESTDIR)$(pkglibdir)/'
e n d i f # MODULES
i f d e f P R O G R A M
$( INSTALL_PROGRAM) $( PROGRAM) $( X) '$(DESTDIR)$(bindir)'
e n d i f # PROGRAM
installcontrol : $( addsuffix .control , $ ( EXTENSION ) )
i f n e q ( , $( EXTENSION ) )
$( INSTALL_DATA) $< '$(DESTDIR)$(datadir)/extension/'
e n d i f
installdata : $( DATA ) $( DATA_built )
i f n e q ( , $( DATA ) $( DATA_built ) )
$( INSTALL_DATA) $^ '$(DESTDIR)$(datadir)/$(datamoduledir)/'
e n d i f
installdatatsearch : $( DATA_TSEARCH )
i f n e q ( , $( DATA_TSEARCH ) )
$( INSTALL_DATA) $^ '$(DESTDIR)$(datadir)/tsearch_data/'
e n d i f
installdocs : $( DOCS )
i f d e f D O C S
i f d e f d o c d i r
$( INSTALL_DATA) $( addprefix $( srcdir) /, $( DOCS) ) '$(DESTDIR)$(docdir)/$(docmoduledir)/'
$( INSTALL_DATA) $^ '$(DESTDIR)$(docdir)/$(docmoduledir)/'
e n d i f # docdir
e n d i f # DOCS
i f d e f P R O G R A M
$( INSTALL_PROGRAM) $( PROGRAM) $( X) '$(DESTDIR)$(bindir)'
e n d i f # PROGRAM
installscripts : $( SCRIPTS ) $( SCRIPTS_built )
i f d e f S C R I P T S
$( INSTALL_SCRIPT) $( addprefix $( srcdir) /, $( SCRIPTS) ) '$(DESTDIR)$(bindir)/'
$( INSTALL_SCRIPT) $^ '$(DESTDIR)$(bindir)/'
e n d i f # SCRIPTS
i f d e f S C R I P T S _ b u i l t
$( INSTALL_SCRIPT) $( SCRIPTS_built) '$(DESTDIR)$(bindir)/'
e n d i f # SCRIPTS_built
i f d e f M O D U L E _ b i g
install : install -lib
@ -263,6 +282,7 @@ test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src)
all : $( test_files_build )
$(test_files_build) : $( abs_builddir ) /%: $( srcdir ) /%
$( MKDIR_P) $( dir $@ )
ln -s $< $@
e n d i f # VPATH