head	1.70;
access;
symbols
	REL9_0_0:1.70
	REL9_1_ALPHA1:1.70
	REL9_0_RC1:1.70
	REL9_0_BETA4:1.70
	REL9_0_STABLE:1.70.0.2
	REL9_0_BETA3:1.70
	REL9_0_BETA2:1.69
	REL7_4_29:1.37
	REL8_0_25:1.52.4.2
	REL8_1_21:1.54.2.1
	REL8_2_17:1.57.2.1
	REL8_3_11:1.60.2.1
	REL8_4_4:1.63.2.1
	REL9_0_BETA1:1.68
	REL9_0_ALPHA5_BRANCH:1.68.0.4
	REL9_0_ALPHA5:1.68
	REL7_4_28:1.37
	REL8_0_24:1.52.4.2
	REL8_1_20:1.54.2.1
	REL8_2_16:1.57.2.1
	REL8_3_10:1.60.2.1
	REL8_4_3:1.63.2.1
	REL9_0_ALPHA4:1.68
	REL9_0_ALPHA4_BRANCH:1.68.0.2
	REL8_5_ALPHA3:1.67
	REL8_5_ALPHA3_BRANCH:1.67.0.2
	REL7_4_27:1.37
	REL8_0_23:1.52.4.2
	REL8_1_19:1.54.2.1
	REL8_2_15:1.57.2.1
	REL8_3_9:1.60.2.1
	REL8_4_2:1.63.2.1
	REL8_5_ALPHA2:1.66
	REL8_5_ALPHA2_BRANCH:1.66.0.2
	REL7_4_26:1.37
	REL8_0_22:1.52.4.1
	REL8_1_18:1.54
	REL8_2_14:1.57
	REL8_3_8:1.60
	REL8_4_1:1.63
	REL8_5_ALPHA1:1.63
	REL8_5_ALPHA1_BRANCH:1.63.0.4
	REL8_4_STABLE:1.63.0.2
	REL8_4_0:1.63
	REL8_4_RC2:1.62
	REL8_4_RC1:1.62
	REL8_4_BETA2:1.62
	REL8_4_BETA1:1.62
	REL7_4_25:1.37
	REL8_0_21:1.52.4.1
	REL8_1_17:1.54
	REL8_2_13:1.57
	REL8_3_7:1.60
	REL7_4_24:1.37
	REL8_0_20:1.52.4.1
	REL8_1_16:1.54
	REL8_2_12:1.57
	REL8_3_6:1.60
	REL7_4_23:1.37
	REL8_0_19:1.52.4.1
	REL8_1_15:1.54
	REL8_2_11:1.57
	REL8_3_5:1.60
	REL7_4_22:1.37
	REL8_0_18:1.52.4.1
	REL8_1_14:1.54
	REL8_2_10:1.57
	REL8_3_4:1.60
	REL7_4_21:1.37
	REL8_0_17:1.52.4.1
	REL8_1_13:1.54
	REL8_2_9:1.57
	REL8_3_3:1.60
	REL7_4_20:1.37
	REL8_0_16:1.52.4.1
	REL8_1_12:1.54
	REL8_2_8:1.57
	REL8_3_2:1.60
	REL8_2_7:1.57
	REL8_3_1:1.60
	REL8_3_STABLE:1.60.0.2
	REL8_3_0:1.60
	REL8_3_RC2:1.60
	REL7_3_21:1.35
	REL7_4_19:1.37
	REL8_0_15:1.52.4.1
	REL8_1_11:1.54
	REL8_2_6:1.57
	REL8_3_RC1:1.60
	REL8_3_BETA4:1.59
	REL8_3_BETA3:1.59
	REL8_3_BETA2:1.59
	REL8_3_BETA1:1.59
	REL7_3_20:1.35
	REL7_4_18:1.37
	REL8_0_14:1.52.4.1
	REL8_1_10:1.54
	REL8_2_5:1.57
	REL7_3_19:1.35
	REL7_4_17:1.37
	REL8_0_13:1.52.4.1
	REL8_1_9:1.54
	REL8_2_4:1.57
	REL8_0_12:1.52.4.1
	REL8_1_8:1.54
	REL8_2_3:1.57
	REL7_3_18:1.35
	REL7_4_16:1.37
	REL8_0_11:1.52.4.1
	REL8_1_7:1.54
	REL8_2_2:1.57
	REL8_0_10:1.52.4.1
	REL8_1_6:1.54
	REL8_2_1:1.57
	REL7_4_15:1.37
	REL7_3_17:1.35
	REL8_2_STABLE:1.57.0.2
	REL8_2_0:1.57
	REL8_2_RC1:1.57
	REL8_2_BETA3:1.57
	REL8_2_BETA2:1.57
	REL8_1_5:1.54
	REL8_0_9:1.52.4.1
	REL7_4_14:1.37
	REL7_3_16:1.35
	REL8_2_BETA1:1.57
	REL7_3_15:1.35
	REL7_4_13:1.37
	REL8_0_8:1.52.4.1
	REL8_1_4:1.54
	REL7_3_14:1.35
	REL7_4_12:1.37
	REL8_0_7:1.52.4.1
	REL8_1_3:1.54
	REL7_3_13:1.35
	REL7_4_11:1.37
	REL8_0_6:1.52.4.1
	REL8_1_2:1.54
	REL7_3_12:1.35
	REL7_4_10:1.37
	REL8_0_5:1.52.4.1
	REL8_1_1:1.54
	REL8_1_STABLE:1.54.0.2
	REL8_1_0:1.54
	REL8_1_0RC1:1.54
	REL8_1_0BETA4:1.54
	REL8_1_0BETA3:1.54
	REL7_3_11:1.35
	REL7_4_9:1.37
	REL8_0_4:1.52.4.1
	REL8_1_0BETA2:1.54
	REL8_1_0BETA1:1.54
	REL7_2_8:1.31
	REL7_3_10:1.35
	REL7_4_8:1.37
	REL8_0_3:1.52.4.1
	REL8_0_2:1.52.4.1
	REL7_2_7:1.31
	REL7_3_9:1.35
	REL7_4_7:1.37
	REL8_0_1:1.52
	REL8_0_STABLE:1.52.0.4
	REL8_0_0:1.52.0.2
	REL8_0_0RC5:1.52
	REL8_0_0RC4:1.52
	REL8_0_0RC3:1.51
	REL8_0_0RC2:1.51
	REL8_0_0RC1:1.51
	REL8_0_0BETA5:1.51
	REL8_0_0BETA4:1.51
	REL7_4_6:1.37
	REL7_3_8:1.35
	REL7_2_6:1.31
	REL8_0_0BETA3:1.47
	REL8_0_0BETA2:1.47
	REL7_2_5:1.31
	REL7_4_5:1.37
	REL7_3_7:1.35
	REL7_4_4:1.37
	REL8_0_0BETA1:1.47
	REL7_4_3:1.37
	REL7_4_2:1.37
	REL7_3_6:1.35
	REL7_4_1:1.37
	REL7_3_5:1.35
	REL7_4:1.37
	REL7_4_RC2:1.37
	REL7_4_STABLE:1.37.0.4
	REL7_4_RC1:1.37
	REL7_4_BETA5:1.37
	REL7_4_BETA4:1.37
	REL7_4_BETA3:1.37
	REL7_4_BETA2:1.37
	WIN32_DEV:1.37.0.2
	REL7_4_BETA1:1.36
	REL7_3_4:1.35
	REL7_3_2:1.35
	REL7_2_4:1.31
	REL7_3_STABLE:1.35.0.2
	REL7_2_3:1.31
	REL7_2_STABLE:1.31.0.2
	REL7_2:1.31
	REL7_2_RC2:1.31
	REL7_2_RC1:1.31
	REL7_2_BETA5:1.31
	REL7_2_BETA4:1.31
	REL7_2_BETA3:1.31
	REL7_2_BETA2:1.31
	REL7_2_BETA1:1.31
	REL7_1_2:1.30
	REL7_1_STABLE:1.30.0.2
	REL7_1_BETA:1.27
	REL7_1_BETA3:1.27
	REL7_1_BETA2:1.27
	REL7_1:1.30
	REL2_0B:1.16.0.2
	REL2_0:1.16
	Release_2_0_0:1.4
	Release_1_0_3:1.4.0.2
	Release_2_0:1.4
	Release_1_0_2:1.4
	PG95-1_01:1.1.1.1
	PG95_DIST:1.1.1;
locks; strict;
comment	@# @;


1.70
date	2010.07.05.18.54.38;	author tgl;	state Exp;
branches;
next	1.69;

1.69
date	2010.05.12.11.33.10;	author momjian;	state Exp;
branches;
next	1.68;

1.68
date	2010.01.02.16.57.59;	author momjian;	state Exp;
branches;
next	1.67;

1.67
date	2009.11.10.23.12.13;	author tgl;	state Exp;
branches;
next	1.66;

1.66
date	2009.09.18.05.00.42;	author petere;	state Exp;
branches;
next	1.65;

1.65
date	2009.08.28.20.26.19;	author petere;	state Exp;
branches;
next	1.64;

1.64
date	2009.08.26.22.24.43;	author petere;	state Exp;
branches;
next	1.63;

1.63
date	2009.06.23.03.46.00;	author tgl;	state Exp;
branches
	1.63.2.1;
next	1.62;

1.62
date	2009.03.07.00.13.58;	author alvherre;	state Exp;
branches;
next	1.61;

1.61
date	2009.01.01.17.23.54;	author momjian;	state Exp;
branches;
next	1.60;

1.60
date	2008.01.01.19.45.55;	author momjian;	state Exp;
branches
	1.60.2.1;
next	1.59;

1.59
date	2007.09.27.19.53.43;	author tgl;	state Exp;
branches;
next	1.58;

1.58
date	2007.01.05.22.19.48;	author momjian;	state Exp;
branches;
next	1.57;

1.57
date	2006.03.05.15.58.51;	author momjian;	state Exp;
branches
	1.57.2.1;
next	1.56;

1.56
date	2005.12.18.02.17.16;	author petere;	state Exp;
branches;
next	1.55;

1.55
date	2005.12.09.21.19.35;	author petere;	state Exp;
branches;
next	1.54;

1.54
date	2005.05.24.16.45.23;	author tgl;	state Exp;
branches
	1.54.2.1;
next	1.53;

1.53
date	2005.03.25.18.17.13;	author momjian;	state Exp;
branches;
next	1.52;

1.52
date	2005.01.01.20.44.25;	author tgl;	state Exp;
branches
	1.52.4.1;
next	1.51;

1.51
date	2004.10.05.19.30.24;	author momjian;	state Exp;
branches;
next	1.50;

1.50
date	2004.10.04.20.36.10;	author momjian;	state Exp;
branches;
next	1.49;

1.49
date	2004.10.04.18.05.55;	author momjian;	state Exp;
branches;
next	1.48;

1.48
date	2004.10.04.13.43.57;	author momjian;	state Exp;
branches;
next	1.47;

1.47
date	2004.05.24.01.01.37;	author momjian;	state Exp;
branches;
next	1.46;

1.46
date	2004.05.19.17.15.21;	author momjian;	state Exp;
branches;
next	1.45;

1.45
date	2004.05.18.20.18.58;	author momjian;	state Exp;
branches;
next	1.44;

1.44
date	2004.05.17.14.35.33;	author momjian;	state Exp;
branches;
next	1.43;

1.43
date	2004.04.26.17.40.48;	author momjian;	state Exp;
branches;
next	1.42;

1.42
date	2004.04.22.14.33.45;	author momjian;	state Exp;
branches;
next	1.41;

1.41
date	2004.04.22.01.53.37;	author momjian;	state Exp;
branches;
next	1.40;

1.40
date	2004.03.09.19.47.05;	author petere;	state Exp;
branches;
next	1.39;

1.39
date	2004.02.19.19.40.08;	author tgl;	state Exp;
branches;
next	1.38;

1.38
date	2003.11.29.19.52.06;	author pgsql;	state Exp;
branches;
next	1.37;

1.37
date	2003.08.08.04.52.21;	author momjian;	state Exp;
branches;
next	1.36;

1.36
date	2003.06.06.22.17.42;	author momjian;	state Exp;
branches;
next	1.35;

1.35
date	2002.07.27.20.10.05;	author petere;	state Exp;
branches;
next	1.34;

1.34
date	2002.07.15.21.34.05;	author momjian;	state Exp;
branches;
next	1.33;

1.33
date	2002.07.06.20.12.30;	author momjian;	state Exp;
branches;
next	1.32;

1.32
date	2002.06.20.20.29.42;	author momjian;	state Exp;
branches;
next	1.31;

1.31
date	2001.10.15.01.25.10;	author ishii;	state Exp;
branches;
next	1.30;

1.30
date	2001.02.27.08.13.27;	author ishii;	state Exp;
branches;
next	1.29;

1.29
date	2001.02.20.19.20.29;	author petere;	state Exp;
branches;
next	1.28;

1.28
date	2001.02.18.18.34.01;	author momjian;	state Exp;
branches;
next	1.27;

1.27
date	2000.11.30.20.36.12;	author petere;	state Exp;
branches;
next	1.26;

1.26
date	2000.10.20.21.04.01;	author petere;	state Exp;
branches;
next	1.25;

1.25
date	2000.09.17.13.02.43;	author petere;	state Exp;
branches;
next	1.24;

1.24
date	2000.08.31.16.11.23;	author petere;	state Exp;
branches;
next	1.23;

1.23
date	2000.07.19.16.29.56;	author petere;	state Exp;
branches;
next	1.22;

1.22
date	2000.06.28.18.29.31;	author petere;	state Exp;
branches;
next	1.21;

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

1.20
date	97.02.09.03.23.43;	author scrappy;	state dead;
branches;
next	1.19;

1.19
date	97.01.25.23.53.59;	author scrappy;	state Exp;
branches;
next	1.18;

1.18
date	97.01.25.22.51.26;	author scrappy;	state Exp;
branches;
next	1.17;

1.17
date	96.12.30.23.19.48;	author bryanh;	state Exp;
branches;
next	1.16;

1.16
date	96.12.04.03.06.16;	author bryanh;	state Exp;
branches;
next	1.15;

1.15
date	96.11.26.07.38.24;	author bryanh;	state Exp;
branches;
next	1.14;

1.14
date	96.11.26.03.19.54;	author bryanh;	state Exp;
branches;
next	1.13;

1.13
date	96.11.13.10.35.26;	author bryanh;	state Exp;
branches;
next	1.12;

1.12
date	96.11.12.06.11.52;	author bryanh;	state Exp;
branches;
next	1.11;

1.11
date	96.11.11.13.41.36;	author bryanh;	state Exp;
branches;
next	1.10;

1.10
date	96.11.09.06.24.39;	author momjian;	state Exp;
branches;
next	1.9;

1.9
date	96.11.08.06.01.27;	author momjian;	state Exp;
branches;
next	1.8;

1.8
date	96.11.02.09.53.15;	author bryanh;	state Exp;
branches;
next	1.7;

1.7
date	96.11.01.01.46.55;	author momjian;	state Exp;
branches;
next	1.6;

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

1.5
date	96.08.20.05.04.13;	author scrappy;	state Exp;
branches;
next	1.4;

1.4
date	96.07.25.20.01.51;	author scrappy;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	96.07.20.07.40.03;	author scrappy;	state Exp;
branches;
next	1.2;

1.2
date	96.07.19.06.53.40;	author scrappy;	state Exp;
branches;
next	1.1;

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

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

1.4.2.1
date	96.08.19.19.32.58;	author scrappy;	state Exp;
branches;
next	1.4.2.2;

1.4.2.2
date	96.08.19.19.36.01;	author scrappy;	state Exp;
branches;
next	1.4.2.3;

1.4.2.3
date	96.08.20.04.02.01;	author scrappy;	state Exp;
branches;
next	;

1.52.4.1
date	2005.03.25.18.18.40;	author momjian;	state Exp;
branches;
next	1.52.4.2;

1.52.4.2
date	2009.11.10.23.12.51;	author tgl;	state Exp;
branches;
next	;

1.54.2.1
date	2009.11.10.23.12.44;	author tgl;	state Exp;
branches;
next	;

1.57.2.1
date	2009.11.10.23.12.37;	author tgl;	state Exp;
branches;
next	;

1.60.2.1
date	2009.11.10.23.12.29;	author tgl;	state Exp;
branches;
next	;

1.63.2.1
date	2009.11.10.23.12.21;	author tgl;	state Exp;
branches;
next	;


desc
@@


1.70
log
@Split the LDFLAGS make variable into two parts: LDFLAGS is now used for
linking both executables and shared libraries, and we add on LDFLAGS_EX when
linking executables or LDFLAGS_SL when linking shared libraries.  This
provides a significantly cleaner way of dealing with link-time switches than
the former behavior.  Also, make sure that the various platform-specific
%.so: %.o rules incorporate LDFLAGS and LDFLAGS_SL; most of them missed that
before.  (I did not add these variables for the platforms that invoke $(LD)
directly, however.  It's not clear if we can do that safely, since for the
most part we assume these variables use CC command-line syntax.)

Per gripe from Aaron Swenson and subsequent investigation.
@
text
@#-------------------------------------------------------------------------
#
# Makefile for src/bin/psql
#
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.69 2010/05/12 11:33:10 momjian Exp $
#
#-------------------------------------------------------------------------

PGFILEDESC = "psql - the PostgreSQL interactive terminal"
PGAPPICON=win32

subdir = src/bin/psql
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global

REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref

override CPPFLAGS := -I. -I$(srcdir) -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/pg_dump $(CPPFLAGS)

OBJS=	command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
	startup.o prompt.o variables.o large_obj.o print.o describe.o \
	tab-complete.o mbprint.o dumputils.o keywords.o kwlookup.o \
	sql_help.o \
	$(WIN32RES)

FLEXFLAGS = -Cfe


all: submake-libpq submake-libpgport psql

psql: $(OBJS) $(libpq_builddir)/libpq.a
	$(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@@$(X)

help.o: sql_help.h

dumputils.c keywords.c: % : $(top_srcdir)/src/bin/pg_dump/%
	rm -f $@@ && $(LN_S) $< .

kwlookup.c: % : $(top_srcdir)/src/backend/parser/%
	rm -f $@@ && $(LN_S) $< .

sql_help.c: sql_help.h ;
sql_help.h: create_help.pl $(wildcard $(REFDOCDIR)/*.sgml)
	$(PERL) $< $(REFDOCDIR) $*

# psqlscan is compiled as part of mainloop
mainloop.o: psqlscan.c

psqlscan.c: psqlscan.l
ifdef FLEX
	$(FLEX) $(FLEXFLAGS) -o'$@@' $<
else
	@@$(missing) flex $< $@@
endif

distprep: sql_help.h psqlscan.c

install: all installdirs
	$(INSTALL_PROGRAM) psql$(X) '$(DESTDIR)$(bindir)/psql$(X)'
	$(INSTALL_DATA) $(srcdir)/psqlrc.sample '$(DESTDIR)$(datadir)/psqlrc.sample'

installdirs:
	$(MKDIR_P) '$(DESTDIR)$(bindir)'

uninstall:
	rm -f '$(DESTDIR)$(bindir)/psql$(X)' '$(DESTDIR)$(datadir)/psqlrc.sample'

# psqlscan.c is in the distribution tarball, so is not cleaned here
clean distclean:
	rm -f psql$(X) $(OBJS) dumputils.c keywords.c kwlookup.c

maintainer-clean: distclean
	rm -f sql_help.h sql_help.c psqlscan.c
@


1.69
log
@Add PGFILEDESC description to Makefiles for all /contrib executables.

Add PGAPPICON to all executable makefiles.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.68 2010/01/02 16:57:59 momjian Exp $
d35 1
a35 1
	$(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@@$(X)
@


1.68
log
@Update copyright for the year 2010.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.67 2009/11/10 23:12:13 tgl Exp $
d14 1
@


1.67
log
@Do not build psql's flex module on its own, but instead include it in
mainloop.c.  This ensures that postgres_fe.h is read before including
any system headers, which is necessary to avoid problems on some platforms
where we make nondefault selections of feature macros for stdio.h or
other headers.  We have had this policy for flex modules in the backend
for many years, but for some reason it was not applied to psql.
Per trouble report from Alexandra Roy and diagnosis by Albe Laurenz.
@
text
@d5 1
a5 1
# Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.66 2009/09/18 05:00:42 petere Exp $
@


1.66
log
@Easier to translate psql help

Instead of requiring translators to translate the entire SQL command
synopses, change create_help.pl to only require them to translate the
placeholders, and paste those into the synopsis using a printf mechanism.
Make some small updates to the markup to make it easier to parse.

Note: This causes msgmerge of gettext 0.17 to segfault.  You will need
the patch from https://savannah.gnu.org/bugs/?27474 to make it work.
msgmerge usually only runs on babel.postgresql.org, however.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.65 2009/08/28 20:26:19 petere Exp $
d24 1
a24 1
	psqlscan.o tab-complete.o mbprint.o dumputils.o keywords.o kwlookup.o \
d48 3
@


1.65
log
@Derived files that are shipped in the distribution used to be built in the
source directory even for out-of-tree builds.  They are now alsl built in
the build tree.  This should be more convenient for certain developers'
workflows, and shouldn't really break anything else.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.64 2009/08/26 22:24:43 petere Exp $
d25 1
d44 1
d46 1
a46 1
	$(PERL) $< $(REFDOCDIR) $@@
d72 1
a72 1
	rm -f sql_help.h psqlscan.c
@


1.64
log
@Update of install-sh, mkinstalldirs, and associated configury

Update install-sh to that from Autoconf 2.63, plus our Darwin-specific
changes (which I simplified a bit).  install-sh is now able to install
multiple files in one run, so we could simplify our makefiles sometime.

install-sh also now has a -d option to create directories, so we don't need
mkinstalldirs anymore.

Use AC_PROG_MKDIR_P in configure.in, so we can use mkdir -p when available
instead of install-sh -d.  For consistency with the rest of the world,
the corresponding make variable has been renamed from $(mkinstalldirs) to
$(MKDIR_P).
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.63 2009/06/23 03:46:00 tgl Exp $
d20 1
a20 1
override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/pg_dump $(CPPFLAGS)
d35 1
a35 1
help.o: $(srcdir)/sql_help.h
d43 1
a43 1
$(srcdir)/sql_help.h: create_help.pl $(wildcard $(REFDOCDIR)/*.sgml)
d46 1
a46 1
$(srcdir)/psqlscan.c: psqlscan.l
d53 1
a53 1
distprep: $(srcdir)/sql_help.h $(srcdir)/psqlscan.c
d70 1
a70 1
	rm -f $(srcdir)/sql_help.h $(srcdir)/psqlscan.c
@


1.63
log
@Fix the makefiles to fail cleanly if Perl is needed but not present.  This
used to work as intended, but got broken some time ago (a quoted empty string
is not an empty string), and got broken some more by the changes to generate
ecpg's preproc.y automatically.  Given all the unprotected uses of $(PERL)
elsewhere, it seems best to make use of the $(missing) script rather than
trying to ensure each such use is protected individually.  Also fix various
bits of documentation that omitted to mention Perl as a requirement for
building from a CVS pull.  Per a complaint from Robert Haas.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.62 2009/03/07 00:13:58 alvherre Exp $
d60 1
a60 1
	$(mkinstalldirs) '$(DESTDIR)$(bindir)'
@


1.63.2.1
log
@Do not build psql's flex module on its own, but instead include it in
mainloop.c.  This ensures that postgres_fe.h is read before including
any system headers, which is necessary to avoid problems on some platforms
where we make nondefault selections of feature macros for stdio.h or
other headers.  We have had this policy for flex modules in the backend
for many years, but for some reason it was not applied to psql.
Per trouble report from Alexandra Roy and diagnosis by Albe Laurenz.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.63 2009/06/23 03:46:00 tgl Exp $
d24 1
a24 1
	tab-complete.o mbprint.o dumputils.o keywords.o kwlookup.o \
a45 3
# psqlscan is compiled as part of mainloop
mainloop.o: psqlscan.c

@


1.62
log
@Separate the key word list that lived in keywords.c into a new header file
kwlist.h, to avoid having to link the backend object file into other programs
like pg_dump.  We can now simply symlink a single source file from the backend
(kwlookup.c, containing the shared routine ScanKeywordLookup) and compile it
locally, which is a lot cleaner.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.61 2009/01/01 17:23:54 momjian Exp $
a42 1
ifdef PERL
a44 4
else
$(srcdir)/sql_help.h:
	@@echo "*** Perl is needed to build psql help."
endif
@


1.61
log
@Update copyright for 2009.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.60 2008/01/01 19:45:55 momjian Exp $
d24 2
a25 3
	psqlscan.o tab-complete.o mbprint.o dumputils.o $(WIN32RES)

EXTRA_OBJS = $(top_builddir)/src/backend/parser/keywords.o
d30 1
a30 1
all: submake-libpq submake-libpgport submake-backend psql
d33 1
a33 1
	$(CC) $(CFLAGS) $(OBJS) $(EXTRA_OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@@$(X)
d37 4
a40 1
dumputils.c: % : $(top_srcdir)/src/bin/pg_dump/%
a57 4
.PHONY: submake-backend
submake-backend:
	$(MAKE) -C $(top_builddir)/src/backend/parser keywords.o

d72 1
a72 1
	rm -f psql$(X) $(OBJS) dumputils.c
@


1.60
log
@Update copyrights in source tree to 2008.
@
text
@d5 1
a5 1
# Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.59 2007/09/27 19:53:43 tgl Exp $
@


1.60.2.1
log
@Do not build psql's flex module on its own, but instead include it in
mainloop.c.  This ensures that postgres_fe.h is read before including
any system headers, which is necessary to avoid problems on some platforms
where we make nondefault selections of feature macros for stdio.h or
other headers.  We have had this policy for flex modules in the backend
for many years, but for some reason it was not applied to psql.
Per trouble report from Alexandra Roy and diagnosis by Albe Laurenz.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.60 2008/01/01 19:45:55 momjian Exp $
d24 1
a24 1
	tab-complete.o mbprint.o dumputils.o $(WIN32RES)
a48 3
# psqlscan is compiled as part of mainloop
mainloop.o: psqlscan.c

@


1.59
log
@Define the FRONTEND symbol in postgres_fe.h, which allows us to eliminate
duplicative -DFRONTEND flags from many Makefiles.  We still need Makefile
control of the symbol in a few places that compile frontend-or-backend
src/port/ files, but it's a lot cleaner than before.

Hiroshi Saito
@
text
@d5 1
a5 1
# Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.58 2007/01/05 22:19:48 momjian Exp $
@


1.58
log
@Update CVS HEAD for 2007 copyright.  Back branches are typically not
back-stamped for this.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.57 2006/03/05 15:58:51 momjian Exp $
d20 1
a20 1
override CPPFLAGS := -DFRONTEND -I$(srcdir) -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/pg_dump $(CPPFLAGS)
@


1.57
log
@Update copyright for 2006.  Update scripts.
@
text
@d5 1
a5 1
# Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.56 2005/12/18 02:17:16 petere Exp $
@


1.57.2.1
log
@Do not build psql's flex module on its own, but instead include it in
mainloop.c.  This ensures that postgres_fe.h is read before including
any system headers, which is necessary to avoid problems on some platforms
where we make nondefault selections of feature macros for stdio.h or
other headers.  We have had this policy for flex modules in the backend
for many years, but for some reason it was not applied to psql.
Per trouble report from Alexandra Roy and diagnosis by Albe Laurenz.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.57 2006/03/05 15:58:51 momjian Exp $
d24 1
a24 1
	tab-complete.o mbprint.o dumputils.o $(WIN32RES)
a48 3
# psqlscan is compiled as part of mainloop
mainloop.o: psqlscan.c

@


1.56
log
@Add new psql command \password for changing role password with client-side
password encryption.  Also alter createuser command to the same effect.
@
text
@d5 1
a5 1
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.55 2005/12/09 21:19:35 petere Exp $
@


1.55
log
@Allow installation into directories containing spaces in the name.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.54 2005/05/24 16:45:23 tgl Exp $
d20 1
a20 1
override CPPFLAGS := -DFRONTEND -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
d24 3
a26 1
	psqlscan.o tab-complete.o mbprint.o $(WIN32RES)
d31 1
a31 1
all: submake-libpq submake-libpgport psql
d34 1
a34 1
	$(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@@$(X)
d38 3
d56 4
d74 1
a74 1
	rm -f psql$(X) $(OBJS)
@


1.54
log
@Add -I$(srcdir) to CPPFLAGS to make psqlscan.c compile in vpath builds.
Not sure why this hasn't been reported before; perhaps it is not needed
with newer gcc versions, but it definitely fails here.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.53 2005/03/25 18:17:13 momjian Exp $
d54 2
a55 2
	$(INSTALL_PROGRAM) psql$(X) $(DESTDIR)$(bindir)/psql$(X)
	$(INSTALL_DATA) $(srcdir)/psqlrc.sample $(DESTDIR)$(datadir)/psqlrc.sample
d58 1
a58 1
	$(mkinstalldirs) $(DESTDIR)$(bindir)
d61 1
a61 1
	rm -f $(DESTDIR)$(bindir)/psql$(X)
@


1.54.2.1
log
@Do not build psql's flex module on its own, but instead include it in
mainloop.c.  This ensures that postgres_fe.h is read before including
any system headers, which is necessary to avoid problems on some platforms
where we make nondefault selections of feature macros for stdio.h or
other headers.  We have had this policy for flex modules in the backend
for many years, but for some reason it was not applied to psql.
Per trouble report from Alexandra Roy and diagnosis by Albe Laurenz.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.54 2005/05/24 16:45:23 tgl Exp $
d24 1
a24 1
	tab-complete.o mbprint.o $(WIN32RES)
a43 3
# psqlscan is compiled as part of mainloop
mainloop.o: psqlscan.c

@


1.53
log
@Have libpgport link before libpq so that PG client applications are more
immunte to changes in libpq's usage of pgport between major versions.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.52 2005/01/01 20:44:25 tgl Exp $
d20 1
a20 1
override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
@


1.52
log
@Some more missed copyright notices.  Many of these look like they
should have been caught by the src/tools/copyright script ... why
weren't they?
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.51 2004/10/05 19:30:24 momjian Exp $
d32 1
a32 1
	$(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@@$(X)
@


1.52.4.1
log
@Have libpgport link before libpq so that PG client applications are more
immunte to changes in libpq's usage of pgport between major versions.

Backpatch to 8.0.X.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.52 2005/01/01 20:44:25 tgl Exp $
d32 1
a32 1
	$(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@@$(X)
@


1.52.4.2
log
@Do not build psql's flex module on its own, but instead include it in
mainloop.c.  This ensures that postgres_fe.h is read before including
any system headers, which is necessary to avoid problems on some platforms
where we make nondefault selections of feature macros for stdio.h or
other headers.  We have had this policy for flex modules in the backend
for many years, but for some reason it was not applied to psql.
Per trouble report from Alexandra Roy and diagnosis by Albe Laurenz.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.52.4.1 2005/03/25 18:18:40 momjian Exp $
d24 1
a24 1
	tab-complete.o mbprint.o $(WIN32RES)
a43 3
# psqlscan is compiled as part of mainloop
mainloop.o: psqlscan.c

@


1.51
log
@Add Win32 version info to client binaries.

Magnus Hagander
@
text
@d5 1
a5 1
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.50 2004/10/04 20:36:10 momjian Exp $
@


1.50
log
@Make sure no libs use libpgport by removing it from the link line.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.49 2004/10/04 18:05:55 momjian Exp $
d12 2
d24 1
a24 1
	psqlscan.o tab-complete.o mbprint.o
@


1.49
log
@Readd -DFRONTEND to client makefiles because it still affects win32.h
defines.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.48 2004/10/04 13:43:57 momjian Exp $
d18 1
a18 1
override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS) -DFRONTEND
@


1.48
log
@Make libpgport be front-end only and make libpgport_srv be a backend
library that uses palloc, ereport, etc.  This simplifies the makefiles
for client applications.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.47 2004/05/24 01:01:37 momjian Exp $
d18 1
a18 1
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -DFRONTEND
@


1.47
log
@Remove a few $filter() calls that were not needed.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.46 2004/05/19 17:15:21 momjian Exp $
d22 1
a22 1
	psqlscan.o tab-complete.o mbprint.o exec.o
a31 3
exec.c: % : $(top_srcdir)/src/port/%
	rm -f $@@ && $(LN_S) $< .

d63 1
a63 1
	rm -f psql$(X) $(OBJS) exec.c
@


1.46
log
@Re-add elog() to exec.c, per Tom.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.45 2004/05/18 20:18:58 momjian Exp $
d22 1
a22 2
	psqlscan.o tab-complete.o mbprint.o \
	$(filter exec.o, $(LIBOBJS))
@


1.45
log
@Move find_my_exec() way up into main.c so it is available to the
timezone code and other places.

Remove elog() calls from find_my_exec;  do fprintf(stderr) instead.  We
can then remove the exec.c handling in the makefile because it doesn't
have to be built to suppress elog calls.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.44 2004/05/17 14:35:33 momjian Exp $
d22 2
a23 1
	psqlscan.o tab-complete.o mbprint.o
d33 3
d67 1
a67 1
	rm -f psql$(X) $(OBJS)
@


1.44
log
@Reorganize code to allow path-relative installs.

Create new get_* functions to access compiled-in paths and adjust if
relative installs are to be used.

Clean up substitute_libpath_macro() code.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.43 2004/04/26 17:40:48 momjian Exp $
d22 1
a22 2
	psqlscan.o tab-complete.o mbprint.o \
	$(filter exec.o, $(LIBOBJS))
a31 3
exec.c: % : $(top_srcdir)/src/port/%
	rm -f $@@ && $(LN_S) $< .

d63 1
a63 1
	rm -f psql$(X) $(OBJS) exec.c
@


1.43
log
@Add $(X) for cross-compiling.  Seems the mingw compiler running on
FreeBSD doesn't add .EXE to links.

Michiel Ephraim
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.42 2004/04/22 14:33:45 momjian Exp $
d18 1
a18 1
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"'
d22 2
a23 1
	psqlscan.o tab-complete.o mbprint.o
d33 3
d67 1
a67 1
	rm -f psql$(X) $(OBJS)
@


1.42
log
@Fix filename mention in psqlrc.sample file.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.41 2004/04/22 01:53:37 momjian Exp $
d30 1
a30 1
	$(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@@
@


1.41
log
@Add global psql config file, psql.rc.sample.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.40 2004/03/09 19:47:05 petere Exp $
d53 1
a53 1
	$(INSTALL_DATA) $(srcdir)/psql.rc.sample $(DESTDIR)$(datadir)/psql.rc.sample
@


1.40
log
@Build scanner output when making a distribution.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.39 2004/02/19 19:40:08 tgl Exp $
d18 1
a18 1
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -DFRONTEND
d53 1
@


1.39
log
@Re-implement psql's input scanning to use a flex-generated lexer, as per
recent discussion.  The lexer is used for both SQL command text and
backslash commands.  The purpose of this change is to make it easier to
track the behavior of the backend's SQL lexer --- essentially identical
flex rules are now used by psql.  Also, this cleans up a lot of very
squirrelly code in mainloop.c and command.c.  The flex code is somewhat
bulkier than the removed code, but should be lots easier to maintain.
@
text
@d8 1
a8 1
# $PostgreSQL: pgsql-server/src/bin/psql/Makefile,v 1.38 2003/11/29 19:52:06 pgsql Exp $
d49 1
a49 1
distprep: $(srcdir)/sql_help.h
@


1.38
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d8 1
a8 1
# $PostgreSQL: /cvsroot/pgsql-server/src/bin/psql/Makefile,v 1.37 2003/08/08 04:52:21 momjian Exp $
d22 4
a25 1
	tab-complete.o mbprint.o
d42 7
d60 1
d65 1
a65 1
	rm -f $(srcdir)/sql_help.h
@


1.37
log
@Move simple_prompt()/sprompt.c into /port.
@
text
@d8 1
a8 1
# $Header: /cvsroot/pgsql-server/src/bin/psql/Makefile,v 1.36 2003/06/06 22:17:42 momjian Exp $
@


1.36
log
@Add -DFRONTEND for non-MinGW Win32 ports.
@
text
@d8 1
a8 1
# $Header: /cvsroot/pgsql-server/src/bin/psql/Makefile,v 1.35 2002/07/27 20:10:05 petere Exp $
d20 1
a20 1
OBJS=command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
d22 1
a22 1
	sprompt.o tab-complete.o mbprint.o
@


1.35
log
@Assemble portability modules into libpgport library.
Some makefile simplifications.
@
text
@d8 1
a8 1
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.34 2002/07/15 21:34:05 momjian Exp $
d18 1
a18 1
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
@


1.34
log
@Remove certain Makefile dependencies by using full pathnames in
configure.in.
@
text
@d8 1
a8 1
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.33 2002/07/06 20:12:30 momjian Exp $
d22 1
a22 2
	sprompt.o tab-complete.o mbprint.o $(SNPRINTF) $(STRDUP) \
	$(STRERROR) $(STRTOUL)
d24 1
a24 3
all: submake psql

# End of hacks for picking up backend 'port' modules
a38 5
.PHONY: submake

submake:
	$(MAKE) -C $(libpq_builddir) all

a49 3
depend dep:
	$(CC) -MM -MG $(CFLAGS) *.c >depend

a54 4

ifeq (depend,$(wildcard depend))
include depend
endif
@


1.33
log
@Move simple_prompt() into its own file to be shared with psql and pg_dump.
@
text
@d8 1
a8 1
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.32 2002/06/20 20:29:42 momjian Exp $
d20 4
a23 3
OBJS=command.o common.o help.o input.o stringutils.o mainloop.o \
	copy.o startup.o prompt.o variables.o large_obj.o print.o describe.o \
	sprompt.o tab-complete.o mbprint.o
a25 30

ifdef STRDUP
OBJS+=$(top_builddir)/src/utils/strdup.o

$(top_builddir)/src/utils/strdup.o:
	$(MAKE) -C $(top_builddir)/src/utils strdup.o
endif

# Move these to the utils directory?

ifdef STRERROR
OBJS+=$(top_builddir)/src/backend/port/strerror.o

$(top_builddir)/src/backend/port/strerror.o:
	$(MAKE) -C $(top_builddir)/src/backend/port strerror.o
endif

ifdef SNPRINTF
OBJS+=$(top_builddir)/src/backend/port/snprintf.o

$(top_builddir)/src/backend/port/snprintf.o:
	$(MAKE) -C $(top_builddir)/src/backend/port snprintf.o
endif

ifdef STRTOUL
OBJS+=$(top_builddir)/src/backend/port/strtoul.o

$(top_builddir)/src/backend/port/strtoul.o:
	$(MAKE) -C $(top_builddir)/src/backend/port strtoul.o
endif
@


1.32
log
@Update copyright to 2002.
@
text
@d8 1
a8 1
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.31 2001/10/15 01:25:10 ishii Exp $
d22 1
a22 1
	tab-complete.o mbprint.o
@


1.31
log
@Commit Patrice's patches except:

> - corrects a bit the UTF-8 code from Tatsuo to allow Unicode 3.1
>  characters (characters with values >= 0x10000, which are encoded on
>  four bytes).

Also, update mb/expected/unicode.out. This is necessary since the
patches affetc the result of queries using UTF-8.
---------------------------------------------------------------
Hi,

I should have sent the patch earlier, but got delayed by other stuff.
Anyway, here is the patch:

- most of the functionality is only activated when MULTIBYTE is
  defined,

- check valid UTF-8 characters, client-side only yet, and only on
  output, you still can send invalid UTF-8 to the server (so, it's
  only partly compliant to Unicode 3.1, but that's better than
  nothing).

- formats with the correct number of columns (that's why I made it in
  the first place after all), but only for UNICODE. However, the code
  allows to plug-in routines for other encodings, as Tatsuo did for
  the other multibyte functions.

- corrects a bit the UTF-8 code from Tatsuo to allow Unicode 3.1
  characters (characters with values >= 0x10000, which are encoded on
  four bytes).

- doesn't depend on the locale capabilities of the glibc (useful for
  remote telnet).

I would like somebody to check it closely, as it is my first patch to
pgsql.  Also, I created dummy .orig files, so that the two files I
created are included, I hope that's the right way.

Now, a lot of functionality is NOT included here, but I will keep that
for 7.3 :) That includes all string checking on the server side (which
will have to be a bit more optimised ;) ), and the input checking on
the client side for UTF-8, though that should not be difficult. It's
just to send the strings through mbvalidate() before sending them to
the server. Strong checking on UTF-8 strings is mandatory to be
compliant with Unicode 3.1+ .

Do I have time to look for a patch to include iso-8859-15 for 7.2 ?
The euro is coming 1. january 2002 (before 7.3 !) and over 280
millions people in Europe will need the euro sign and only iso-8859-15
and iso-8859-16 have it (and unfortunately, I don't think all Unices
will switch to Unicode in the meantime)....

err... yes, I know that this is not every single person in Europe that
uses PostgreSql, so it's not exactly 280m, but it's just a matter of
time ! ;)

I'll come back (on pgsql-hackers) later to ask a few questions
regarding the full unicode support (normalisation, collation,
regexes,...) on the server side :)

Here is the patch !

Patrice.

--
Patrice HD ------------------------------- patrice  islande org -----
  --  Isn't it weird  how scientists  can imagine  all the matter of the
universe exploding out of a dot smaller than the head of a pin, but they
can't come up with a more evocative name for it than "The Big Bang" ?
  -- What would _you_ call the creation of the universe ?
  -- "The HORRENDOUS SPACE KABLOOIE !"               - Calvin and Hobbes
------------------------------------------ http://www.islande.org/ -----
@
text
@d5 1
a5 1
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
d8 1
a8 1
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.30 2001/02/27 08:13:27 ishii Exp $
@


1.30
log
@Massive commits for SunOS4 port.
@
text
@d8 1
a8 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/psql/Makefile,v 1.29 2001/02/20 19:20:29 petere Exp $
d22 1
a22 1
	tab-complete.o
@


1.29
log
@Make sure -L and -I's for our source tree are always before system include
or library directories on the command line.
@
text
@d8 1
a8 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/psql/Makefile,v 1.28 2001/02/18 18:34:01 momjian Exp $
d47 7
@


1.28
log
@Add copyright mentions, per Tom Lane.
@
text
@d8 1
a8 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/psql/Makefile,v 1.27 2000/11/30 20:36:12 petere Exp $
d18 1
a18 1
override CPPFLAGS+= -I$(libpq_srcdir)
d52 1
a52 1
	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(libpq) $(LIBS) -o $@@
@


1.27
log
@Make all commands that link a program look like

$(CC) $(CFLAGS) $(LDFLAGS) <object files> <extra-libraries> $(LIBS) -o $@@

This form seemed to be the most portable, readable, and logical, but in any
case it's better than having a dozen different ones in the tree.
@
text
@d5 2
a6 1
# Copyright (c) 1994, Regents of the University of California
d8 1
a8 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/psql/Makefile,v 1.26 2000/10/20 21:04:01 petere Exp $
@


1.26
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/bin/psql/Makefile,v 1.25 2000/09/17 13:02:43 petere Exp $
d23 1
a23 1
all: submake psql$(X)
d50 2
a51 2
psql$(X): $(OBJS) $(libpq_builddir)/libpq.a
	$(CC) $(CFLAGS) -o $@@ $(OBJS) $(libpq) $(LDFLAGS)
@


1.25
log
@Support for DESTDIR make variable. This is used as in `make install
DESTDIR=/else/where' and prepends the value of DESTDIR to the full
installation paths (e.g., /else/where/usr/local/pgsql/bin). This allows
users to install the package into a location different from the one that
was configured and hard-coded into various scripts, e.g., for creating
binary packages.

DESTDIR is in many cases preferrable over `make install
prefix=/else/where' because

a) `prefix' affects the path that is hard-coded into the files, which can
lead to a `make install prefix=xxx' (as done by the regression test
driver) corrupting the files in the source tree with wrong paths.

b) it doesn't work at all if a directory was overridden to not depend on
`prefix', e.g., --sysconfdir=/etc.

(Updating the regression test driver to use DESTDIR is a separate
undertaking.)

See also autoconf@@gnu.org, From: Akim Demaille <akim@@epita.fr>, Date: 08
Sep 2000 12:48:59 +0200, Message-ID:
<mv4em2vb1lw.fsf@@nostromo.lrde.epita.fr>, Subject: Re: HTML format
documentation.
@
text
@d7 1
a7 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/psql/Makefile,v 1.24 2000/08/31 16:11:23 petere Exp $
d17 1
a17 1
CPPFLAGS+= -I$(libpq_srcdir)
d86 1
a86 1
	rm -f sql_help.h
@


1.24
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/bin/psql/Makefile,v 1.23 2000/07/19 16:29:56 petere Exp $
d71 1
a71 1
	$(INSTALL_PROGRAM) psql$(X) $(bindir)/psql$(X)
d74 1
a74 1
	$(mkinstalldirs) $(bindir)
d77 1
a77 1
	rm -f $(bindir)/psql$(X)
@


1.23
log
@Add distprep target to take some of the job of the release_prep script.
The latter updated accordingly. Also add `dist' and `distcheck' targets
to play with, but caveat packager.

Updated backend/bootstrap and backend/parser makefile to make them
marginally builddir aware and fix the usual set of things.

Add rule to automatically remake config.h dependent on config.h.in and
config.status. (Adopted from Autoconf manual and about every other
package.) On a good day we should now have a complete and accurate set
of dependencies throughout everything.
@
text
@d7 1
a7 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/psql/Makefile,v 1.22 2000/06/28 18:29:31 petere Exp $
d13 1
a13 1
include ../../Makefile.global
d17 1
a17 1
CFLAGS+= -I$(LIBPQDIR)
d50 2
a51 2
psql$(X): $(OBJS) $(LIBPQDIR)/libpq.a
	$(CC) $(CFLAGS) -o $@@ $(OBJS) $(LIBPQ) $(LDFLAGS)
d66 1
a66 1
	$(MAKE) -C $(LIBPQDIR) all
@


1.22
log
@Makefile cleanup for interface tree. Now essentially with all the
standard targets and behaviour. Replaced Makefile.in's with
Makefile's and declared the respective variables in Makefile.global.

maintainer-clean target now available at top level, although it does
not work in the backend tree yet.

Cleanup pass over Makefile.shlib, renamed some targets and variables.
The shared library symlink tests are now done by make, not the shell.

ecpg: Remove one warning in sloppy flex output.

PL/Perl and Perl interface: the MakeMaker documentation is confusing,
the realclean target *does* "delete derived files", but it also
uninstalls them. Don't use that.

The submake targets in the various bin directories that update libpq
should `make all', not `make libpq.a'. That is a) unportable, and
b) doesn't build the shared library.
@
text
@d7 1
a7 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/psql/Makefile,v 1.21 2000/06/27 00:31:41 petere Exp $
d67 2
@


1.21
log
@Makefile cleanup for bin and pl subtrees. They should now support
all the standard semantics. Also get rid of Makefile.in's on the
way and instead declare all variables in Makefile.global.
@
text
@d7 1
a7 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/psql/Makefile.in,v 1.26 2000/06/17 00:09:51 petere Exp $
d66 1
a66 1
	$(MAKE) -C $(LIBPQDIR) libpq.a
@


1.20
log
@Various fixes suggested by Gregor Hoffleit

Add a check to configure for strdup
Remove all the '-ltermcap' checks from psql/Makefile
Have {psql,pg_dump}/Makefile modified if strdup doesn't exist on the system
@
text
@d3 1
a3 2
# Makefile.inc--
#    Makefile for bin/psql
d7 1
a7 3
#
# IDENTIFICATION
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.19 1997/01/25 23:53:59 scrappy Exp scrappy $
d11 2
a12 1
SRCDIR= ../..
d15 24
a38 36
INCLUDE_OPT:= \
               -I$(LIBPQDIR) \
               -I../../include 

CFLAGS+= $(INCLUDE_OPT)

#USE_READLINE is set in Makefile.global
# 
ifeq ($(USE_READLINE), true)
   CFLAGS+= $(READLINE_INC) 

   LD_ADD+= $(READLINE_LIB) $(CURSES_LIB)

   ifeq ($(PORTNAME), ultrix4)
    LD_ADD+= -ltermcap
   else
     ifeq ($(PORTNAME), sparc)
       LD_ADD+= -ltermcap
     else
       ifeq ($(PORTNAME), linux)
         LD_ADD+= -ltermcap
       else
         ifeq ($(PORTNAME), next)
           LD_ADD+= -ltermcap
         else
           ifeq ($(PORTNAME), bsdi)
             LD_ADD+= -ltermcap
           else
             ifeq ($(PORTNAME), BSD44_derived)
               LD_ADD+= -ltermcap
             endif
           endif
         endif
       endif
     endif
   endif
d41 2
a42 1
OBJS= psql.o stringutils.o  
d44 2
a45 2
ifeq ($(PORTNAME), ultrix4)
OBJS+= ../../utils/strdup.o
d48 1
a48 1
all: submake psql
d50 2
a51 2
psql: $(OBJS) $(LIBPQDIR)/libpq.a
	$(CC) $(LDFLAGS) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LD_ADD)
d53 9
a61 2
../../utils/strdup.o:
	$(MAKE) -C ../../utils strdup.o
d64 1
d68 8
a75 2
install: psql
	$(INSTALL) $(INSTL_EXE_OPTS) psql $(DESTDIR)$(BINDIR)/psql
d78 1
a78 1
	$(CC) -MM $(INCLUDE_OPT) *.c >depend
d80 5
a84 2
clean: 
	rm -f psql $(OBJS) 
a88 3



@


1.19
log
@Remove rlstubs.[ch], since they weren't actually doing anything that couldn't
be #ifdef'd into psql.c itself

From what I can tell, if USE_READLINE is true or false, psql works under
FreeBSD, without configure.  Now to test it *again* under sparc_solaris
with configure and see if it works...
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.18 1997/01/25 22:51:26 scrappy Exp $
@


1.18
log
@Okay, this should pretty much clean up the psql/readline/history mess.

Added a README.readline file until configure is integrated to *try* and
explain the way things stand.

Removed a stray configure .in file
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.17 1996/12/30 23:19:48 bryanh Exp $
a52 3
   OBJS= psql.o stringutils.o  
else
   OBJS= psql.o stringutils.o  rlstubs.o
d54 2
@


1.17
log
@Put $(CURSES_LIB) in Makefile.global to replace similar thing in psql/Makefile.
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.14 1996/11/26 03:19:54 bryanh Exp $
d22 1
a22 1
#
a24 1

d26 1
a26 1
   CFLAGS+= $(READLINE_INC) $(HISTORY_INC)
d28 1
a28 1
   LD_ADD+= $(READLINE_LIB) $(HISTORY_LIB) $(CURSES_LIB)
d31 1
a31 13
   LD_ADD+= -ltermcap
   else
   ifeq ($(PORTNAME), sparc)
   LD_ADD+= -ltermcap
   else
   ifeq ($(PORTNAME), linux)
   LD_ADD+= -ltermcap
   else
   ifeq ($(PORTNAME), next)
   LD_ADD+= -ltermcap
   else
   ifeq ($(PORTNAME), bsdi)
   LD_ADD+= -ltermcap
d33 19
a51 7
   ifeq ($(PORTNAME), BSD44_derived)
   LD_ADD+= -ltermcap
   endif
   endif
   endif
   endif
   endif
d53 1
d55 1
a55 7
   CFLAGS+= -DNOREADLINE
endif

OBJS= psql.o stringutils.o 

ifneq ($(USE_READLINE), true)
OBJS+= rlstubs.o
@


1.16
log
@Change portname "sparc" to "sunos4" and change some portname dependencies to
feature dependencies.  Thanks Kurt J. Lidl.
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.15 1996/11/26 07:38:24 bryanh Exp $
d29 1
a29 2
   LIBCURSES=	-lcurses 
   LD_ADD+= $(READLINE_LIB) $(HISTORY_LIB) $(LIBCURSES)
d34 1
a34 1
   ifeq ($(PORTNAME), sunos4)
@


1.15
log
@Whoops, redo Ultrix patch so the other ports still compile.
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.14 1996/11/26 03:19:54 bryanh Exp $
d35 1
a35 1
   ifeq ($(PORTNAME), sparc)
@


1.14
log
@Make it compile on Ultrix.  Thanks Erik Bertelson.
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.13 1996/11/13 10:35:26 bryanh Exp $
d19 1
a19 2
               -I../../include \
               -I../../backend/port/$(PORTNAME)
d65 4
d73 3
@


1.13
log
@Eliminate MKDIR, srcdir, objdir.  Centralize setting of LIBPQDIR.
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.10 1996/11/09 06:24:39 momjian Exp $
d19 2
a20 1
               -I../../include
@


1.12
log
@Add dependency for install.
@
text
@d14 1
a14 2
SRCDIR = ../..
LIBPQDIR = $(SRCDIR)/libpq
d17 1
a17 1
INCLUDE_OPT := \
d19 1
a19 1
               -I$(SRCDIR)/include
d21 1
a21 1
CFLAGS += $(INCLUDE_OPT)
d27 1
a27 1
   CFLAGS += $(READLINE_INC) $(HISTORY_INC)
d30 1
a30 1
   LD_ADD += $(READLINE_LIB) $(HISTORY_LIB) $(LIBCURSES)
d33 1
a33 1
   LD_ADD += -ltermcap
d36 1
a36 1
   LD_ADD += -ltermcap
d39 1
a39 1
   LD_ADD += -ltermcap
d42 1
a42 1
   LD_ADD += -ltermcap
d45 1
a45 1
   LD_ADD += -ltermcap
d48 1
a48 1
   LD_ADD += -ltermcap
d56 1
a56 1
   CFLAGS += -DNOREADLINE
@


1.11
log
@Makefile simplification: the "bin" chapter
@
text
@d75 1
a75 1
install:
@


1.10
log
@Makefile cleanup after reorganization
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.9 1996/11/08 06:01:27 momjian Exp $
d66 1
a66 1
all: psql
d71 2
a72 1
$(srcdir)/libpq/libpq.a:
@


1.9
log
@Compile and warning cleanup
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.8 1996/11/02 09:53:15 bryanh Exp $
d68 2
a69 2
psql: $(OBJS) $(LIBPQDIR)/obj/libpq.a
	$(CC) $(LDFLAGS) -o psql -L$(LIBPQDIR)/obj $(OBJS) -lpq $(LD_ADD)
d71 1
a71 1
$(srcdir)/libpq/obj/libpq.a:
@


1.8
log
@Continuation of make file simplification; handle libpq.a dependancy.
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.7 1996/11/01 01:46:55 momjian Exp $
d68 2
a69 2
psql: $(OBJS) $(LIBPQDIR)/libpq.a
	$(CC) $(LDFLAGS) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LD_ADD)
d71 1
a71 1
$(srcdir)/libpq/libpq.a:
@


1.7
log
@Removal of bsdi_2_1 port.
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.6 1996/08/21 04:06:01 scrappy Exp $
d14 7
a20 5
PROG= psql

MKDIR=	../../mk
include $(MKDIR)/postgres.mk
include ../Makefile.global
d22 1
a29 5
# if you are using an older readline that uses #include "readline.h" instead
# of #include <readline/readline.h>,
# uncomment this
# CFLAGS += -DOLD_READLINE

d60 1
a60 1
SRCS= psql.c stringutils.c 
d63 1
a63 1
SRCS+= rlstubs.c
d66 7
a72 1
include $(MKDIR)/postgres.prog.mk
d74 12
@


1.6
log
@BSD$$_derived needs -ltermcap for psql
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.5 1996/08/20 05:04:13 scrappy Exp $
a49 3
   ifeq ($(PORTNAME), bsdi_2_1)
   LD_ADD += -ltermcap
   else
a51 1
   endif
@


1.5
log
@Bring in changes to READLINE/HISTORY defines
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.4 1996/07/25 20:01:51 scrappy Exp $
d52 4
@


1.4
log
@fixed usuage of -ltermcap for psql

submitted by: Bruce Momjian <maillist@@candle.pha.pa.us>
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.3 1996/07/20 07:40:03 scrappy Exp $
d25 1
a25 1
   CFLAGS += -I$(READLINE_INCDIR) -I$(HISTORY_INCDIR)
d33 1
a33 3
   LD_ADD += -L$(READLINE_LIBDIR) -L$(HISTORY_LIBDIR) -lreadline -lhistory $(LIBCURSES)
# use the following if your readline has no separate history lib
#   LD_ADD += -L$(READLINE_LIBDIR) -lreadline $(LIBCURSES)
@


1.4.2.1
log
@FreeBSD has libreadline,but not libhistory...

Change Makefile so that it can be commented out in Makefile.global
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.4 1996/07/25 20:01:51 scrappy Exp $
d33 1
a33 1
   LD_ADD += -L$(READLINE_LIB) -L$(HISTORY_LIB) $(LIBCURSES)
@


1.4.2.2
log
@BSD44_derived required -ltermcap as well...
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.4.2.1 1996/08/19 19:32:58 scrappy Exp $
a53 4
   else
   ifeq ($(PORTNAME), BSD44_derived)
   LD_ADD += -ltermcap
   endif
@


1.4.2.3
log
@Furthre cleanup of -lreadline/-lhistory
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.4.2.2 1996/08/19 19:36:01 scrappy Exp $
d25 1
a25 1
   CFLAGS += $(READLINE_INCDIR) $(HISTORY_INCDIR)
d33 3
a35 1
   LD_ADD += $(READLINE_LIB) $(HISTORY_LIB) $(LIBCURSES)
@


1.3
log
@- extend conditional for use of -ltermcap in bsdi/bsdi_2_1 compiles

- submitted by: Bruce Momjian (root@@candle.pha.pa.us)
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.2 1996/07/19 06:53:40 scrappy Exp $
d45 1
a45 1
   endif
d48 1
d51 1
d54 1
@


1.2
log
@- added -ltermcap to LIBS in bin/psql/Makefile

- submitted by: Bruce Momjian (root@@candle.pha.pa.us)
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/src/bin/psql/Makefile,v 1.1.1.1 1996/07/09 06:22:15 scrappy Exp $
d32 1
a32 1
   LIBCURSES=	-lcurses -ltermcap
d48 6
@


1.1
log
@Initial revision
@
text
@d10 1
a10 1
#    $Header: /usr/local/cvsroot/postgres95/postgres95/src/bin/psql/Makefile,v 1.1.1.1 1996/07/09 05:32:37 scrappy Exp $
d32 1
a32 1
   LIBCURSES=	-lcurses
@


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