2000-06-27 02:32:06 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile for src/bin/pg_dump
|
|
|
|
#
|
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
|
|
|
#
|
2004-04-26 19:40:48 +02:00
|
|
|
# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.45 2004/04/26 17:40:48 momjian Exp $
|
2000-06-27 02:32:06 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
subdir = src/bin/pg_dump
|
|
|
|
top_builddir = ../../..
|
2000-08-31 18:12:35 +02:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2003-08-08 06:52:22 +02:00
|
|
|
OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o \
|
|
|
|
pg_backup_files.o pg_backup_null.o pg_backup_tar.o \
|
|
|
|
dumputils.o
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2002-08-18 11:36:26 +02:00
|
|
|
EXTRA_OBJS = $(top_builddir)/src/backend/parser/keywords.o
|
|
|
|
|
2002-08-27 20:57:26 +02:00
|
|
|
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -DBINDIR=\"$(bindir)\"
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2002-08-18 11:36:26 +02:00
|
|
|
|
|
|
|
all: submake-libpq submake-libpgport submake-backend pg_dump pg_restore pg_dumpall
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2003-12-06 04:00:16 +01:00
|
|
|
pg_dump: pg_dump.o common.o pg_dump_sort.o $(OBJS) $(libpq_builddir)/libpq.a
|
2004-04-26 19:40:48 +02:00
|
|
|
$(CC) $(CFLAGS) pg_dump.o common.o pg_dump_sort.o $(OBJS) $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2000-08-31 18:12:35 +02:00
|
|
|
pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a
|
2004-04-26 19:40:48 +02:00
|
|
|
$(CC) $(CFLAGS) pg_restore.o $(OBJS) $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
|
2000-07-03 18:35:39 +02:00
|
|
|
|
2004-02-07 08:20:12 +01:00
|
|
|
pg_dumpall: pg_dumpall.o dumputils.o $(libpq_builddir)/libpq.a
|
2004-04-26 19:40:48 +02:00
|
|
|
$(CC) $(CFLAGS) pg_dumpall.o dumputils.o $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
|
2000-07-04 21:52:00 +02:00
|
|
|
|
2002-08-18 11:36:26 +02:00
|
|
|
.PHONY: submake-backend
|
|
|
|
submake-backend:
|
2002-12-12 22:02:00 +01:00
|
|
|
$(MAKE) -C $(top_builddir)/src/backend/parser keywords.o
|
2002-08-18 11:36:26 +02:00
|
|
|
|
|
|
|
|
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) pg_dump$(X) $(DESTDIR)$(bindir)/pg_dump$(X)
|
|
|
|
$(INSTALL_PROGRAM) pg_restore$(X) $(DESTDIR)$(bindir)/pg_restore$(X)
|
2002-08-27 20:57:26 +02:00
|
|
|
$(INSTALL_PROGRAM) pg_dumpall$(X) $(DESTDIR)$(bindir)/pg_dumpall$(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:
|
2002-08-27 20:57:26 +02:00
|
|
|
rm -f $(addprefix $(DESTDIR)$(bindir)/, pg_dump$(X) pg_restore$(X) pg_dumpall$(X))
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
clean distclean maintainer-clean:
|
2003-12-06 04:00:16 +01:00
|
|
|
rm -f pg_dump$(X) pg_restore$(X) pg_dumpall$(X) $(OBJS) pg_dump.o common.o pg_dump_sort.o pg_restore.o pg_dumpall.o
|
2003-12-23 22:56:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
# ensure that changes in bindir etc. propagate into object file
|
|
|
|
pg_dumpall.o: pg_dumpall.c $(top_builddir)/src/Makefile.global
|