]> granicus.if.org Git - postgresql/blobdiff - src/Makefile.global.in
In a non-hashed Agg node, reset the "aggcontext" at group boundaries, instead
[postgresql] / src / Makefile.global.in
index 820dfd596533246d308b1b1d368b9a88431baa58..763bdc004a04a2da4e19598c4f81230bbb88f3c5 100644 (file)
@@ -1,5 +1,5 @@
 # -*-makefile-*-
-# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.232 2006/10/08 17:15:33 tgl Exp $
+# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.254 2009/06/23 03:46:00 tgl Exp $
 
 #------------------------------------------------------------------------------
 # All PostgreSQL makefiles include this file and use the variables it sets,
@@ -18,7 +18,7 @@
 #
 # Meta configuration
 
-.PHONY: all install install-strip installdirs uninstall clean distclean maintainer-clean distprep check installcheck maintainer-check
+.PHONY: all install install-strip installdirs uninstall clean distclean maintainer-clean distprep check installcheck maintainer-check coverage
 .SILENT: installdirs
 
 # make `all' the default target
@@ -30,6 +30,7 @@ all:
 
 # PostgreSQL version number
 VERSION = @PACKAGE_VERSION@
+MAJORVERSION = @PG_MAJORVERSION@
 
 # Support for VPATH builds
 vpath_build = @vpath_build@
@@ -62,11 +63,12 @@ configure_args = @configure_args@
 
 ifndef PGXS
 
-# Note that prefix and exec_prefix aren't defined in a PGXS build;
+# Note that prefix, exec_prefix, and datarootdir aren't defined in a PGXS build;
 # makefiles may only use the derived variables such as bindir.
 
 prefix := @prefix@
 exec_prefix := @exec_prefix@
+datarootdir := @datarootdir@
 
 bindir := @bindir@
 
@@ -105,20 +107,22 @@ endif
 mandir := @mandir@
 
 docdir := @docdir@
-# docdir can be an empty string to signify --without-docdir
-ifneq (,$(docdir))
 ifeq "$(findstring pgsql, $(docdir))" ""
 ifeq "$(findstring postgres, $(docdir))" ""
 override docdir := $(docdir)/postgresql
 endif
 endif
-endif
+
+htmldir := @htmldir@
 
 localedir := @localedir@
 
 else # PGXS case
 
+# Extension makefiles should set PG_CONFIG, but older ones might not
+ifndef PG_CONFIG
 PG_CONFIG = pg_config
+endif
 
 bindir := $(shell $(PG_CONFIG) --bindir)
 datadir := $(shell $(PG_CONFIG) --sharedir)
@@ -139,8 +143,6 @@ includedir_server = $(pkgincludedir)/server
 includedir_internal = $(pkgincludedir)/internal
 pgxsdir = $(pkglibdir)/pgxs
 
-sqlmansect_dummy = l
-
 
 ##########################################################################
 #
@@ -152,12 +154,17 @@ with_perl = @with_perl@
 with_python    = @with_python@
 with_tcl       = @with_tcl@
 with_openssl   = @with_openssl@
+with_ossp_uuid = @with_ossp_uuid@
+with_libxml    = @with_libxml@
+with_libxslt   = @with_libxslt@
+with_system_tzdata = @with_system_tzdata@
 with_zlib      = @with_zlib@
 enable_shared  = @enable_shared@
 enable_rpath   = @enable_rpath@
 enable_nls     = @enable_nls@
 enable_debug   = @enable_debug@
 enable_dtrace  = @enable_dtrace@
+enable_coverage        = @enable_coverage@
 enable_thread_safety   = @enable_thread_safety@
 
 python_includespec     = @python_includespec@
@@ -183,6 +190,7 @@ PTHREAD_LIBS                = @PTHREAD_LIBS@
 have_docbook   = @have_docbook@
 DOCBOOKSTYLE   = @DOCBOOKSTYLE@
 COLLATEINDEX   = @COLLATEINDEX@
+DOCBOOK2MAN    = @DOCBOOK2MAN@
 
 
 ##########################################################################
@@ -205,22 +213,28 @@ endif # not PGXS
 
 CC = @CC@
 GCC = @GCC@
+SUN_STUDIO_CC = @SUN_STUDIO_CC@
 CFLAGS = @CFLAGS@
 
 # Kind-of compilers
 
-YACC = @YACC@
-YFLAGS = @YFLAGS@
+BISON = @BISON@
+BISONFLAGS = @BISONFLAGS@ $(YFLAGS)
 FLEX = @FLEX@
 FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS)
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
+ZIC = @ZIC@
 
 # Linking
 
+AR = @AR@
+DLLTOOL = @DLLTOOL@
+DLLWRAP = @DLLWRAP@
 LIBS = @LIBS@
 LDAP_LIBS_FE = @LDAP_LIBS_FE@
 LDAP_LIBS_BE = @LDAP_LIBS_BE@
+OSSP_UUID_LIBS = @OSSP_UUID_LIBS@
 LD = @LD@
 with_gnu_ld = @with_gnu_ld@
 ld_R_works = @ld_R_works@
@@ -229,12 +243,17 @@ LDFLAGS_SL = @LDFLAGS_SL@
 LDREL = -r
 LDOUT = -o
 RANLIB = @RANLIB@
+WINDRES = @WINDRES@
 X = @EXEEXT@
 
 # Perl 
 
-# quoted for pathname with spaces
-PERL                   = "@PERL@"
+ifneq (@PERL@,)
+    # quoted to protect pathname with spaces
+    PERL               = "@PERL@"
+else
+    PERL               = $(missing) perl
+endif
 perl_archlibexp                = @perl_archlibexp@
 perl_privlibexp                = @perl_privlibexp@
 perl_useshrplib                = @perl_useshrplib@
@@ -283,6 +302,17 @@ JADE       = @JADE@
 NSGMLS = @NSGMLS@
 SGMLSPL        = @SGMLSPL@
 
+# Code coverage
+
+GCOV = @GCOV@
+LCOV = @LCOV@
+GENHTML = @GENHTML@
+
+ifeq ($(enable_coverage),yes)
+# ccache loses .gcno files
+export CCACHE_DISABLE = 1
+endif
+
 # Feature settings
 
 DEF_PGPORT = @default_port@
@@ -297,6 +327,8 @@ WANTED_LANGUAGES = @WANTED_LANGUAGES@
 # Name of the "template"
 PORTNAME= @PORTNAME@
 
+build_os = @build_os@
+
 host_tuple = @host@
 host_os = @host_os@
 host_cpu = @host_cpu@
@@ -341,7 +373,7 @@ endif
 
 # This macro is for use by libraries linking to libpq.  (Because libpgport
 # isn't created with the same link flags as libpq, it can't be used.)
-libpq := -L$(libpq_builddir) -lpq
+libpq = -L$(libpq_builddir) -lpq
   
 # If doing static linking, shared library dependency info isn't available,
 # so add in the libraries that libpq depends on.
@@ -416,7 +448,7 @@ endif
 #
 # substitute implementations of C library routines (see src/port/)
 
-LIBOBJS = @LIBOBJS@ copydir.o dirmod.o exec.o noblock.o path.o pipe.o pgsleep.o pgstrcasecmp.o qsort.o qsort_arg.o sprompt.o thread.o
+LIBOBJS = @LIBOBJS@
 
 LIBS := -lpgport $(LIBS)
 # add location of libpgport.a to LDFLAGS
@@ -440,31 +472,15 @@ TAS         = @TAS@
 #
 # Global targets and rules
 
+%.i: %.c
+       $(CPP) $(CPPFLAGS) -o $@ $<
+
 %.gz: %
        $(GZIP) -f --best $<
 
 %.bz2: %
        $(BZIP2) -f $<
 
-ifeq ($(PORTNAME),win32)
-# Build rules to add versioninfo resources to win32 binaries
-WIN32RES += win32ver.o
-ifeq ($(PGFILESHLIB),1)
-PGFTYPE=VFT_DLL
-else
-PGFTYPE=VFT_APP
-endif
-ifneq (,$(PGAPPICON))
-PGICOSTR=$(subst /,\/,IDI_ICON ICON \"$(top_builddir)/src/port/$(PGAPPICON).ico\")
-endif
-win32ver.rc: $(top_builddir)/src/port/win32ver.rc
-       sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $(top_builddir)/src/port/win32ver.rc > win32ver.rc
-win32ver.o: $(top_builddir)/src/port/win32ver.rc
-       sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $(top_builddir)/src/port/win32ver.rc > win32ver.rc
-       windres -i win32ver.rc -o win32ver.o --include-dir=$(top_builddir)/src/include
-       rm -f win32ver.rc
-endif
-
 ifndef PGXS
 
 # Remake Makefile.global from Makefile.global.in if the latter
@@ -489,9 +505,11 @@ $(top_builddir)/src/include/pg_config.h: $(top_builddir)/src/include/stamp-h
 $(top_builddir)/src/include/stamp-h: $(top_srcdir)/src/include/pg_config.h.in $(top_builddir)/config.status
        cd $(top_builddir) && ./config.status src/include/pg_config.h
 
-# Also remake ecpg_config.h from ecpg_config.h.in if the latter changed. Values in it can
-# only change if pg_config.h has changed, so include this file to its dependencies.
-$(top_builddir)/src/interfaces/ecpg/include/ecpg_config.h: $(top_builddir)/src/include/pg_config.h $(top_builddir)/src/interfaces/ecpg/include/ecpg_config.h.in $(top_builddir)/config.status
+# Also remake ecpg_config.h from ecpg_config.h.in if the latter changed, same 
+# logic as above.
+$(top_builddir)/src/interfaces/ecpg/include/ecpg_config.h: $(top_builddir)/src/interfaces/ecpg/include/stamp-h
+
+ $(top_builddir)/src/interfaces/ecpg/include/stamp-h: $(top_builddir)/src/interfaces/ecpg/include/ecpg_config.h.in $(top_builddir)/config.status
        cd $(top_builddir) && ./config.status src/interfaces/ecpg/include/ecpg_config.h
 
 # When configure changes, rerun configure with the same options as
@@ -566,3 +584,51 @@ include $(top_srcdir)/src/nls-global.mk
 
 endif # nls.mk
 endif # enable_nls
+
+
+##########################################################################
+#
+# Coverage
+
+# Explanation of involved files:
+#   foo.c      source file
+#   foo.o      object file
+#   foo.gcno   gcov graph (a.k.a. "notes") file, created at compile time
+#              (by gcc -ftest-coverage)
+#   foo.gcda   gcov data file, created when the program is run (for
+#              programs compiled with gcc -fprofile-arcs)
+#   foo.c.gcov gcov output file with coverage information, created by
+#              gcov from foo.gcda (by "make coverage")
+#   foo.c.gcov.out  stdout captured when foo.c.gcov is created, mildly
+#              interesting
+#   lcov.info  lcov tracefile, built from gcda files in one directory,
+#              later collected by "make coverage-html"
+
+ifeq ($(enable_coverage), yes)
+
+# There is a strange interaction between lcov and existing .gcov
+# output files.  Hence the rm command and the ordering dependency.
+
+gcda_files := $(wildcard *.gcda)
+
+lcov.info: $(gcda_files)
+       rm -f *.gcov
+       $(if $^,$(LCOV) -d . -c -o $@ $(LCOVFLAGS))
+
+%.c.gcov: %.gcda | lcov.info
+       $(GCOV) -b -f -p -o . $(GCOVFLAGS) $*.c >$*.c.gcov.out
+
+
+# hook for clean-up
+clean distclean maintainer-clean: clean-coverage
+
+.PHONY: clean-coverage
+clean-coverage:
+       rm -f *.gcda *.gcno lcov.info *.gcov *.gcov.out
+
+
+# User-callable target to reset counts between test runs
+coverage-clean:
+       rm -f `find . -name '*.gcda' -print`
+
+endif # enable_coverage