1999-12-04 05:53:22 +01:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2000-06-27 02:32:06 +02:00
|
|
|
# Makefile for src/bin/scripts
|
1999-12-04 05:53:22 +01:00
|
|
|
#
|
2002-06-20 22:29:54 +02:00
|
|
|
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
2001-02-18 19:34:02 +01:00
|
|
|
# Portions Copyright (c) 1994, Regents of the University of California
|
1999-12-04 05:53:22 +01:00
|
|
|
#
|
2004-10-04 20:05:55 +02:00
|
|
|
# $PostgreSQL: pgsql/src/bin/scripts/Makefile,v 1.30 2004/10/04 18:05:55 momjian Exp $
|
1999-12-04 05:53:22 +01:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2000-06-27 02:32:06 +02:00
|
|
|
subdir = src/bin/scripts
|
|
|
|
top_builddir = ../../..
|
2000-08-31 18:12:35 +02:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
1999-12-04 05:53:22 +01:00
|
|
|
|
2003-06-18 14:19:11 +02:00
|
|
|
PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vacuumdb
|
1999-12-04 05:53:22 +01:00
|
|
|
|
2004-10-04 20:05:55 +02:00
|
|
|
override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS)
|
2003-03-18 23:19:47 +01:00
|
|
|
|
|
|
|
all: submake-libpq submake-backend $(PROGRAMS)
|
|
|
|
|
|
|
|
%: %.o
|
2004-04-26 19:40:48 +02:00
|
|
|
$(CC) $(CFLAGS) $^ $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
|
2003-03-18 23:19:47 +01:00
|
|
|
|
2004-10-04 15:43:59 +02: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
|
2004-05-25 03:00:30 +02:00
|
|
|
|
2004-05-26 19:24:07 +02:00
|
|
|
dumputils.c: % : $(top_srcdir)/src/bin/pg_dump/%
|
2004-05-25 03:00:30 +02:00
|
|
|
rm -f $@ && $(LN_S) $< .
|
2003-03-18 23:19:47 +01:00
|
|
|
|
2003-04-16 07:23:55 +02:00
|
|
|
print.c mbprint.c : % : $(top_srcdir)/src/bin/psql/%
|
2003-03-18 23:19:47 +01:00
|
|
|
rm -f $@ && $(LN_S) $< .
|
|
|
|
|
|
|
|
.PHONY: submake-backend
|
|
|
|
submake-backend:
|
|
|
|
$(MAKE) -C $(top_builddir)/src/backend/parser keywords.o
|
1999-12-04 05:53:22 +01:00
|
|
|
|
1999-12-05 21:02:49 +01:00
|
|
|
|
2000-06-27 02:32:06 +02:00
|
|
|
install: all installdirs
|
2003-03-18 23:19:47 +01: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 14:19:11 +02:00
|
|
|
$(INSTALL_PROGRAM) clusterdb$(X) $(DESTDIR)$(bindir)/clusterdb$(X)
|
|
|
|
$(INSTALL_PROGRAM) vacuumdb$(X) $(DESTDIR)$(bindir)/vacuumdb$(X)
|
1999-12-04 05:53:22 +01:00
|
|
|
|
2000-06-27 02:32:06 +02: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 15:02:52 +02:00
|
|
|
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
1999-12-04 05:53:22 +01:00
|
|
|
|
2000-06-27 02:32:06 +02:00
|
|
|
uninstall:
|
2003-06-18 14:19:11 +02:00
|
|
|
rm -f $(addprefix $(DESTDIR)$(bindir)/, $(addsuffix $(X), $(PROGRAMS)))
|
2003-03-18 23:19:47 +01:00
|
|
|
|
1999-12-05 21:02:49 +01:00
|
|
|
|
2000-06-27 02:32:06 +02:00
|
|
|
clean distclean maintainer-clean:
|
2004-05-26 19:24:07 +02:00
|
|
|
rm -f $(addsuffix $(X), $(PROGRAMS)) $(addsuffix .o, $(PROGRAMS))
|
2004-10-04 15:43:59 +02:00
|
|
|
rm -f common.o dumputils.o print.o mbprint.o
|
|
|
|
rm -f dumputils.c print.c mbprint.c
|