1 #-------------------------------------------------------------------------
3 # Makefile for src/bin/pg_ctl
5 # Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
6 # Portions Copyright (c) 1994, Regents of the University of California
8 # src/bin/pg_ctl/Makefile
10 #-------------------------------------------------------------------------
12 PGFILEDESC
= "pg_ctl - starts/stops/restarts the PostgreSQL server"
15 subdir
= src
/bin
/pg_ctl
16 top_builddir
= ..
/..
/..
17 include $(top_builddir
)/src
/Makefile.global
19 # On Windows, we need to link with libpq, just for use of pqexpbuffer;
20 # but let's not pull that in on platforms where we don't need it.
21 ifeq ($(PORTNAME
), win32
)
22 override CPPFLAGS
:= -I
$(libpq_srcdir
) $(CPPFLAGS
)
23 LDFLAGS_INTERNAL
+= $(libpq_pgport
)
24 SUBMAKE_LIBPQ
:= submake-libpq
33 pg_ctl
: $(OBJS
) | submake-libpgport
$(SUBMAKE_LIBPQ
)
34 $(CC
) $(CFLAGS
) $(OBJS
) $(LDFLAGS
) $(LDFLAGS_EX
) $(LIBS
) -o
$@
$(X
)
36 install: all installdirs
37 $(INSTALL_PROGRAM
) pg_ctl
$(X
) '$(DESTDIR)$(bindir)/pg_ctl$(X)'
40 $(MKDIR_P
) '$(DESTDIR)$(bindir)'
43 rm -f
'$(DESTDIR)$(bindir)/pg_ctl$(X)'
46 rm -f pg_ctl
$(X
) $(OBJS
)