2000-06-27 02:32:06 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile for src/bin/psql
|
|
|
|
#
|
2001-02-18 19:34:02 +01:00
|
|
|
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
|
|
|
# Portions Copyright (c) 1994, Regents of the University of California
|
2000-06-27 02:32:06 +02:00
|
|
|
#
|
2001-02-18 19:34:02 +01:00
|
|
|
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.28 2001/02/18 18:34:01 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
|
|
|
|
|
2000-10-20 23:04:27 +02:00
|
|
|
override CPPFLAGS+= -I$(libpq_srcdir)
|
2000-06-27 02:32:06 +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 \
|
|
|
|
tab-complete.o
|
|
|
|
|
2000-11-30 21:36:13 +01:00
|
|
|
all: submake psql
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
# End of hacks for picking up backend 'port' modules
|
|
|
|
|
2000-11-30 21:36:13 +01:00
|
|
|
psql: $(OBJS) $(libpq_builddir)/libpq.a
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(libpq) $(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
|
|
|
|
|
|
|
|
.PHONY: submake
|
|
|
|
|
|
|
|
submake:
|
2000-08-31 18:12:35 +02:00
|
|
|
$(MAKE) -C $(libpq_builddir) all
|
2000-06-27 02:32:06 +02:00
|
|
|
|
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
|
|
|
|
|
|
|
depend dep:
|
|
|
|
$(CC) -MM -MG $(CFLAGS) *.c >depend
|
|
|
|
|
|
|
|
clean distclean:
|
|
|
|
rm -f psql$(X) $(OBJS)
|
|
|
|
|
|
|
|
maintainer-clean: distclean
|
2000-10-20 23:04:27 +02:00
|
|
|
rm -f $(srcdir)/sql_help.h
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
ifeq (depend,$(wildcard depend))
|
|
|
|
include depend
|
|
|
|
endif
|