|
2 | 2 | #
|
3 | 3 | # Makefile for src/bin/pg_ctl
|
4 | 4 | #
|
5 |
| -# Copyright (c) 1999, PostgreSQL Global Development Group |
| 5 | +# Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group |
| 6 | +# Portions Copyright (c) 1994, Regents of the University of California |
6 | 7 | #
|
7 |
| -# $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.13 2003/12/23 21:56:21 tgl Exp $ |
| 8 | +# $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.14 2004/05/27 03:37:55 momjian Exp $ |
8 | 9 | #
|
9 | 10 | #-------------------------------------------------------------------------
|
10 | 11 |
|
11 | 12 | subdir = src/bin/pg_ctl
|
12 | 13 | top_builddir = ../../..
|
13 | 14 | include$(top_builddir)/src/Makefile.global
|
14 | 15 |
|
15 |
| -all: pg_ctl |
| 16 | +overrideCPPFLAGS := -DFRONTEND -DDEF_PGPORT=$(DEF_PGPORT) -I$(libpq_srcdir)$(CPPFLAGS) |
16 | 17 |
|
17 |
| -pg_ctl: pg_ctl.sh$(top_builddir)/src/Makefile.global |
18 |
| -sed -e's/@VERSION@/$(VERSION)/g'\ |
19 |
| - -e's,@bindir@,$(bindir),g'\ |
20 |
| - -e's,@DEF_PGPORT@,$(DEF_PGPORT),g'\ |
21 |
| -$<>$@ |
22 |
| -chmod a+x$@ |
| 18 | +OBJS=pg_ctl.o exec.o |
| 19 | + |
| 20 | +all: submake-libpq submake-libpgport pg_ctl |
| 21 | + |
| 22 | +pg_ctl:$(OBJS)$(libpq_builddir)/libpq.a |
| 23 | +$(CC)$(CFLAGS)$(OBJS)$(libpq)$(LDFLAGS)$(LIBS) -o$@$(X) |
| 24 | + |
| 25 | +exec.c:% :$(top_srcdir)/src/port/% |
| 26 | +rm -f$@&&$(LN_S)$<. |
23 | 27 |
|
24 | 28 | install: all installdirs
|
25 |
| -$(INSTALL_SCRIPT) pg_ctl$(DESTDIR)$(bindir)/pg_ctl |
| 29 | +$(INSTALL_PROGRAM) pg_ctl$(X)$(DESTDIR)$(bindir)/pg_ctl$(X) |
26 | 30 |
|
27 | 31 | installdirs:
|
28 | 32 | $(mkinstalldirs)$(DESTDIR)$(bindir)
|
29 | 33 |
|
30 | 34 | uninstall:
|
31 |
| -rm -f$(DESTDIR)$(bindir)/pg_ctl |
| 35 | +rm -f$(DESTDIR)$(bindir)/pg_ctl$(X) |
32 | 36 |
|
33 | 37 | cleandistcleanmaintainer-clean:
|
34 |
| -rm -f pg_ctl |
| 38 | +rm -f pg_ctl$(X)$(OBJS) exec.c |
| 39 | + |
| 40 | + |
| 41 | +# ensure that changes in DEF_PGPORT propagate into object file |
| 42 | +pg_ctl.o: pg_ctl.c$(top_builddir)/src/Makefile.global |