1 #-------------------------------------------------------------------------
3 # Makefile for src/bin/pg_dump
5 # Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
6 # Portions Copyright (c) 1994, Regents of the University of California
10 #-------------------------------------------------------------------------
12 PGFILEDESC
= "pg_dump/pg_restore/pg_dumpall - backup and restore PostgreSQL databases"
13 subdir
= src
/bin
/pg_dump
14 top_builddir
= ..
/..
/..
15 include $(top_builddir
)/src
/Makefile.global
17 override CPPFLAGS
:= -I
$(libpq_srcdir
) $(CPPFLAGS
)
19 OBJS
= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o \
20 pg_backup_files.o pg_backup_null.o pg_backup_tar.o \
21 dumputils.o
$(WIN32RES
)
23 KEYWRDOBJS
= keywords.o kwlookup.o
25 kwlookup.c
: % : $(top_srcdir
)/src
/backend
/parser
/%
26 rm -f
$@
&& $(LN_S
) $< .
28 all: submake-libpq submake-libpgport pg_dump pg_restore pg_dumpall
30 pg_dump
: pg_dump.o common.o pg_dump_sort.o
$(OBJS
) $(KEYWRDOBJS
) $(libpq_builddir
)/libpq.a
31 $(CC
) $(CFLAGS
) pg_dump.o common.o pg_dump_sort.o
$(KEYWRDOBJS
) $(OBJS
) $(libpq_pgport
) $(LDFLAGS
) $(LIBS
) -o
$@
$(X
)
33 pg_restore
: pg_restore.o
$(OBJS
) $(KEYWRDOBJS
) $(libpq_builddir
)/libpq.a
34 $(CC
) $(CFLAGS
) pg_restore.o
$(KEYWRDOBJS
) $(OBJS
) $(libpq_pgport
) $(LDFLAGS
) $(LIBS
) -o
$@
$(X
)
36 pg_dumpall
: pg_dumpall.o dumputils.o
$(KEYWRDOBJS
) $(libpq_builddir
)/libpq.a
37 $(CC
) $(CFLAGS
) pg_dumpall.o dumputils.o
$(KEYWRDOBJS
) $(WIN32RES
) $(libpq_pgport
) $(LDFLAGS
) $(LIBS
) -o
$@
$(X
)
39 install: all installdirs
40 $(INSTALL_PROGRAM
) pg_dump
$(X
) '$(DESTDIR)$(bindir)'/pg_dump
$(X
)
41 $(INSTALL_PROGRAM
) pg_restore
$(X
) '$(DESTDIR)$(bindir)'/pg_restore
$(X
)
42 $(INSTALL_PROGRAM
) pg_dumpall
$(X
) '$(DESTDIR)$(bindir)'/pg_dumpall
$(X
)
45 $(mkinstalldirs
) '$(DESTDIR)$(bindir)'
48 rm -f
$(addprefix '$(DESTDIR)$(bindir)'/, pg_dump
$(X
) pg_restore
$(X
) pg_dumpall
$(X
))
50 clean distclean maintainer-clean
:
51 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 kwlookup.c
$(KEYWRDOBJS
)