1996-07-09 08:22:35 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2000-07-06 23:33:45 +02:00
|
|
|
# Makefile for the postgres backend
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
|
|
|
# Copyright (c) 1994, Regents of the University of California
|
|
|
|
#
|
2002-03-13 01:05:06 +01:00
|
|
|
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.77 2002/03/13 00:05:05 petere Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
subdir = src/backend
|
|
|
|
top_builddir = ../..
|
2000-08-31 18:12:35 +02:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2000-07-14 17:30:56 +02:00
|
|
|
DIRS := access bootstrap catalog parser commands executor lib libpq \
|
|
|
|
main nodes optimizer port postmaster regex rewrite \
|
1997-03-12 21:44:57 +01:00
|
|
|
storage tcop utils
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
OBJS := $(DIRS:%=%/SUBSYS.o)
|
2000-05-29 07:45:56 +02:00
|
|
|
|
1999-12-16 02:25:23 +01:00
|
|
|
ifeq ($(PORTNAME), qnx4)
|
2000-07-06 23:33:45 +02:00
|
|
|
# This file crashes qnx4's wlink and is therefore not in
|
|
|
|
# bootstrap/SUBSYS.o on that platform. (Wotta hack ... is it still
|
2001-05-24 17:53:34 +02:00
|
|
|
# necessary?) [ Yes, until the Watcom compiler goes open source it's
|
|
|
|
# effectively unsupported ]
|
2000-05-29 07:45:56 +02:00
|
|
|
OBJS+= bootstrap/bootstrap.o
|
1999-12-16 02:25:23 +01:00
|
|
|
endif
|
1997-03-12 21:44:57 +01:00
|
|
|
|
1999-01-17 07:20:06 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
##########################################################################
|
1999-01-17 07:20:06 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
all: postgres $(POSTGRES_IMP)
|
2001-06-02 20:25:18 +02:00
|
|
|
ifeq ($(enable_nls), yes)
|
|
|
|
$(MAKE) -C po all
|
|
|
|
endif
|
1998-01-04 20:13:04 +01:00
|
|
|
|
1999-01-17 07:20:06 +01:00
|
|
|
ifneq ($(PORTNAME), win)
|
2000-05-29 07:45:56 +02:00
|
|
|
|
2000-07-13 18:07:14 +02:00
|
|
|
postgres: $(OBJS)
|
2000-11-30 21:36:13 +01:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(LIBS) -o $@
|
2000-05-29 07:45:56 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
else # win
|
2000-05-29 07:45:56 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
# No points for style here. How about encapsulating some of these
|
|
|
|
# commands into variables?
|
2001-04-04 23:15:56 +02:00
|
|
|
postgres: $(OBJS) $(top_builddir)/src/utils/dllinit.o postgres.def libpostgres.a
|
1999-01-17 07:20:06 +01:00
|
|
|
dlltool --dllname $@$(X) --output-exp $@.exp --def postgres.def
|
2001-04-04 23:15:56 +02:00
|
|
|
gcc -g -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(DLLLIBS)
|
1999-01-17 07:20:06 +01:00
|
|
|
dlltool --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
|
2001-04-04 23:15:56 +02:00
|
|
|
gcc -g -o $@$(X) $@.exp $(OBJS) $(DLLLIBS)
|
1999-01-17 07:20:06 +01:00
|
|
|
rm $@.exp $@.base
|
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
endif # win
|
|
|
|
|
1997-03-12 21:44:57 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
# Parallel make trickery
|
2000-07-13 18:07:14 +02:00
|
|
|
$(OBJS): $(DIRS:%=%-recursive)
|
1997-03-12 21:44:57 +01:00
|
|
|
|
2000-07-13 18:07:14 +02:00
|
|
|
.PHONY: $(DIRS:%=%-recursive)
|
|
|
|
# Update the commonly used headers before building the subdirectories
|
2000-10-20 23:04:27 +02:00
|
|
|
$(DIRS:%=%-recursive): $(top_builddir)/src/include/parser/parse.h $(top_builddir)/src/include/utils/fmgroids.h
|
2000-07-13 18:07:14 +02:00
|
|
|
$(MAKE) -C $(subst -recursive,,$@) all
|
1997-03-12 21:44:57 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
|
|
|
|
ifeq ($(MAKE_DLL), true)
|
2001-04-02 05:21:23 +02:00
|
|
|
|
2001-04-04 23:15:56 +02:00
|
|
|
postgres.def: $(OBJS)
|
|
|
|
$(DLLTOOL) --export-all --output-def $@ $(OBJS)
|
2000-07-06 23:33:45 +02:00
|
|
|
|
2001-04-04 23:15:56 +02:00
|
|
|
libpostgres.a: $(OBJS) $(top_builddir)/src/utils/dllinit.o postgres.def
|
2000-07-06 23:33:45 +02:00
|
|
|
$(DLLTOOL) --dllname postgres.exe --def postgres.def --output-lib $@
|
2001-04-02 05:21:23 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
endif # MAKE_DLL
|
|
|
|
|
|
|
|
|
|
|
|
$(top_builddir)/src/utils/dllinit.o: $(top_srcdir)/src/utils/dllinit.c
|
|
|
|
$(MAKE) -C $(top_builddir)/src/utils dllinit.o
|
1996-10-27 10:55:05 +01:00
|
|
|
|
1996-11-23 10:51:57 +01:00
|
|
|
# The postgres.o target is needed by the rule in Makefile.global that
|
|
|
|
# creates the exports file when MAKE_EXPORTS = true.
|
|
|
|
postgres.o: $(OBJS)
|
2000-11-30 21:36:13 +01:00
|
|
|
$(CC) $(LDREL) $(LDFLAGS) $^ $(LIBS) -o $@
|
2000-05-29 07:45:56 +02:00
|
|
|
|
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
# The following targets are specified in make commands that appear in
|
|
|
|
# the make files in our subdirectories. Note that it's important we
|
|
|
|
# match the dependencies shown in the subdirectory makefiles!
|
1996-11-23 10:51:57 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
$(srcdir)/parser/parse.h: parser/gram.y
|
|
|
|
$(MAKE) -C parser parse.h
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
utils/fmgroids.h: utils/Gen_fmgrtab.sh $(top_srcdir)/src/include/catalog/pg_proc.h
|
|
|
|
$(MAKE) -C utils fmgroids.h
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
# Make symlinks for these headers in the include directory. That way
|
|
|
|
# we can cut down on the -I options. Also, a symlink is automatically
|
|
|
|
# up to date when we update the base file.
|
1999-11-14 18:12:42 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
$(top_builddir)/src/include/parser/parse.h: $(srcdir)/parser/parse.h
|
2001-04-23 22:27:55 +02:00
|
|
|
prereqdir=`cd $(dir $<) >/dev/null && pwd` && \
|
2000-10-20 23:04:27 +02:00
|
|
|
cd $(dir $@) && rm -f $(notdir $@) && \
|
2001-11-20 01:27:13 +01:00
|
|
|
$(LN_S) "$$prereqdir/$(notdir $<)" .
|
2000-05-29 07:45:56 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
$(top_builddir)/src/include/utils/fmgroids.h: utils/fmgroids.h
|
|
|
|
cd $(dir $@) && rm -f $(notdir $@) && \
|
|
|
|
$(LN_S) ../../../$(subdir)/utils/fmgroids.h .
|
1999-11-14 18:12:42 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
distprep:
|
|
|
|
$(MAKE) -C parser gram.c parse.h scan.c
|
|
|
|
$(MAKE) -C bootstrap bootparse.c bootstrap_tokens.h bootscanner.c
|
|
|
|
$(MAKE) -C utils/misc guc-file.c
|
2001-06-02 20:25:18 +02:00
|
|
|
ifeq ($(enable_nls), yes)
|
|
|
|
$(MAKE) -C po $@
|
|
|
|
endif
|
2000-07-19 18:30:27 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
##########################################################################
|
|
|
|
|
2000-07-08 04:40:27 +02:00
|
|
|
install: all installdirs install-bin
|
1999-01-17 07:20:06 +01:00
|
|
|
ifeq ($(PORTNAME), win)
|
|
|
|
ifeq ($(MAKE_DLL), true)
|
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
|
|
|
$(INSTALL_DATA) libpostgres.a $(DESTDIR)$(libdir)/libpostgres.a
|
1999-01-17 07:20:06 +01:00
|
|
|
endif
|
|
|
|
endif
|
2000-07-06 23:33:45 +02:00
|
|
|
$(MAKE) -C catalog install-bki
|
2000-10-20 23:04:27 +02:00
|
|
|
$(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample $(DESTDIR)$(datadir)/pg_hba.conf.sample
|
|
|
|
$(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample $(DESTDIR)$(datadir)/pg_ident.conf.sample
|
|
|
|
$(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample $(DESTDIR)$(datadir)/postgresql.conf.sample
|
2001-06-02 20:25:18 +02:00
|
|
|
ifeq ($(enable_nls), yes)
|
|
|
|
$(MAKE) -C po $@
|
|
|
|
endif
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
install-bin: postgres $(POSTGRES_IMP) 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
|
|
|
$(INSTALL_PROGRAM) postgres$(X) $(DESTDIR)$(bindir)/postgres$(X)
|
|
|
|
@rm -f $(DESTDIR)$(bindir)/postmaster
|
|
|
|
ln -s postgres$(X) $(DESTDIR)$(bindir)/postmaster
|
2000-07-08 04:40:27 +02:00
|
|
|
ifeq ($(MAKE_EXPORTS), true)
|
2001-09-16 18:11:11 +02:00
|
|
|
$(INSTALL_DATA) $(POSTGRES_IMP) $(DESTDIR)$(pkglibdir)/$(POSTGRES_IMP)
|
2000-07-08 04:40:27 +02:00
|
|
|
endif
|
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
.PHONY: install-bin
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2001-09-16 18:11:11 +02:00
|
|
|
installdirs:
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)
|
|
|
|
ifeq ($(PORTNAME), win)
|
|
|
|
ifeq ($(MAKE_DLL), true)
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifeq ($(MAKE_EXPORTS), true)
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
|
|
|
|
endif
|
|
|
|
ifeq ($(enable_nls), yes)
|
|
|
|
$(MAKE) -C po $@
|
|
|
|
endif
|
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
uninstall:
|
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
|
|
|
rm -f $(DESTDIR)$(bindir)/postgres$(X) $(DESTDIR)$(bindir)/postmaster
|
1996-11-23 10:51:57 +01:00
|
|
|
ifeq ($(MAKE_EXPORTS), true)
|
2001-09-16 18:11:11 +02:00
|
|
|
rm -f $(DESTDIR)$(pkglibdir)/$(POSTGRES_IMP)
|
1996-11-23 10:51:57 +01:00
|
|
|
endif
|
1999-01-17 07:20:06 +01:00
|
|
|
ifeq ($(PORTNAME), win)
|
|
|
|
ifeq ($(MAKE_DLL), true)
|
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
|
|
|
rm -f $(DESTDIR)$(libdir)/libpostgres.a
|
1999-01-17 07:20:06 +01:00
|
|
|
endif
|
|
|
|
endif
|
2000-07-06 23:33:45 +02:00
|
|
|
$(MAKE) -C catalog uninstall-bki
|
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
|
|
|
rm -f $(DESTDIR)$(datadir)/pg_hba.conf.sample \
|
|
|
|
$(DESTDIR)$(datadir)/pg_ident.conf.sample \
|
|
|
|
$(DESTDIR)$(datadir)/postgresql.conf.sample
|
2001-06-02 20:25:18 +02:00
|
|
|
ifeq ($(enable_nls), yes)
|
|
|
|
$(MAKE) -C po $@
|
|
|
|
endif
|
1999-03-08 00:05:57 +01:00
|
|
|
|
2000-03-08 23:00:19 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
##########################################################################
|
2000-03-08 23:00:19 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
clean:
|
|
|
|
rm -f postgres$(X) $(POSTGRES_IMP) \
|
|
|
|
$(top_srcdir)/src/include/parser/parse.h \
|
|
|
|
$(top_builddir)/src/include/utils/fmgroids.h
|
|
|
|
ifeq ($(PORTNAME), win)
|
|
|
|
ifeq ($(MAKE_DLL), true)
|
|
|
|
rm -f postgres.dll postgres.def libpostgres.a
|
|
|
|
endif
|
|
|
|
endif
|
2000-07-13 18:07:14 +02:00
|
|
|
for i in $(DIRS); do $(MAKE) -C $$i clean || exit; done
|
2001-06-02 20:25:18 +02:00
|
|
|
ifeq ($(enable_nls), yes)
|
|
|
|
$(MAKE) -C po $@
|
|
|
|
endif
|
2000-03-08 23:00:19 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
distclean: clean
|
2002-03-13 01:05:06 +01:00
|
|
|
rm -f port/tas.s port/dynloader.c
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
maintainer-clean: distclean
|
|
|
|
rm -f $(srcdir)/bootstrap/bootparse.c \
|
|
|
|
$(srcdir)/bootstrap/bootscanner.c \
|
|
|
|
$(srcdir)/bootstrap/bootstrap_tokens.h \
|
|
|
|
$(srcdir)/parser/gram.c \
|
|
|
|
$(srcdir)/parser/scan.c \
|
|
|
|
$(srcdir)/parser/parse.h \
|
|
|
|
$(srcdir)/utils/misc/guc-file.c
|
2001-06-02 20:25:18 +02:00
|
|
|
$(MAKE) -C po maintainer-clean
|
2000-03-08 23:00:19 +01:00
|
|
|
|
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
##########################################################################
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
|
|
|
# Support for code development.
|
|
|
|
#
|
1996-11-03 10:05:30 +01:00
|
|
|
# Use target "quick" to build "postgres" when you know all the subsystems
|
|
|
|
# are up to date. It saves the time of doing all the submakes.
|
|
|
|
.PHONY: quick
|
|
|
|
quick: $(OBJS)
|
2000-11-30 21:36:13 +01:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(LIBS) -o postgres
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
depend dep: $(top_srcdir)/src/include/parser/parse.h $(top_builddir)/src/include/utils/fmgroids.h
|
|
|
|
for i in $(DIRS); do $(MAKE) -C $$i $@; done
|