|
5 | 5 | # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
6 | 6 | # Portions Copyright (c) 1994, Regents of the University of California
|
7 | 7 | #
|
8 |
| -# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.29 2003/09/07 03:36:03 tgl Exp $ |
| 8 | +# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.30 2003/11/10 22:51:16 momjian Exp $ |
9 | 9 | #
|
10 | 10 | #-------------------------------------------------------------------------
|
11 | 11 |
|
12 | 12 | subdir = src/bin/initdb
|
13 | 13 | top_builddir = ../../..
|
14 | 14 | include $(top_builddir)/src/Makefile.global
|
15 | 15 |
|
16 |
| -all: initdb |
| 16 | +override CPPFLAGS := -DPGBINDIR=\"$(bindir)\" -DPGDATADIR=\"$(datadir)\" -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS) |
17 | 17 |
|
18 |
| -initdb: initdb.sh $(top_builddir)/src/Makefile.global |
19 |
| - sed -e 's/@VERSION@/$(VERSION)/g' \ |
20 |
| - -e 's,@SHELL@,$(SHELL),g' \ |
21 |
| - -e 's,@HAVE_IPV6@,$(HAVE_IPV6),g' \ |
22 |
| - -e 's,@bindir@,$(bindir),g' \ |
23 |
| - -e 's,@datadir@,$(datadir),g' \ |
24 |
| - $< >$@ |
25 |
| - chmod a+x $@ |
| 18 | +OBJS= initdb.o sprompt.o |
| 19 | +ifeq ($(PORTNAME), win32) |
| 20 | +OBJS+=dirmod.o |
| 21 | +endif |
| 22 | + |
| 23 | +all: submake-libpq submake-libpgport initdb |
| 24 | + |
| 25 | +initdb: $(OBJS) $(libpq_builddir)/libpq.a |
| 26 | + $(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@ |
| 27 | + |
| 28 | +dirmod.c sprompt.c: % : $(top_srcdir)/src/port/% |
| 29 | + rm -f $@ && $(LN_S) $< . |
26 | 30 |
|
27 | 31 | install: all installdirs
|
28 |
| - $(INSTALL_SCRIPT) initdb $(DESTDIR)$(bindir)/initdb |
| 32 | + $(INSTALL_PROGRAM) initdb$(X) $(DESTDIR)$(bindir)/initdb$(X) |
| 33 | + $(INSTALL_DATA) $(srcdir)/system_views.sql $(DESTDIR)$(datadir)/system_views.sql |
29 | 34 |
|
30 | 35 | installdirs:
|
31 | 36 | $(mkinstalldirs) $(DESTDIR)$(bindir)
|
32 | 37 |
|
33 | 38 | uninstall:
|
34 |
| - rm -f $(DESTDIR)$(bindir)/initdb |
| 39 | + rm -f $(DESTDIR)$(bindir)/initdb$(X) $(DESTDIR)$(datadir)/system_views.sql |
35 | 40 |
|
36 |
| -clean distclean maintainer-clean: |
37 |
| - rm -f initdb |
| 41 | +clean distclean: |
| 42 | + rm -f initdb$(X) $(OBJS) |
0 commit comments