Debian Codegraph @

src/bin/pg_basebackup/Makefile

raw
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for src/bin/pg_basebackup
4 #
5 # Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
6 # Portions Copyright (c) 1994, Regents of the University of California
7 #
8 # src/bin/pg_basebackup/Makefile
9 #
10 #-------------------------------------------------------------------------
11
12 PGFILEDESC = "pg_basebackup/pg_receivewal/pg_recvlogical - streaming WAL and backup receivers"
13 PGAPPICON=win32
14
15 EXTRA_INSTALL=contrib/test_decoding
16
17 subdir = src/bin/pg_basebackup
18 top_builddir = ../../..
19 include $(top_builddir)/src/Makefile.global
20
21 # make these available to TAP test scripts
22 export LZ4
23 export TAR
24 # Note that GZIP cannot be used directly as this environment variable is
25 # used by the command "gzip" to pass down options, so stick with a different
26 # name.
27 export GZIP_PROGRAM=$(GZIP)
28
29 override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
30 LDFLAGS_INTERNAL += -L$(top_builddir)/src/fe_utils -lpgfeutils $(libpq_pgport)
31
32 OBJS = \
33 $(WIN32RES) \
34 receivelog.o \
35 streamutil.o \
36 walmethods.o
37
38 BBOBJS = \
39 pg_basebackup.o \
40 astreamer_inject.o
41
42 all: pg_basebackup pg_createsubscriber pg_receivewal pg_recvlogical
43
44 pg_basebackup: $(BBOBJS) $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
45 $(CC) $(CFLAGS) $(BBOBJS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
46
47 pg_createsubscriber: pg_createsubscriber.o $(WIN32RES) | submake-libpq submake-libpgport submake-libpgfeutils
48 $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
49
50 pg_receivewal: pg_receivewal.o $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
51 $(CC) $(CFLAGS) pg_receivewal.o $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
52
53 pg_recvlogical: pg_recvlogical.o $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
54 $(CC) $(CFLAGS) pg_recvlogical.o $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
55
56 install: all installdirs
57 $(INSTALL_PROGRAM) pg_basebackup$(X) '$(DESTDIR)$(bindir)/pg_basebackup$(X)'
58 $(INSTALL_PROGRAM) pg_createsubscriber$(X) '$(DESTDIR)$(bindir)/pg_createsubscriber$(X)'
59 $(INSTALL_PROGRAM) pg_receivewal$(X) '$(DESTDIR)$(bindir)/pg_receivewal$(X)'
60 $(INSTALL_PROGRAM) pg_recvlogical$(X) '$(DESTDIR)$(bindir)/pg_recvlogical$(X)'
61
62 installdirs:
63 $(MKDIR_P) '$(DESTDIR)$(bindir)'
64
65 uninstall:
66 rm -f '$(DESTDIR)$(bindir)/pg_basebackup$(X)'
67 rm -f '$(DESTDIR)$(bindir)/pg_createsubscriber$(X)'
68 rm -f '$(DESTDIR)$(bindir)/pg_receivewal$(X)'
69 rm -f '$(DESTDIR)$(bindir)/pg_recvlogical$(X)'
70
71 clean distclean:
72 rm -f pg_basebackup$(X) pg_createsubscriber$(X) pg_receivewal$(X) pg_recvlogical$(X) \
73 $(BBOBJS) pg_createsubscriber.o pg_receivewal.o pg_recvlogical.o \
74 $(OBJS)
75 rm -rf tmp_check
76
77 check:
78 $(prove_check)
79
80 installcheck:
81 $(prove_installcheck)