2000-06-27 02:32:06 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile for src/bin/psql
|
|
|
|
#
|
2002-06-20 22:29:54 +02:00
|
|
|
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
2001-02-18 19:34:02 +01:00
|
|
|
# Portions Copyright (c) 1994, Regents of the University of California
|
2000-06-27 02:32:06 +02:00
|
|
|
#
|
2003-06-07 00:17:42 +02:00
|
|
|
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.36 2003/06/06 22:17:42 momjian Exp $
|
2000-06-27 02:32:06 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
subdir = src/bin/psql
|
|
|
|
top_builddir = ../../..
|
2000-08-31 18:12:35 +02:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref
|
|
|
|
|
2003-06-07 00:17:42 +02:00
|
|
|
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -DFRONTEND
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2002-07-15 23:34:05 +02:00
|
|
|
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 \
|
2002-07-27 22:10:05 +02:00
|
|
|
sprompt.o tab-complete.o mbprint.o
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2002-07-27 22:10:05 +02:00
|
|
|
all: submake-libpq submake-libpgport psql
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2000-11-30 21:36:13 +01:00
|
|
|
psql: $(OBJS) $(libpq_builddir)/libpq.a
|
2001-02-20 20:20:30 +01:00
|
|
|
$(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
help.o: $(srcdir)/sql_help.h
|
|
|
|
|
|
|
|
ifdef PERL
|
|
|
|
$(srcdir)/sql_help.h: create_help.pl $(wildcard $(REFDOCDIR)/*.sgml)
|
|
|
|
$(PERL) $< $(REFDOCDIR) $@
|
|
|
|
else
|
|
|
|
$(srcdir)/sql_help.h:
|
|
|
|
@echo "*** Perl is needed to build psql help."
|
|
|
|
endif
|
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
distprep: $(srcdir)/sql_help.h
|
|
|
|
|
2000-06-27 02:32:06 +02:00
|
|
|
install: all installdirs
|
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.
2000-09-17 15:02:52 +02:00
|
|
|
$(INSTALL_PROGRAM) psql$(X) $(DESTDIR)$(bindir)/psql$(X)
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
installdirs:
|
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.
2000-09-17 15:02:52 +02:00
|
|
|
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
uninstall:
|
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.
2000-09-17 15:02:52 +02:00
|
|
|
rm -f $(DESTDIR)$(bindir)/psql$(X)
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
clean distclean:
|
|
|
|
rm -f psql$(X) $(OBJS)
|
|
|
|
|
|
|
|
maintainer-clean: distclean
|
2000-10-20 23:04:27 +02:00
|
|
|
rm -f $(srcdir)/sql_help.h
|