1#-------------------------------------------------------------------------
2#
3# Makefile for src/bin/pg_ctl
4#
5# Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
6# Portions Copyright (c) 1994, Regents of the University of California
7#
8# src/bin/pg_ctl/Makefile
9#
10#-------------------------------------------------------------------------
11
12PGFILEDESC = "pg_ctl - starts/stops/restarts the PostgreSQL server"
13PGAPPICON=win32
14
15subdir = src/bin/pg_ctl
16top_builddir = ../../..
17include $(top_builddir)/src/Makefile.global
18
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.
21ifeq ($(PORTNAME), win32)
22override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
23LDFLAGS_INTERNAL += $(libpq_pgport)
24SUBMAKE_LIBPQ := submake-libpq
25endif
26
27OBJS=	pg_ctl.o $(WIN32RES)
28
29all: pg_ctl
30
31pg_ctl: $(OBJS) | submake-libpgport $(SUBMAKE_LIBPQ)
32	$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
33
34install: all installdirs
35	$(INSTALL_PROGRAM) pg_ctl$(X) '$(DESTDIR)$(bindir)/pg_ctl$(X)'
36
37installdirs:
38	$(MKDIR_P) '$(DESTDIR)$(bindir)'
39
40uninstall:
41	rm -f '$(DESTDIR)$(bindir)/pg_ctl$(X)'
42
43clean distclean maintainer-clean:
44	rm -f pg_ctl$(X) $(OBJS)
45	rm -rf tmp_check
46
47check:
48	$(prove_check)
49
50installcheck:
51	$(prove_installcheck)
52