@ -38,6 +38,10 @@
# SCRIPTS -- script files (not binaries) to install into $PREFIX/bin
# SCRIPTS -- script files (not binaries) to install into $PREFIX/bin
# SCRIPTS_built -- script files (not binaries) to install into $PREFIX/bin,
# SCRIPTS_built -- script files (not binaries) to install into $PREFIX/bin,
# which need to be built first
# which need to be built first
# HEADERS -- files to install into $(includedir_server)/$MODULEDIR/$MODULE_big
# HEADERS_$(MODULE) -- files to install into
# $(includedir_server)/$MODULEDIR/$MODULE; the value of $MODULE must be
# listed in MODULES or MODULE_big
# REGRESS -- list of regression test cases (without suffix)
# REGRESS -- list of regression test cases (without suffix)
# REGRESS_OPTS -- additional switches to pass to pg_regress
# REGRESS_OPTS -- additional switches to pass to pg_regress
# NO_INSTALLCHECK -- don't define an installcheck target, useful e.g. if
# NO_INSTALLCHECK -- don't define an installcheck target, useful e.g. if
@ -94,13 +98,16 @@ endif
i f d e f M O D U L E D I R
i f d e f M O D U L E D I R
datamoduledir := $( MODULEDIR)
datamoduledir := $( MODULEDIR)
docmoduledir := $( MODULEDIR)
docmoduledir := $( MODULEDIR)
incmoduledir := $( MODULEDIR)
e l s e
e l s e
i f d e f E X T E N S I O N
i f d e f E X T E N S I O N
datamoduledir := extension
datamoduledir := extension
docmoduledir := extension
docmoduledir := extension
incmoduledir := extension
e l s e
e l s e
datamoduledir := contrib
datamoduledir := contrib
docmoduledir := contrib
docmoduledir := contrib
incmoduledir := contrib
e n d i f
e n d i f
e n d i f
e n d i f
@ -108,6 +115,43 @@ ifdef PG_CPPFLAGS
override CPPFLAGS : = $( PG_CPPFLAGS ) $( CPPFLAGS )
override CPPFLAGS : = $( PG_CPPFLAGS ) $( CPPFLAGS )
e n d i f
e n d i f
HEADER_alldirs := $( patsubst HEADERS_%,%,$( filter HEADERS_%, $( .VARIABLES) ) )
# HEADERS is an error in the absence of MODULE_big to provide a dir name
i f d e f M O D U L E _ b i g
i f d e f H E A D E R S
HEADER_dirs := $( MODULE_big)
HEADERS_$(MODULE_big) = $( HEADERS)
e l s e
HEADER_dirs := $( filter $( MODULE_big) ,$( HEADER_alldirs) )
e n d i f
e l s e
i f d e f H E A D E R S
$( error HEADERS requires MODULE_big to be set )
e n d i f
HEADER_dirs := $( filter $( MODULES) ,$( HEADER_alldirs) )
e n d i f
# HEADERS_foo requires that "foo" is in MODULES as a sanity check
i f n e q ( $( filter -out $ ( HEADER_dirs ) ,$ ( HEADER_alldirs ) ) , )
$( error $ ( patsubst %,HEADERS_ %,$ ( filter -out $ ( HEADER_dirs ) ,$ ( HEADER_alldirs ) ) ) defined with no module )
e n d i f
# Functions for generating install/uninstall commands; the blank lines
# before the "endef" are required, don't lose them
# $(call install_headers,dir,headers)
d e f i n e i n s t a l l _ h e a d e r s
$( MKDIR_P ) '$(DESTDIR)$(includedir_server)/$(incmoduledir)/$(1)/'
$( INSTALL_DATA ) $( addprefix $ ( srcdir ) /, $ ( 2) ) '$(DESTDIR)$(includedir_server)/$(incmoduledir)/$(1)/'
e n d e f
# $(call uninstall_headers,dir,headers)
d e f i n e u n i n s t a l l _ h e a d e r s
r m - f $( addprefix '$ ( DESTDIR ) $ ( includedir_server ) /$ ( incmoduledir ) /$ ( 1) '/, $ ( notdir $ ( 2) ) )
e n d e f
all : $( PROGRAM ) $( DATA_built ) $( SCRIPTS_built ) $( addsuffix $ ( DLSUFFIX ) , $ ( MODULES ) ) $( addsuffix .control , $ ( EXTENSION ) )
all : $( PROGRAM ) $( DATA_built ) $( SCRIPTS_built ) $( addsuffix $ ( DLSUFFIX ) , $ ( MODULES ) ) $( addsuffix .control , $ ( EXTENSION ) )
i f e q ( $( with_llvm ) , y e s )
i f e q ( $( with_llvm ) , y e s )
@ -154,6 +198,9 @@ endif # SCRIPTS
i f d e f S C R I P T S _ b u i l t
i f d e f S C R I P T S _ b u i l t
$( INSTALL_SCRIPT) $( SCRIPTS_built) '$(DESTDIR)$(bindir)/'
$( INSTALL_SCRIPT) $( SCRIPTS_built) '$(DESTDIR)$(bindir)/'
e n d i f # SCRIPTS_built
e n d i f # SCRIPTS_built
i f n e q ( $( strip $ ( HEADER_dirs ) ) , )
$( foreach dir,$( HEADER_dirs) ,$( if $( HEADERS_$( dir) ) ,$( call install_headers,$( dir) ,$( HEADERS_$( dir) ) ) ) )
e n d i f # HEADERS
i f d e f M O D U L E _ b i g
i f d e f M O D U L E _ b i g
i f e q ( $( with_llvm ) , y e s )
i f e q ( $( with_llvm ) , y e s )
$( call install_llvm_module,$( MODULE_big) ,$( OBJS) )
$( call install_llvm_module,$( MODULE_big) ,$( OBJS) )
@ -218,6 +265,9 @@ endif
i f d e f S C R I P T S _ b u i l t
i f d e f S C R I P T S _ b u i l t
rm -f $( addprefix '$(DESTDIR)$(bindir)' /, $( SCRIPTS_built) )
rm -f $( addprefix '$(DESTDIR)$(bindir)' /, $( SCRIPTS_built) )
e n d i f
e n d i f
i f n e q ( $( strip $ ( HEADER_dirs ) ) , )
$( foreach dir,$( HEADER_dirs) ,$( if $( HEADERS_$( dir) ) ,$( call uninstall_headers,$( dir) ,$( HEADERS_$( dir) ) ) ) )
e n d i f # HEADERS
i f d e f M O D U L E _ b i g
i f d e f M O D U L E _ b i g
i f e q ( $( with_llvm ) , y e s )
i f e q ( $( with_llvm ) , y e s )