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
|
|
|
#
|
2002-06-20 16:29:54 -04:00
|
|
|
# Portions Copyright (c) 1996-2002, 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
|
|
|
#
|
2003-03-18 17:19:47 -05:00
|
|
|
# $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.19 2003/03/18 22:19:46 petere Exp $
|
1999-12-03 23:53:22 -05:00
|
|
|
#
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
|
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
|
|
|
|
2003-03-18 17:19:47 -05:00
|
|
|
SCRIPTS := vacuumdb clusterdb
|
|
|
|
|
PROGRAMS = createdb createlang createuser dropdb droplang dropuser
|
1999-12-03 23:53:22 -05:00
|
|
|
|
2003-03-18 17:19:47 -05:00
|
|
|
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
all: submake-libpq submake-backend $(PROGRAMS)
|
|
|
|
|
|
|
|
|
|
%: %.o
|
|
|
|
|
$(CC) $(CFLAGS) $^ $(libpq) $(LDFLAGS) $(LIBS) -o $@
|
|
|
|
|
|
|
|
|
|
createdb: createdb.o common.o dumputils.o sprompt.o $(top_builddir)/src/backend/parser/keywords.o
|
|
|
|
|
createlang: createlang.o common.o sprompt.o print.o mbprint.o
|
|
|
|
|
createuser: createuser.o common.o dumputils.o sprompt.o $(top_builddir)/src/backend/parser/keywords.o
|
|
|
|
|
dropdb: dropdb.o common.o dumputils.o sprompt.o $(top_builddir)/src/backend/parser/keywords.o
|
|
|
|
|
droplang: droplang.o common.o sprompt.o print.o mbprint.o
|
|
|
|
|
dropuser: dropuser.o common.o dumputils.o sprompt.o $(top_builddir)/src/backend/parser/keywords.o
|
|
|
|
|
|
|
|
|
|
createdb.o createuser.o dropdb.o dropuser.o dumputils.o: dumputils.h
|
|
|
|
|
|
|
|
|
|
createlang.o droplang.o: print.h
|
|
|
|
|
print.o: print.h mbprint.h
|
|
|
|
|
|
|
|
|
|
dumputils.c dumputils.h sprompt.c : % : $(top_srcdir)/src/bin/pg_dump/%
|
|
|
|
|
rm -f $@ && $(LN_S) $< .
|
|
|
|
|
|
|
|
|
|
print.c print.h mbprint.c mbprint.h : % : $(top_srcdir)/src/bin/psql/%
|
|
|
|
|
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)
|
|
|
|
|
$(INSTALL_SCRIPT) $(srcdir)/clusterdb $(DESTDIR)$(bindir)/clusterdb
|
|
|
|
|
$(INSTALL_SCRIPT) $(srcdir)/vacuumdb $(DESTDIR)$(bindir)/vacuumdb
|
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-03-18 17:19:47 -05:00
|
|
|
rm -f $(addprefix $(DESTDIR)$(bindir)/, $(SCRIPTS) $(addsuffix $(X), $(PROGRAMS)))
|
|
|
|
|
|
1999-12-05 15:02:49 -05:00
|
|
|
|
2000-06-26 20:32:06 -04:00
|
|
|
clean distclean maintainer-clean:
|
2003-03-18 17:19:47 -05:00
|
|
|
rm -f $(addsuffix $(X), $(PROGRAMS)) $(addsuffix .o, $(PROGRAMS)) common.o dumputils.o sprompt.o print.o mbprint.o dumputils.c dumputils.h sprompt.c print.c print.h mbprint.c mbprint.h
|