Commit f3d6d948 authored by Bruce Momjian's avatar Bruce Momjian

Change pg_ctl to be in C. This was the final shell script and is

helpful for the Win32 port.

Andrew Dunstan, with additions by Bruce.
parent c792cbcc
......@@ -2,9 +2,10 @@
#
# Makefile for src/bin/pg_ctl
#
# Copyright (c) 1999, PostgreSQL Global Development Group
# Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.13 2003/12/23 21:56:21 tgl Exp $
# $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.14 2004/05/27 03:37:55 momjian Exp $
#
#-------------------------------------------------------------------------
......@@ -12,23 +13,30 @@ subdir = src/bin/pg_ctl
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
all: pg_ctl
override CPPFLAGS := -DFRONTEND -DDEF_PGPORT=$(DEF_PGPORT) -I$(libpq_srcdir) $(CPPFLAGS)
pg_ctl: pg_ctl.sh $(top_builddir)/src/Makefile.global
sed -e 's/@VERSION@/$(VERSION)/g' \
-e 's,@bindir@,$(bindir),g' \
-e 's,@DEF_PGPORT@,$(DEF_PGPORT),g' \
$< >$@
chmod a+x $@
OBJS= pg_ctl.o exec.o
all: submake-libpq submake-libpgport pg_ctl
pg_ctl: $(OBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
exec.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
install: all installdirs
$(INSTALL_SCRIPT) pg_ctl $(DESTDIR)$(bindir)/pg_ctl
$(INSTALL_PROGRAM) pg_ctl$(X) $(DESTDIR)$(bindir)/pg_ctl$(X)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(bindir)
uninstall:
rm -f $(DESTDIR)$(bindir)/pg_ctl
rm -f $(DESTDIR)$(bindir)/pg_ctl$(X)
clean distclean maintainer-clean:
rm -f pg_ctl
rm -f pg_ctl$(X) $(OBJS) exec.c
# ensure that changes in DEF_PGPORT propagate into object file
pg_ctl.o: pg_ctl.c $(top_builddir)/src/Makefile.global
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment