head	1.21;
access;
symbols
	REL9_0_0:1.21
	REL9_1_ALPHA1:1.21
	REL9_0_RC1:1.21
	REL9_0_BETA4:1.21
	REL9_0_STABLE:1.21.0.14
	REL9_0_BETA3:1.21
	REL9_0_BETA2:1.21
	REL7_4_29:1.16
	REL8_0_25:1.18
	REL8_1_21:1.19
	REL8_2_17:1.19
	REL8_3_11:1.20
	REL8_4_4:1.21
	REL9_0_BETA1:1.21
	REL9_0_ALPHA5_BRANCH:1.21.0.12
	REL9_0_ALPHA5:1.21
	REL7_4_28:1.16
	REL8_0_24:1.18
	REL8_1_20:1.19
	REL8_2_16:1.19
	REL8_3_10:1.20
	REL8_4_3:1.21
	REL9_0_ALPHA4:1.21
	REL9_0_ALPHA4_BRANCH:1.21.0.10
	REL8_5_ALPHA3:1.21
	REL8_5_ALPHA3_BRANCH:1.21.0.8
	REL7_4_27:1.16
	REL8_0_23:1.18
	REL8_1_19:1.19
	REL8_2_15:1.19
	REL8_3_9:1.20
	REL8_4_2:1.21
	REL8_5_ALPHA2:1.21
	REL8_5_ALPHA2_BRANCH:1.21.0.6
	REL7_4_26:1.16
	REL8_0_22:1.18
	REL8_1_18:1.19
	REL8_2_14:1.19
	REL8_3_8:1.20
	REL8_4_1:1.21
	REL8_5_ALPHA1:1.21
	REL8_5_ALPHA1_BRANCH:1.21.0.4
	REL8_4_STABLE:1.21.0.2
	REL8_4_0:1.21
	REL8_4_RC2:1.21
	REL8_4_RC1:1.21
	REL8_4_BETA2:1.21
	REL8_4_BETA1:1.21
	REL7_4_25:1.16
	REL8_0_21:1.18
	REL8_1_17:1.19
	REL8_2_13:1.19
	REL8_3_7:1.20
	REL7_4_24:1.16
	REL8_0_20:1.18
	REL8_1_16:1.19
	REL8_2_12:1.19
	REL8_3_6:1.20
	REL7_4_23:1.16
	REL8_0_19:1.18
	REL8_1_15:1.19
	REL8_2_11:1.19
	REL8_3_5:1.20
	REL7_4_22:1.16
	REL8_0_18:1.18
	REL8_1_14:1.19
	REL8_2_10:1.19
	REL8_3_4:1.20
	REL7_4_21:1.16
	REL8_0_17:1.18
	REL8_1_13:1.19
	REL8_2_9:1.19
	REL8_3_3:1.20
	REL7_4_20:1.16
	REL8_0_16:1.18
	REL8_1_12:1.19
	REL8_2_8:1.19
	REL8_3_2:1.20
	REL8_2_7:1.19
	REL8_3_1:1.20
	REL8_3_STABLE:1.20.0.2
	REL8_3_0:1.20
	REL8_3_RC2:1.20
	REL7_3_21:1.16
	REL7_4_19:1.16
	REL8_0_15:1.18
	REL8_1_11:1.19
	REL8_2_6:1.19
	REL8_3_RC1:1.20
	REL8_3_BETA4:1.20
	REL8_3_BETA3:1.20
	REL8_3_BETA2:1.20
	REL8_3_BETA1:1.20
	REL7_3_20:1.16
	REL7_4_18:1.16
	REL8_0_14:1.18
	REL8_1_10:1.19
	REL8_2_5:1.19
	REL7_3_19:1.16
	REL7_4_17:1.16
	REL8_0_13:1.18
	REL8_1_9:1.19
	REL8_2_4:1.19
	REL8_0_12:1.18
	REL8_1_8:1.19
	REL8_2_3:1.19
	REL7_3_18:1.16
	REL7_4_16:1.16
	REL8_0_11:1.18
	REL8_1_7:1.19
	REL8_2_2:1.19
	REL8_0_10:1.18
	REL8_1_6:1.19
	REL8_2_1:1.19
	REL7_4_15:1.16
	REL7_3_17:1.16
	REL8_2_STABLE:1.19.0.4
	REL8_2_0:1.19
	REL8_2_RC1:1.19
	REL8_2_BETA3:1.19
	REL8_2_BETA2:1.19
	REL8_1_5:1.19
	REL8_0_9:1.18
	REL7_4_14:1.16
	REL7_3_16:1.16
	REL8_2_BETA1:1.19
	REL7_3_15:1.16
	REL7_4_13:1.16
	REL8_0_8:1.18
	REL8_1_4:1.19
	REL7_3_14:1.16
	REL7_4_12:1.16
	REL8_0_7:1.18
	REL8_1_3:1.19
	REL7_3_13:1.16
	REL7_4_11:1.16
	REL8_0_6:1.18
	REL8_1_2:1.19
	REL7_3_12:1.16
	REL7_4_10:1.16
	REL8_0_5:1.18
	REL8_1_1:1.19
	REL8_1_STABLE:1.19.0.2
	REL8_1_0:1.19
	REL8_1_0RC1:1.19
	REL8_1_0BETA4:1.19
	REL8_1_0BETA3:1.19
	REL7_3_11:1.16
	REL7_4_9:1.16
	REL8_0_4:1.18
	REL8_1_0BETA2:1.18
	REL8_1_0BETA1:1.18
	REL7_2_8:1.14
	REL7_3_10:1.16
	REL7_4_8:1.16
	REL8_0_3:1.18
	REL8_0_2:1.18
	REL7_2_7:1.14
	REL7_3_9:1.16
	REL7_4_7:1.16
	REL8_0_1:1.18
	REL8_0_STABLE:1.18.0.4
	REL8_0_0:1.18.0.2
	REL8_0_0RC5:1.17
	REL8_0_0RC4:1.17
	REL8_0_0RC3:1.17
	REL8_0_0RC2:1.17
	REL8_0_0RC1:1.17
	REL8_0_0BETA5:1.17
	REL8_0_0BETA4:1.17
	REL7_4_6:1.16
	REL7_3_8:1.16
	REL7_2_6:1.14
	REL8_0_0BETA3:1.17
	REL8_0_0BETA2:1.17
	REL7_2_5:1.14
	REL7_4_5:1.16
	REL7_3_7:1.16
	REL7_4_4:1.16
	REL8_0_0BETA1:1.17
	REL7_4_3:1.16
	REL7_4_2:1.16
	REL7_3_6:1.16
	REL7_4_1:1.16
	REL7_3_5:1.16
	REL7_4:1.16
	REL7_4_RC2:1.16
	REL7_4_STABLE:1.16.0.6
	REL7_4_RC1:1.16
	REL7_4_BETA5:1.16
	REL7_4_BETA4:1.16
	REL7_4_BETA3:1.16
	REL7_4_BETA2:1.16
	WIN32_DEV:1.16.0.4
	REL7_4_BETA1:1.16
	REL7_3_4:1.16
	REL7_3_2:1.16
	REL7_2_4:1.14
	REL7_3_STABLE:1.16.0.2
	REL7_2_3:1.14
	REL7_2_STABLE:1.14.0.2
	REL7_2:1.14
	REL7_2_RC2:1.14
	REL7_2_RC1:1.14
	REL7_2_BETA5:1.14
	REL7_2_BETA4:1.14
	REL7_2_BETA3:1.14
	REL7_2_BETA2:1.14
	REL7_2_BETA1:1.13
	REL7_1_2:1.12
	REL7_1_STABLE:1.12.0.2
	REL7_1_BETA:1.12
	REL7_1_BETA3:1.12
	REL7_1_BETA2:1.12
	REL7_1:1.12
	REL7_0_PATCHES:1.9.0.2
	REL7_0:1.9
	REL6_5_PATCHES:1.8.0.4
	REL6_5:1.8
	REL6_4:1.8.0.2
	release-6-3:1.8
	REL2_0B:1.4.0.2
	REL2_0:1.4
	Release_2_0_0:1.1.1.1
	Release_1_0_3:1.1.1.1.0.2
	Release_2_0:1.1.1.1
	Release_1_0_2:1.1.1.1
	PG95-1_01:1.1.1.1
	PG95_DIST:1.1.1;
locks; strict;
comment	@# @;


1.21
date	2008.04.07.14.15.58;	author petere;	state Exp;
branches;
next	1.20;

1.20
date	2007.06.26.22.05.04;	author tgl;	state Exp;
branches;
next	1.19;

1.19
date	2005.09.27.17.13.14;	author tgl;	state Exp;
branches;
next	1.18;

1.18
date	2005.01.13.18.23.22;	author tgl;	state Exp;
branches;
next	1.17;

1.17
date	2003.11.29.19.52.14;	author pgsql;	state Exp;
branches;
next	1.16;

1.16
date	2002.09.05.18.28.46;	author petere;	state Exp;
branches;
next	1.15;

1.15
date	2002.07.30.17.47.58;	author tgl;	state Exp;
branches;
next	1.14;

1.14
date	2001.10.26.20.45.33;	author tgl;	state Exp;
branches;
next	1.13;

1.13
date	2001.08.09.13.52.06;	author tgl;	state Exp;
branches;
next	1.12;

1.12
date	2000.10.20.21.04.27;	author petere;	state Exp;
branches
	1.12.2.1;
next	1.11;

1.11
date	2000.08.31.16.12.33;	author petere;	state Exp;
branches;
next	1.10;

1.10
date	2000.05.29.05.45.56;	author tgl;	state Exp;
branches;
next	1.9;

1.9
date	2000.03.28.02.49.19;	author tgl;	state Exp;
branches;
next	1.8;

1.8
date	98.03.01.04.52.55;	author scrappy;	state Exp;
branches;
next	1.7;

1.7
date	98.02.28.23.37.07;	author scrappy;	state Exp;
branches;
next	1.6;

1.6
date	98.01.04.19.12.55;	author scrappy;	state Exp;
branches;
next	1.5;

1.5
date	97.01.05.21.17.45;	author bryanh;	state Exp;
branches;
next	1.4;

1.4
date	96.11.18.06.07.52;	author momjian;	state Exp;
branches;
next	1.3;

1.3
date	96.11.13.10.36.24;	author bryanh;	state Exp;
branches;
next	1.2;

1.2
date	96.11.12.11.43.20;	author bryanh;	state Exp;
branches;
next	1.1;

1.1
date	96.07.09.06.22.33;	author scrappy;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	96.07.09.06.22.33;	author scrappy;	state Exp;
branches;
next	;

1.12.2.1
date	2001.08.09.13.52.15;	author tgl;	state Exp;
branches;
next	;


desc
@@


1.21
log
@Implement a few changes to how shared libraries and dynamically loadable
modules are built.  Foremost, it creates a solid distinction between these two
types of targets based on what had already been implemented and duplicated in
ad hoc ways before.  Specifically,

- Dynamically loadable modules no longer get a soname.  The numbers previously
set in the makefiles were dummy numbers anyway, and the presence of a soname
upset a few packaging tools, so it is nicer not to have one.

- The cumbersome detour taken on installation (build a libfoo.so.0.0.0 and
then override the rule to install foo.so instead) is removed.

- Lots of duplicated code simplified.
@
text
@#-------------------------------------------------------------------------
#
# Makefile--
#    Makefile for tutorial
#
# By default, this builds against an existing PostgreSQL installation
# (the one identified by whichever pg_config is first in your path).
# Within a configured source tree, you can say "gmake NO_PGXS=1 all"
# to build using the surrounding source tree.
#
# IDENTIFICATION
#    $PostgreSQL: pgsql/src/tutorial/Makefile,v 1.20 2007/06/26 22:05:04 tgl Exp $
#
#-------------------------------------------------------------------------

MODULES = complex funcs
DATA_built = advanced.sql basics.sql complex.sql funcs.sql syscat.sql

ifdef NO_PGXS
subdir = src/tutorial
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/src/makefiles/pgxs.mk
else
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
endif

%.sql: %.source
	rm -f $@@; \
	C=`pwd`; \
	sed -e "s:_OBJWD_:$$C:g" < $< > $@@
@


1.20
log
@Fix PGXS conventions so that extensions can be built against Postgres
installations whose pg_config program does not appear first in the PATH.
Per gripe from Eddie Stanley and subsequent discussions with Fabien Coelho
and others.
@
text
@d12 1
a12 1
#    $PostgreSQL: pgsql/src/tutorial/Makefile,v 1.19 2005/09/27 17:13:14 tgl Exp $
a18 2
SHLIB_LINK = $(BE_DLLLIBS)

@


1.19
log
@PGXS should be set with := not =, as specified in the documentation,
to avoid useless multiple executions of pg_config.
@
text
@d12 1
a12 1
#    $PostgreSQL: pgsql/src/tutorial/Makefile,v 1.18 2005/01/13 18:23:22 tgl Exp $
d27 2
a28 1
PGXS := $(shell pg_config --pgxs)
@


1.18
log
@Adjust src/tutorial Makefile so that it can use pgxs.  This allows the
tutorial to be used without necessarily having a configured source tree.
@
text
@d12 1
a12 1
#    $PostgreSQL: pgsql/src/tutorial/Makefile,v 1.17 2003/11/29 19:52:14 pgsql Exp $
d27 1
a27 1
PGXS = $(shell pg_config --pgxs)
@


1.17
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d6 5
d12 1
a12 1
#    $PostgreSQL: /cvsroot/pgsql-server/src/tutorial/Makefile,v 1.16 2002/09/05 18:28:46 petere Exp $
d16 6
d25 5
a29 13

override CFLAGS+= $(CFLAGS_SL)
SHLIB_LINK = $(BE_DLLLIBS)

#
# DLOBJS are the dynamically-loaded object files.  The "funcs" queries
# include CREATE FUNCTIONs that load routines from these files.
#
DLOBJS= complex$(DLSUFFIX) funcs$(DLSUFFIX)

QUERIES= advanced.sql basics.sql complex.sql funcs.sql syscat.sql

all: $(DLOBJS) $(QUERIES)
a34 3

clean distclean maintainer-clean:
	rm -f $(DLOBJS) $(QUERIES)
@


1.16
log
@Assorted fixes for Cygwin:

Eliminate the mysterious games that the Cygwin build plays with the linker
flag variables.  DLLLIBS is gone, use SHLIB_LINK like everyone else.
Detect cygipc in configure, after the linker flags are set up, otherwise
configure might not work at all.

Make sure everything is covered by make clean.

Fix the build of the new conversion procedure modules.

Add new DLLIMPORT markers where required.

Finally, the compiler complains if we use an explicit
-I/usr/local/include, so don't do that.  Curiously, -L/usr/local/lib is
still necessary.
@
text
@d7 1
a7 1
#    $Header: /cvsroot/pgsql-server/src/tutorial/Makefile,v 1.15 2002/07/30 17:47:58 tgl Exp $
@


1.15
log
@Ensure that src/tutorial gets cleaned by top-level make clean.
@
text
@d7 1
a7 1
#    $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.14 2001/10/26 20:45:33 tgl Exp $
d16 1
a16 1
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
@


1.14
log
@Remove no-longer-needed dependencies on DLSUFFIX.
@
text
@d7 1
a7 1
#    $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.13 2001/08/09 13:52:06 tgl Exp $
d33 1
a33 1
clean:
@


1.13
log
@Fix Cygwin build, per Jason Tishler.
@
text
@d7 1
a7 1
#    $Header: /home/projects/pgsql/cvsroot/pgsql/src/tutorial/Makefile,v 1.12 2000/10/20 21:04:27 petere Exp $
d19 1
a19 1
# DLOBJS is the dynamically-loaded object files.  The "funcs" queries
a28 3
	if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
	if [ -z "$$USER" ]; then USER=`whoami`; fi; \
	if [ -z "$$USER" ]; then echo 'Cannot deduce $$USER.'; exit 1; fi; \
d31 1
a31 4
	sed -e "s:_CWD_:$$C:g" \
	    -e "s:_OBJWD_:$$C:g" \
	    -e "s:_DLSUFFIX_:$(DLSUFFIX):g" \
	    -e "s/_USER_/$$USER/g" < $< > $@@
@


1.12
log
@Add support for VPATH builds, that is, building somewhere else than in the
source directory.  This involves mostly makefiles using $(srcdir) when they
might have used ".".  (Regression tests don't work with this, yet.)

Sort out usage of CPPFLAGS, CFLAGS (and CXXFLAGS).  Add "override" keyword
in most places, to preserve necessary flags even when the user overrode the
flags.
@
text
@d7 1
a7 1
#    $Header: /home/projects/pgsql/cvsroot/pgsql/src/tutorial/Makefile,v 1.11 2000/08/31 16:12:33 petere Exp $
d16 1
@


1.12.2.1
log
@Fix Cygwin build, per Jason Tishler.
@
text
@d7 1
a7 1
#    $Header: /home/projects/pgsql/cvsroot/pgsql/src/tutorial/Makefile,v 1.12 2000/10/20 21:04:27 petere Exp $
a15 1
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
@


1.11
log
@Fix relative path references so that make knowns which dependencies refer
to one another. Sort out builddir vs srcdir variable namings. Remove some
now obsoleted make variables.
@
text
@d7 1
a7 1
#    $Header: /home/projects/pgsql/cvsroot/pgsql/src/tutorial/Makefile,v 1.10 2000/05/29 05:45:56 tgl Exp $
d15 1
a15 1
CFLAGS+= $(CFLAGS_SL)
@


1.10
log
@Generated header files parse.h and fmgroids.h are now copied into
the src/include tree, so that -I backend is no longer necessary anywhere.
Also, clean up some bit rot in contrib tree.
@
text
@d7 1
a7 1
#    $Header: /home/projects/pgsql/cvsroot/pgsql/src/tutorial/Makefile,v 1.9 2000/03/28 02:49:19 tgl Exp $
d11 3
a13 2
SRCDIR= ..
include $(SRCDIR)/Makefile.global
@


1.9
log
@Fix some bogosity in the tutorial examples.
@
text
@d7 1
a7 1
#    $Header: /usr/local/cvsroot/pgsql/src/tutorial/Makefile,v 1.8 1998/03/01 04:52:55 scrappy Exp $
d14 1
a14 1
CFLAGS+= -I$(SRCDIR)/include $(CFLAGS_SL)
@


1.8
log
@From: Darren King <darrenk@@insightdist.com>

1. Make 'all' works without complaint.  Don't have to add the .exp
   files to the files list.  They are made automagically when
   making the respective shared lib file.

   Only port that actually uses EXPSUFF (from makefiles/Makefile.*)
   is Aix, so if this breaks anybody else, let me know, asap.

2. Make 'clean' actually cleans up correctly.  Previously, it would
   leave the .o files in C-code directory.

3. Changed references to reflect new location of .c files.

4. Added DELETE statements to complex.source so that it tidies up
   when done.  Previously, it would leave things in pg_amop,
   pg_amproc and pg_opclass.  Only possible to do this with the
   new SUBSELECT code in 6.3.  Nice work, fellas...

   Not deleting the index entries would cause a non-fatal error if
   complex.sql was run again on the same database.  Much tidier now.

5. Corrected the README.  obj directory hasn't existed since Bryan
   redid the make way back when.  Also changed the snipet from psql
   to match the current version. POSTGRES95?!?  I don't think so. :)
@
text
@d7 1
a7 1
#    $Header: /usr/local/cvsroot/pgsql/src/tutorial/Makefile,v 1.7 1998/02/28 23:37:07 scrappy Exp $
d12 1
a12 1
include ../Makefile.global
d14 1
a14 9
CFLAGS+= -I$(LIBPQDIR) -I../../include

#
# And where libpq goes, so goes the authentication stuff...
#
ifdef KRBVERS
LDFLAGS+= $(KRBLIBS)
CFLAGS+= $(KRBFLAGS)
endif
a35 2

funcs.sql: $(DLOBJS)
@


1.7
log
@From: Darren King <darrenk@@insightdist.com>

Seem to remember someone posting to one of the lists a while back
that the tutorial code wouldn't compile and/or run.  Found four
problems with it that will let it run.

1. Tutorial makefile had a recursive use of DLOBJS.

2. Some tutorial needed semi-colons added to many statements.

3. Complex tutorial didn't clean up after itself.

4. Advanced had a time-travel example.  Commented it out and
   put a line pointing the user to contrib/spi/README.
@
text
@d7 1
a7 1
#    $Header: /usr/local/cvsroot/pgsql/src/tutorial/Makefile,v 1.6 1998/01/04 19:12:55 scrappy Exp $
d32 1
a32 10
INFILES= $(DLOBJS)

#
# plus exports files
#
ifdef EXPSUFF
INFILES+= $(DLOBJS:.o=$(EXPSUFF))
endif

all: $(QUERIES)
d45 1
a45 5
funcs.sql: $(INFILES)

$(INFILES): 
	$(MAKE) -C C-code $@@
	cp C-code/$@@ .
d48 1
a48 2
	$(MAKE) -C C-code clean
	rm -f $(QUERIES) $(INFILES)
@


1.6
log
@Various fixes NETBSD/sparc related

From: Tom I Helbekkmo <tih@@Hamartun.Priv.NO>
@
text
@d7 1
a7 1
#    $Header: /usr/local/cvsroot/pgsql/src/tutorial/Makefile,v 1.5 1997/01/05 21:17:45 bryanh Exp $
d31 3
d38 1
a38 1
DLOBJS+= $(DLOBJS:.o=$(EXPSUFF))
d54 1
a54 1
funcs.sql:: $(DLOBJS)
d56 1
a56 1
$(DLOBJS): 
d62 1
a62 2
	rm -f $(QUERIES)
	rm -f $(DLOBJS)
@


1.5
log
@Standardize all LDADD to LD_ADD.
@
text
@d7 1
a7 1
#    $Header: /usr/local/cvsroot/postgres95/src/tutorial/Makefile,v 1.4 1996/11/18 06:07:52 momjian Exp $
d15 8
@


1.4
log
@Rename SLSUFF to DLSUFFIX
@
text
@d7 1
a7 1
#    $Header: /usr/local/cvsroot/postgres95/src/tutorial/Makefile,v 1.3 1996/11/13 10:36:24 bryanh Exp $
a15 2
LDADD+= -L$(LIBPQDIR) -lpq
        
@


1.3
log
@Eliminate MKDIR, srcdir, objdir.  Centralize setting of LIBPQDIR.
@
text
@d7 1
a7 1
#    $Header: /usr/local/cvsroot/postgres95/src/test/regress/Makefile,v 1.6 1996/08/06 16:51:17 scrappy Exp $
d22 1
a22 1
DLOBJS= complex$(SLSUFF) funcs$(SLSUFF)
d42 1
a42 1
	    -e "s:_SLSUFF_:$(SLSUFF):g" \
@


1.2
log
@End of the make file simplifications.
@
text
@a11 1
LIBPQDIR= $(SRCDIR)/libpq
@


1.1
log
@Initial revision
@
text
@d4 1
a4 4
#    Makefile for tutorial/C-code
#
# Copyright (c) 1994, Regents of the University of California
#
d7 1
a7 1
#    $Header: /usr/local/cvsroot/postgres95/postgres95/src/tutorial/Makefile,v 1.1.1.1 1996/07/09 05:32:54 scrappy Exp $
d11 3
a13 2
MKDIR=	../mk
include $(MKDIR)/postgres.mk
d15 1
a15 1
VPATH:= $(VPATH):C-code
d17 2
d20 2
a21 1
# build dynamically-loaded object files
d23 1
a23 1
DLOBJS= complex$(SLSUFF) funcs$(SLSUFF) 
d25 1
d27 1
a27 1
# ... plus test query inputs
d29 3
a31 6
CREATEFILES= $(DLOBJS:%=$(objdir)/%) \
	advanced.sql basics.sql complex.sql funcs.sql syscat.sql

include $(MKDIR)/postgres.user.mk

CFLAGS+= -I$(srcdir)/backend
d33 1
a33 1
CLEANFILES+= $(notdir $(CREATEFILES))
d35 10
a44 1
all:: $(CREATEFILES)
d46 1
d48 3
d52 4
@


1.1.1.1
log
@Postgres95 1.01 Distribution - Virgin Sources
@
text
@@
