head	1.10;
access;
symbols
	Version_2_1:1.2;
locks; strict;
comment	@# @;


1.10
date	94.06.16.11.26.20;	author aoki;	state Exp;
branches;
next	1.9;

1.9
date	93.06.16.04.11.18;	author aoki;	state Exp;
branches;
next	1.8;

1.8
date	93.06.14.19.55.20;	author aoki;	state Exp;
branches;
next	1.7;

1.7
date	93.06.14.19.47.35;	author aoki;	state Exp;
branches;
next	1.6;

1.6
date	93.02.16.23.23.22;	author aoki;	state Exp;
branches;
next	1.5;

1.5
date	93.02.16.22.50.06;	author aoki;	state Exp;
branches;
next	1.4;

1.4
date	92.02.15.20.35.03;	author mer;	state Exp;
branches;
next	1.3;

1.3
date	92.02.15.20.32.32;	author mer;	state Exp;
branches;
next	1.2;

1.2
date	91.03.08.13.22.19;	author kemnitz;	state Exp;
branches;
next	1.1;

1.1
date	90.10.24.20.30.41;	author cimarron;	state Exp;
branches;
next	;


desc
@code contributed by Igor Metz
@


1.10
log
@mus may not contain a valid path to perl
if an obj/ dir exists, need to find testlibpq.pl
@
text
@#
# $Header: /faerie/aoki/postgres/src/contrib/pgperl/RCS/Makefile,v 1.9 1993/06/16 04:11:18 aoki Exp aoki $
#
.include <postgres.global.mk>

CFLAGS= -g

#
# PERLDIR is the perl distribution directory.
#	you must have already built all of perl (including mus) in order
#	to start building pgperl.
#
PERLDIR=/usr/local/devel/perl
MUS= perl ${PERLDIR}/usub/mus

# 
# Don't add uperl.o to OBJS or it will be removed when you do 
# "bmake clean"... :-(
#
LDADD+= ${PERLDIR}/uperl.o
LDADD+= -L${LIBDIR} -lpq -lm

CFLAGS+= -I${HEADERDIR} -I${PERLDIR}

.SUFFIXES: .mus

.mus.c:
	${MUS} $< > ${.TARGET}

SRCS= pg-libpq.mus usersub.c
TESTOBJ= testlibpq.out
PROG= pgperl

.MAIN: ${PROG}

${PROG}: ${PERLDIR}/uperl.o

${TESTOBJ}: ${PROG} testlibpq.pl
	./${PROG} ${.CURDIR}/testlibpq.pl 2>&1 | tee ${.TARGET}

runtest: ${TESTOBJ}

CLEANFILES+= ${TESTOBJ} pg-libpq.c

.include <postgres.prog.mk>
@


1.9
log
@added pg-libpq.c (produced from .mus) to CLEANFILES
@
text
@d2 1
a2 1
# $Header: /home2/aoki/postgres/src/contrib/pgperl/RCS/Makefile,v 1.8 1993/06/14 19:55:20 aoki Exp aoki $
d14 1
a14 1
MUS= ${PERLDIR}/usub/mus
d39 1
a39 1
	./${PROG} testlibpq.pl 2>&1 | tee ${.TARGET}
@


1.8
log
@added test output file to CLEANFILES
@
text
@d2 1
a2 1
# $Header: /home2/aoki/postgres/src/contrib/pgperl/RCS/Makefile,v 1.7 1993/06/14 19:47:35 aoki Exp aoki $
d6 2
a15 2
CFLAGS= -g

d43 1
a43 1
CLEANFILES+= ${TESTOBJ}
@


1.7
log
@added PQerrormsg to accessable globals
added PQexec error-handling

cleaned up Makefile to deal with Makefile.global hierarchy
(also proper dependencies)

bugfix for .mus file.. integer variables need to be cast to double
for str_numstr to understand them correctly.
@
text
@d2 1
a2 1
# $Header: /home2/aoki/postgres/src/contrib/pgperl/RCS/Makefile,v 1.6 1993/02/16 23:23:22 aoki Exp aoki $
d31 1
a31 1

d38 1
a38 1
testlibpq.out: ${PROG} testlibpq.pl
d41 3
a43 1
runtest: testlibpq.out
@


1.6
log
@made it a bit prettier.
@
text
@a0 1
# $Header: /home2/aoki/postgres/src/contrib/pgperl/RCS/Makefile,v 1.5 1993/02/16 22:50:06 aoki Exp aoki $
d2 1
a2 1
# RWW's Makefile modified for use with bmake.
d4 12
a15 2
# RWW's comments:
# Makefile for pgperl (Postgres 4.0.1 and Perl 4.19).
d17 2
a18 1
# My guess is that this will work for any perl => 4.19 and < 5.x
d20 11
a30 4
# This makefile assumes that you are in the subdirectory src/contrib/pgperl of
# your Postgres distribution.  You must select the port you are building
# against and the location of your perl distribution and your compiler.
#
d32 1
a32 2
# PERLDIR is the perl distribution directory
PERLDIR=/usr/local/devel/perl
d34 1
a34 17
# Select your compiler and compilation flags
#CC=gcc
#CCFLAGS = -traditional -fpcc-struct-return -g 
CCFLAGS= -O

MUS= $(PERLDIR)/usub/mus
LIBS= -L../../libpq/obj -lpq -lm
PGINCS= -I../../backend
CFLAGS= $(CCFLAGS) -I$(PERLDIR) $(PGINCS)

all: pgperl

pgperl: $(PERLDIR)/uperl.o usersub.o pg-libpq.o
	$(CC) $(CCFLAGS) ${.ALLSRC} $(LIBS) $(PERLLIBS) -o ${.TARGET}
	@@echo
	@@echo Remember to start the postmaster before running the test script.
	@@echo
d36 1
a36 2
pg-libpq.c: pg-libpq.mus
	$(MUS) pg-libpq.mus > pg-libpq.c
d38 2
a39 2
testlibpq.out: pgperl testlibpq.pl
	./pgperl testlibpq.pl > ${.TARGET}
d43 1
a43 2
clean:
	rm -f usersub.o pg-libpq.o pg-libpq.c pgperl testlibpq.out
@


1.5
log
@folded in RWW's changes and tested under ultrix
@
text
@d1 1
a1 1
# $Header$
d31 1
a31 1
	$(CC) $(CCFLAGS) $(.ALLSRC) $(LIBS) $(PERLLIBS) -o $(.TARGET)
d40 1
a40 1
	./pgperl testlibpq.pl > $(.TARGET)
@


1.4
log
@fix shar botch (made a 2 lines out of 1)
@
text
@d1 13
a13 4
# Makefile for pgperl.
# $Header: /genome/src/postgres/src/contrib/pgperl/RCS/Makefile,v 1.2 92/02/07 16:37:46 hartzell Exp $
# Thu Aug 23 15:00:05 1990  Igor Metz <metz@@iam.unibe.ch>
# touched up to work with my configuration under postgres3.1 and perl4.x
d15 2
a16 2
# PERLDIR is the directory, where your uperl.o and all perl header file live
PERLDIR = ..
d18 4
a21 7
# GLOBINCS defines include paths, where your Postgres header files live
GLOBINCS = -I../../pg -I/usr/postgres/src/lib/H

# LIBS defines, where your libpq.a lives
LIBS = -L/usr/postgres/obj.sparc -lpq -lm

DISTFILES = README Makefile pg-mus usersub.c pg-libpq.mus testlibpq.pl
d23 4
a26 4
CC=cc
CFLAGS = -g -I$(PERLDIR) $(GLOBINCS)
#CC=gcc
#CFLAGS = -traditional -fpcc-struct-return -g -I$(PERLDIR) $(GLOBINCS)
d31 4
a34 1
	$(CC) -g $(PERLDIR)/uperl.o usersub.o pg-libpq.o $(LIBS) -o pgperl 
d37 4
a40 1
	pg-mus pg-libpq.mus > pg-libpq.c
d42 1
a42 2
usersub.o: usersub.c
pg-libpq.o: pg-libpq.c
d45 1
a45 4
	rm usersub.o pg-libpq.o pg-libpq.c

dist:
	shar $(DISTFILES) > dist.shar
@


1.3
log
@updated by George Hartzell of the Stanford Genome project
@
text
@d2 1
a2 2
# $Header: /genome/src/postgres/src/contrib/pgperl/RCS/Makefile,v 1.2 92/02/07
 16:37:46 hartzell Exp $
@


1.2
log
@added RCS header.
@
text
@d2 2
a3 1
# $Header: RCS/README,v 1.1 90/10/24 20:23:49 cimarron Exp $
d5 1
d11 1
a11 1
GLOBINCS = -I../../pg -I/usr/postgres/PERLDIR/lib/H
d14 1
a14 1
LIBS = -L/usr/postgres/obj.sparc -lpq
d26 1
a26 1
	$(CC) -g $(PERLDIR)/uperl.o usersub.o libpq.o $(LIBS) -o pgperl
@


1.1
log
@Initial revision
@
text
@d2 1
@
