head	1.6;
access;
symbols;
locks; strict;
comment	@# @;


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

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

1.4
date	93.03.05.04.30.21;	author aoki;	state Exp;
branches;
next	1.3;

1.3
date	93.03.05.04.03.07;	author aoki;	state Exp;
branches;
next	1.2;

1.2
date	93.02.20.04.40.41;	author aoki;	state Exp;
branches;
next	1.1;

1.1
date	93.02.18.23.27.32;	author aoki;	state Exp;
branches;
next	;


desc
@bmake'ified Makefile
@


1.6
log
@fix for strdup
@
text
@#
# spog (simple postgres query interface)
#
# $Id: Makefile,v 1.4 1993/03/05 04:30:21 aoki Exp aoki $
#
# $Log: Makefile,v
#
# Revision 2.3  1992/08/13  11:47:33  schoenw
# scripts using spog added
#
# Revision 2.2  1992/05/27  14:50:54  schoenw
# HAVE_XMALLOC define for some readline versions added
#
# Revision 2.1  1992/05/22  12:53:33  schoenw
# this is the public release 1.0
#
# Revision 1.4  1992/05/22  12:46:00  schoenw
# builtin-commands, help functions and completion added
#
# Revision 1.3  1992/03/09  15:39:21  schoenw
# bug in install target
#
# Revision 1.2  1992/03/09  15:37:46  schoenw
# clean target added
#
# Revision 1.1  1992/01/24  16:45:20  schoenw
# Initial revision
#

#
# I decided not to install the shell programs, seeing as how Juergen
# doesn't recommend casual use of them ...  -- pma 2/19/93
#
.include <postgres.global.mk>

NOMAN=
LDFLAGS= -g
CFLAGS= -g
CFLAGS+= -I${HEADERDIR}
LDADD+= -L${LIBDIR}

#
# for debugging, of course.
#
#CFLAGS+= -DDEBUG

#
# some readline libraries have xmalloc and xrealloc, some don't.
# comment out this line if your readline library has xmalloc and xrealloc.
#
CFLAGS+= -DNEED_XMALLOC

#
# some versions of UNIX have strdup, some don't.
# comment out this line if your standard library has strdup.
#
.if (${PORTNAME} == "ultrix4")
CFLAGS+= -DNEED_STRDUP
.endif

#
# these lines should point to the GNU readline library and its headers.
# comment them out if the GNU readline library is in a standard place.
#
CFLAGS+= -I/usr/sww/include
LDADD+= -L/usr/sww/lib

LDADD+= -lpq -lreadline -ltermcap

.MAIN: ${PROG}

PROG= spog

SRCS= spog.c query.c command.c

.include <postgres.prog.mk>
@


1.5
log
@understands E error values as well as R remarks from PQexec
@
text
@d57 1
a57 1
.if ${PORTNAME} == ultrix4
@


1.4
log
@changed POSTGRESTOP to POSTGRESDIR (even though it's not really
inherited..)
@
text
@d4 1
a4 1
# $Id: Makefile,v 1.3 1993/03/05 04:03:07 aoki Exp aoki $
a36 1

d38 3
d42 4
a45 1
CFLAGS= -g  #-DDEBUG
d57 1
d59 1
a59 13

#
# set POSTGRESDIR to the top directory of postgres (one above src/).
#	spog will be installed in BINDIR.
#	HEADERDIR and LIBDIR should point to the install libpq.
#
#POSTGRESDIR=${.CURDIR}/../../..
POSTGRESDIR= /private/devel/postgres
BINDIR= ${POSTGRESDIR}/bin
HEADERDIR= ${POSTGRESDIR}/include
LIBDIR= ${POSTGRESDIR}/lib
CFLAGS+= -I${HEADERDIR}
LDADD+= -L${LIBDIR}
d62 1
a62 1
# these lines should point to the GNU readline library.
@


1.3
log
@streamlined things a bit
@
text
@d4 1
a4 1
# $Id: Makefile,v 1.2 1993/02/20 04:40:41 aoki Exp $
d55 1
a55 1
# set POSTGRESTOP to the top directory of postgres (one above src/).
d57 1
a57 1
#	INCDIR and LIBDIR should point to the install libpq.
d59 6
a64 5
POSTGRESTOP=${.CURDIR}/../../..
BINDIR= ${POSTGRESTOP}/bin
INCDIR= ${POSTGRESTOP}/include
LIBDIR= ${POSTGRESTOP}/lib
CFLAGS+= -I${INCDIR}
@


1.2
log
@removed installation of scripts
@
text
@d4 1
a4 1
# $Id: Makefile,v 1.1 1993/02/20 04:37:01 aoki Exp $
d6 1
a6 3
# $Log: Makefile,v $
# Revision 1.1  1993/02/18  23:27:32  aoki
# Initial revision
d32 1
a32 1
# himself doesn't recommend casual use of them ...  -- pma 2/19/93
d38 5
d44 5
a48 1
# define NEED_XMALLOC if your readline library lacks xmalloc and xrealloc.
d50 3
a52 2
# define NEED_STRDUP if your standard library lacks strdup.
CFLAGS= -O -DNEED_XMALLOC -DNEED_STRDUP #-DDEBUG
d54 1
d56 3
d61 11
a71 2
CFLAGS+= -I$(POSTGRESTOP)/src/backend
LDADD+= -L$(POSTGRESTOP)/src/libpq/obj
d73 1
a73 7
# this points to the include files of gnu readline.
# comment this out if they're in a standard place (e.g., /usr/include).
CFLAGS+= -I/usr/local/devel

# this points to the gnu readline library.
# comment this out if it's in a standard place (e.g., /usr/local/lib).
LDADD+= -L/usr/local/devel/readline
a79 2

LDADD+= -lpq -lreadline -ltermcap
@


1.1
log
@Initial revision
@
text
@d4 1
a4 1
# $Id: Makefile,v 2.3 1992/08/13 11:47:33 schoenw Exp $
d7 3
d32 8
a43 1
CC=cc
d48 15
d64 1
a64 2
PGINC=$(POSTGRESTOP)/src/backend
INCLUDES=-I$(PGINC)
d66 1
a66 37
# let RLINC point to the include files of gnu readline.
# comment it out if they're in a standard place (e.g., /usr/include).
RLINC=/usr/local/devel
.if defined(RLINC)
INCLUDES+= -I$(RLINC)
.endif

PGLIB=$(POSTGRESTOP)/lib
LIBS=-L$(PGLIB)

# let RLINC point to the gnu readline library.
# comment it out if it's in a standard place (e.g., /usr/local/lib).
RLLIB=/usr/local/devel/readline
.if defined(RLLIB)
LIBS+= -L$(RLLIB)
.endif

spog: spog.o query.o command.o Makefile
	$(CC) -o spog $(CFLAGS) spog.o query.o command.o \
              $(LIBS) -lreadline -ltermcap -lpq

spog.o: spog.c spog.h
	$(CC) -c $(CFLAGS) $(INCLUDES) spog.c

command.o: command.c spog.h
	$(CC) -c $(CFLAGS) $(INCLUDES) command.c

query.o: query.c spog.h
	$(CC) -c $(CFLAGS) $(INCLUDES) query.c

install: spog spog.1
	cp spog $(POSTGRESTOP)/bin
	cp spog.1 $(POSTGRESTOP)/ref/man/man1
	cp pg_edit.sh $(POSTGRESTOP)/bin/pg_edit
	cp pg_edit.1 $(POSTGRESTOP)/ref/man/man1
	cp pg_info.sh $(POSTGRESTOP)/bin/pg_info
	cp pg_info.1 $(POSTGRESTOP)/ref/man/man1
d68 1
a68 2
clean:
	rm -f spog *.o
@
