1999-12-03 23:53:22 -05:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
#
|
2000-06-26 20:32:06 -04:00
|
|
|
# Makefile for src/bin/scripts
|
1999-12-03 23:53:22 -05:00
|
|
|
#
|
2005-01-01 15:44:34 -05:00
|
|
|
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
2001-02-18 13:34:02 -05:00
|
|
|
# Portions Copyright (c) 1994, Regents of the University of California
|
1999-12-03 23:53:22 -05:00
|
|
|
#
|
2005-07-29 11:13:11 -04:00
|
|
|
# $PostgreSQL: pgsql/src/bin/scripts/Makefile,v 1.34 2005/07/29 15:13:11 momjian Exp $
|
1999-12-03 23:53:22 -05:00
|
|
|
#
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
|
2004-10-05 15:30:25 -04:00
|
|
|
PGFILEDESC = "PostgreSQL utility"
|
2000-06-26 20:32:06 -04:00
|
|
|
subdir = src/bin/scripts
|
|
|
|
|
top_builddir = ../../..
|
2000-08-31 12:12:35 -04:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
1999-12-03 23:53:22 -05:00
|
|
|
|
2005-07-29 11:13:11 -04:00
|
|
|
PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vacuumdb reindexdb
|
1999-12-03 23:53:22 -05:00
|
|
|
|
2004-10-04 14:05:55 -04:00
|
|
|
override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS)
|
2003-03-18 17:19:47 -05:00
|
|
|
|
|
|
|
|
all: submake-libpq submake-backend $(PROGRAMS)
|
|
|
|
|
|
2004-10-05 15:30:25 -04:00
|
|
|
%: %.o $(WIN32RES)
|
2005-03-25 13:17:14 -05:00
|
|
|
$(CC) $(CFLAGS) $^ $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)
|
2003-03-18 17:19:47 -05:00
|
|
|
|
2004-10-04 09:43:59 -04:00
|
|
|
createdb: createdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
|
|
|
|
|
createlang: createlang.o common.o print.o mbprint.o
|
|
|
|
|
createuser: createuser.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
|
|
|
|
|
dropdb: dropdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
|
|
|
|
|
droplang: droplang.o common.o print.o mbprint.o
|
|
|
|
|
dropuser: dropuser.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
|
|
|
|
|
clusterdb: clusterdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
|
|
|
|
|
vacuumdb: vacuumdb.o common.o
|
2005-07-29 11:13:11 -04:00
|
|
|
reindexdb: reindexdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
|
2004-05-24 21:00:30 -04:00
|
|
|
|
2004-05-26 13:24:07 -04:00
|
|
|
dumputils.c: % : $(top_srcdir)/src/bin/pg_dump/%
|
2004-05-24 21:00:30 -04:00
|
|
|
rm -f $@ && $(LN_S) $< .
|
2003-03-18 17:19:47 -05:00
|
|
|
|
2003-04-16 01:23:55 -04:00
|
|
|
print.c mbprint.c : % : $(top_srcdir)/src/bin/psql/%
|
2003-03-18 17:19:47 -05:00
|
|
|
rm -f $@ && $(LN_S) $< .
|
|
|
|
|
|
|
|
|
|
.PHONY: submake-backend
|
|
|
|
|
submake-backend:
|
|
|
|
|
$(MAKE) -C $(top_builddir)/src/backend/parser keywords.o
|
1999-12-03 23:53:22 -05:00
|
|
|
|
1999-12-05 15:02:49 -05:00
|
|
|
|
2000-06-26 20:32:06 -04:00
|
|
|
install: all installdirs
|
2003-03-18 17:19:47 -05:00
|
|
|
$(INSTALL_PROGRAM) createdb$(X) $(DESTDIR)$(bindir)/createdb$(X)
|
|
|
|
|
$(INSTALL_PROGRAM) dropdb$(X) $(DESTDIR)$(bindir)/dropdb$(X)
|
|
|
|
|
$(INSTALL_PROGRAM) createlang$(X) $(DESTDIR)$(bindir)/createlang$(X)
|
|
|
|
|
$(INSTALL_PROGRAM) droplang$(X) $(DESTDIR)$(bindir)/droplang$(X)
|
|
|
|
|
$(INSTALL_PROGRAM) createuser$(X) $(DESTDIR)$(bindir)/createuser$(X)
|
|
|
|
|
$(INSTALL_PROGRAM) dropuser$(X) $(DESTDIR)$(bindir)/dropuser$(X)
|
2003-06-18 08:19:11 -04:00
|
|
|
$(INSTALL_PROGRAM) clusterdb$(X) $(DESTDIR)$(bindir)/clusterdb$(X)
|
|
|
|
|
$(INSTALL_PROGRAM) vacuumdb$(X) $(DESTDIR)$(bindir)/vacuumdb$(X)
|
2005-07-29 11:13:11 -04:00
|
|
|
$(INSTALL_PROGRAM) reindexdb$(X) $(DESTDIR)$(bindir)/reindexdb$(X)
|
1999-12-03 23:53:22 -05:00
|
|
|
|
2000-06-26 20:32:06 -04:00
|
|
|
installdirs:
|
Support for DESTDIR make variable. This is used as in `make install
DESTDIR=/else/where' and prepends the value of DESTDIR to the full
installation paths (e.g., /else/where/usr/local/pgsql/bin). This allows
users to install the package into a location different from the one that
was configured and hard-coded into various scripts, e.g., for creating
binary packages.
DESTDIR is in many cases preferrable over `make install
prefix=/else/where' because
a) `prefix' affects the path that is hard-coded into the files, which can
lead to a `make install prefix=xxx' (as done by the regression test
driver) corrupting the files in the source tree with wrong paths.
b) it doesn't work at all if a directory was overridden to not depend on
`prefix', e.g., --sysconfdir=/etc.
(Updating the regression test driver to use DESTDIR is a separate
undertaking.)
See also autoconf@gnu.org, From: Akim Demaille <akim@epita.fr>, Date: 08
Sep 2000 12:48:59 +0200, Message-ID:
<mv4em2vb1lw.fsf@nostromo.lrde.epita.fr>, Subject: Re: HTML format
documentation.
2000-09-17 09:02:52 -04:00
|
|
|
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
1999-12-03 23:53:22 -05:00
|
|
|
|
2000-06-26 20:32:06 -04:00
|
|
|
uninstall:
|
2003-06-18 08:19:11 -04:00
|
|
|
rm -f $(addprefix $(DESTDIR)$(bindir)/, $(addsuffix $(X), $(PROGRAMS)))
|
2003-03-18 17:19:47 -05:00
|
|
|
|
1999-12-05 15:02:49 -05:00
|
|
|
|
2000-06-26 20:32:06 -04:00
|
|
|
clean distclean maintainer-clean:
|
2004-05-26 13:24:07 -04:00
|
|
|
rm -f $(addsuffix $(X), $(PROGRAMS)) $(addsuffix .o, $(PROGRAMS))
|
2004-10-05 15:30:25 -04:00
|
|
|
rm -f common.o dumputils.o print.o mbprint.o $(WIN32RES)
|
2004-10-04 09:43:59 -04:00
|
|
|
rm -f dumputils.c print.c mbprint.c
|