1 #-------------------------------------------------------------------------
3 # Makefile for src/bin/pg_dump
5 # Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
6 # Portions Copyright (c) 1994, Regents of the University of California
8 # src/bin/pg_dump/Makefile
10 #-------------------------------------------------------------------------
12 PGFILEDESC
= "pg_dump/pg_restore/pg_dumpall - backup and restore PostgreSQL databases"
15 subdir
= src
/bin
/pg_dump
16 top_builddir
= ..
/..
/..
17 include $(top_builddir
)/src
/Makefile.global
19 export GZIP_PROGRAM
=$(GZIP
)
24 override CPPFLAGS
:= -I
$(libpq_srcdir
) $(CPPFLAGS
)
25 LDFLAGS_INTERNAL
+= -L
$(top_builddir
)/src
/fe_utils
-lpgfeutils
$(libpq_pgport
)
36 pg_backup_archiver.o \
39 pg_backup_directory.o \
44 all: pg_dump pg_restore pg_dumpall
46 pg_dump
: pg_dump.o common.o pg_dump_sort.o
$(OBJS
) | submake-libpq submake-libpgport submake-libpgfeutils
47 $(CC
) $(CFLAGS
) pg_dump.o common.o pg_dump_sort.o
$(OBJS
) $(LDFLAGS
) $(LDFLAGS_EX
) $(LIBS
) -o
$@
$(X
)
49 pg_restore
: pg_restore.o
$(OBJS
) | submake-libpq submake-libpgport submake-libpgfeutils
50 $(CC
) $(CFLAGS
) pg_restore.o
$(OBJS
) $(LDFLAGS
) $(LDFLAGS_EX
) $(LIBS
) -o
$@
$(X
)
52 pg_dumpall
: pg_dumpall.o dumputils.o
$(WIN32RES
) | submake-libpq submake-libpgport submake-libpgfeutils
53 $(CC
) $(CFLAGS
) pg_dumpall.o dumputils.o
$(WIN32RES
) $(LDFLAGS
) $(LDFLAGS_EX
) $(LIBS
) -o
$@
$(X
)
55 install: all installdirs
56 $(INSTALL_PROGRAM
) pg_dump
$(X
) '$(DESTDIR)$(bindir)'/pg_dump
$(X
)
57 $(INSTALL_PROGRAM
) pg_restore
$(X
) '$(DESTDIR)$(bindir)'/pg_restore
$(X
)
58 $(INSTALL_PROGRAM
) pg_dumpall
$(X
) '$(DESTDIR)$(bindir)'/pg_dumpall
$(X
)
61 $(MKDIR_P
) '$(DESTDIR)$(bindir)'
70 rm -f
$(addprefix '$(DESTDIR)$(bindir)'/, pg_dump
$(X
) pg_restore
$(X
) pg_dumpall
$(X
))
73 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