Commit 279598bb authored by Bruce Momjian's avatar Bruce Momjian

Add C version of initdb, from Andrew Dunstan.

This is his original version with a binary rmdir() we might need in the
future.

I will commit an update version with cleanups shortly.
parent 5e8a8865
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.29 2003/09/07 03:36:03 tgl Exp $ # $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.30 2003/11/10 22:51:16 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -13,25 +13,30 @@ subdir = src/bin/initdb ...@@ -13,25 +13,30 @@ subdir = src/bin/initdb
top_builddir = ../../.. top_builddir = ../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
all: initdb override CPPFLAGS := -DPGBINDIR=\"$(bindir)\" -DPGDATADIR=\"$(datadir)\" -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
initdb: initdb.sh $(top_builddir)/src/Makefile.global OBJS= initdb.o sprompt.o
sed -e 's/@VERSION@/$(VERSION)/g' \ ifeq ($(PORTNAME), win32)
-e 's,@SHELL@,$(SHELL),g' \ OBJS+=dirmod.o
-e 's,@HAVE_IPV6@,$(HAVE_IPV6),g' \ endif
-e 's,@bindir@,$(bindir),g' \
-e 's,@datadir@,$(datadir),g' \ all: submake-libpq submake-libpgport initdb
$< >$@
chmod a+x $@ initdb: $(OBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@
dirmod.c sprompt.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
install: all installdirs install: all installdirs
$(INSTALL_SCRIPT) initdb $(DESTDIR)$(bindir)/initdb $(INSTALL_PROGRAM) initdb$(X) $(DESTDIR)$(bindir)/initdb$(X)
$(INSTALL_DATA) $(srcdir)/system_views.sql $(DESTDIR)$(datadir)/system_views.sql
installdirs: installdirs:
$(mkinstalldirs) $(DESTDIR)$(bindir) $(mkinstalldirs) $(DESTDIR)$(bindir)
uninstall: uninstall:
rm -f $(DESTDIR)$(bindir)/initdb rm -f $(DESTDIR)$(bindir)/initdb$(X) $(DESTDIR)$(datadir)/system_views.sql
clean distclean maintainer-clean: clean distclean:
rm -f initdb rm -f initdb$(X) $(OBJS)
This diff is collapsed.
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