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
|
|
|
|
#
|
2007-02-09 16:56:00 +01:00
|
|
|
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.122 2007/02/09 15:55:57 petere Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2006-06-18 17:38:37 +02:00
|
|
|
PGFILEDESC = "PostgreSQL Server"
|
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
|
|
|
|
2007-02-09 16:56:00 +01:00
|
|
|
DIRS = access bootstrap catalog parser commands executor lib libpq \
|
2000-07-14 17:30:56 +02:00
|
|
|
main nodes optimizer port postmaster regex rewrite \
|
2004-05-21 07:08:06 +02:00
|
|
|
storage tcop utils $(top_builddir)/src/timezone
|
2004-04-30 18:08:01 +02:00
|
|
|
|
2007-02-09 16:56:00 +01:00
|
|
|
SUBSYSOBJS = $(DIRS:%=%/SUBSYS.o)
|
2005-07-28 06:31:30 +02:00
|
|
|
|
2006-07-24 18:32:45 +02:00
|
|
|
ifeq ($(enable_dtrace), yes)
|
|
|
|
LOCALOBJS += utils/probes.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
OBJS = $(SUBSYSOBJS) $(LOCALOBJS) $(top_builddir)/src/port/libpgport_srv.a
|
2005-07-28 06:31:30 +02:00
|
|
|
|
2006-09-09 05:15:40 +02:00
|
|
|
# We put libpgport into OBJS, so remove it from LIBS; also add libldap
|
|
|
|
LIBS := $(filter-out -lpgport, $(LIBS)) $(LDAP_LIBS_BE)
|
2000-05-29 07:45:56 +02:00
|
|
|
|
2005-11-28 23:06:39 +01:00
|
|
|
# The backend doesn't need everything that's in LIBS, however
|
2005-11-28 23:43:30 +01:00
|
|
|
LIBS := $(filter-out -lz -lreadline -ledit -ltermcap -lncurses -lcurses, $(LIBS))
|
2005-11-28 23:06:39 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
##########################################################################
|
1999-01-17 07:20:06 +01:00
|
|
|
|
2004-07-21 22:34:50 +02:00
|
|
|
all: submake-libpgport postgres $(POSTGRES_IMP)
|
1998-01-04 20:13:04 +01:00
|
|
|
|
2003-03-21 18:18:34 +01:00
|
|
|
ifneq ($(PORTNAME), cygwin)
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
ifneq ($(PORTNAME), win32)
|
2005-10-27 22:45:29 +02:00
|
|
|
ifneq ($(PORTNAME), aix)
|
2000-05-29 07:45:56 +02:00
|
|
|
|
2000-07-13 18:07:14 +02:00
|
|
|
postgres: $(OBJS)
|
2004-07-21 22:34:50 +02:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(LIBS) -o $@
|
2000-05-29 07:45:56 +02:00
|
|
|
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
endif
|
|
|
|
endif
|
2005-10-27 22:45:29 +02:00
|
|
|
endif
|
2000-05-29 07:45:56 +02:00
|
|
|
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
2005-10-27 22:45:29 +02:00
|
|
|
|
2006-06-23 01:50:35 +02:00
|
|
|
postgres: $(OBJS) postgres.def libpostgres.a
|
2002-07-27 22:10:05 +02:00
|
|
|
$(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def
|
2002-09-05 20:28:46 +02:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(LIBS)
|
2002-07-27 22:10:05 +02:00
|
|
|
$(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
|
2006-10-08 19:15:34 +02:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -Wl,--stack,$(WIN32_STACK_RLIMIT) -o $@$(X) $@.exp $(OBJS) $(LIBS)
|
2002-09-05 20:28:46 +02:00
|
|
|
rm -f $@.exp $@.base
|
|
|
|
|
|
|
|
postgres.def: $(OBJS)
|
|
|
|
$(DLLTOOL) --export-all --output-def $@ $^
|
|
|
|
|
|
|
|
libpostgres.a: postgres.def
|
|
|
|
$(DLLTOOL) --dllname postgres.exe --def postgres.def --output-lib $@
|
1999-01-17 07:20:06 +01:00
|
|
|
|
2003-03-21 18:18:34 +01:00
|
|
|
endif # cygwin
|
2000-07-06 23:33:45 +02:00
|
|
|
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
ifeq ($(PORTNAME), win32)
|
|
|
|
|
2006-06-23 01:50:35 +02:00
|
|
|
postgres: $(OBJS) postgres.def libpostgres.a $(WIN32RES)
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
$(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def
|
2004-10-05 21:30:25 +02:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(WIN32RES) $(LIBS)
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
$(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
|
2006-10-08 19:15:34 +02:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -Wl,--stack=$(WIN32_STACK_RLIMIT) -o $@$(X) $@.exp $(OBJS) $(WIN32RES) $(LIBS)
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
rm -f $@.exp $@.base
|
|
|
|
|
|
|
|
postgres.def: $(OBJS)
|
2005-07-28 06:31:30 +02:00
|
|
|
$(DLLTOOL) --export-all --output-def $@ $^
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
|
|
|
|
libpostgres.a: postgres.def
|
|
|
|
$(DLLTOOL) --dllname postgres.exe --def postgres.def --output-lib $@
|
|
|
|
|
|
|
|
endif # win32
|
|
|
|
|
2002-10-09 18:21:54 +02:00
|
|
|
ifeq ($(PORTNAME), aix)
|
|
|
|
|
|
|
|
postgres: $(POSTGRES_IMP)
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -Wl,-bE:$(top_builddir)/src/backend/$(POSTGRES_IMP) $(LIBS) -o $@
|
|
|
|
|
|
|
|
$(POSTGRES_IMP): $(OBJS)
|
|
|
|
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $^
|
|
|
|
ifeq ($(host_os), aix3.2.5)
|
|
|
|
$(MKLDEXPORT) SUBSYS.o $(bindir)/postgres > $@
|
|
|
|
else
|
|
|
|
ifneq (,$(findstring aix4.1, $(host_os)))
|
|
|
|
$(MKLDEXPORT) SUBSYS.o $(bindir)/postgres > $@
|
|
|
|
else
|
|
|
|
$(MKLDEXPORT) SUBSYS.o . > $@
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
@rm -f SUBSYS.o
|
|
|
|
|
|
|
|
endif # aix
|
1997-03-12 21:44:57 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
# Parallel make trickery
|
2005-07-28 06:31:30 +02:00
|
|
|
$(SUBSYSOBJS): $(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
|
|
|
|
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
|
|
|
|
2006-07-24 18:32:45 +02:00
|
|
|
utils/probes.o: utils/probes.d $(SUBSYSOBJS)
|
2006-08-16 16:57:37 +02:00
|
|
|
$(DTRACE) $(DTRACEFLAGS) -G -s $^ -o $@
|
2006-07-24 18:32: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
|
2002-08-21 22:42:27 +02:00
|
|
|
|
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
|
2003-03-21 18:18:34 +01:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
1999-01-17 07:20:06 +01:00
|
|
|
ifeq ($(MAKE_DLL), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
|
1999-01-17 07:20:06 +01:00
|
|
|
endif
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(PORTNAME), win32)
|
|
|
|
ifeq ($(MAKE_DLL), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
endif
|
1999-01-17 07:20:06 +01:00
|
|
|
endif
|
2002-12-14 01:24:35 +01:00
|
|
|
$(MAKE) -C catalog install-data
|
2005-12-09 22:19:36 +01: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'
|
|
|
|
$(INSTALL_DATA) $(srcdir)/access/transam/recovery.conf.sample '$(DESTDIR)$(datadir)/recovery.conf.sample'
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
install-bin: postgres $(POSTGRES_IMP) installdirs
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postgres$(X)'
|
2003-11-11 04:53:33 +01:00
|
|
|
ifneq ($(PORTNAME), win32)
|
2005-12-09 22:19:36 +01:00
|
|
|
@rm -f '$(DESTDIR)$(bindir)/postmaster$(X)'
|
|
|
|
ln -s postgres$(X) '$(DESTDIR)$(bindir)/postmaster$(X)'
|
2003-11-11 04:53:33 +01:00
|
|
|
else
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postmaster$(X)'
|
2003-11-11 04:53:33 +01:00
|
|
|
endif
|
2000-07-08 04:40:27 +02:00
|
|
|
ifeq ($(MAKE_EXPORTS), true)
|
2005-12-09 22:19:36 +01: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:
|
2005-12-09 22:19:36 +01:00
|
|
|
$(mkinstalldirs) '$(DESTDIR)$(bindir)' '$(DESTDIR)$(datadir)'
|
2003-03-21 18:18:34 +01:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
2001-09-16 18:11:11 +02:00
|
|
|
ifeq ($(MAKE_DLL), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
$(mkinstalldirs) '$(DESTDIR)$(libdir)'
|
2001-09-16 18:11:11 +02:00
|
|
|
endif
|
|
|
|
endif
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
ifeq ($(PORTNAME), win32)
|
|
|
|
ifeq ($(MAKE_DLL), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
$(mkinstalldirs) '$(DESTDIR)$(libdir)'
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
endif
|
|
|
|
endif
|
2001-09-16 18:11:11 +02:00
|
|
|
ifeq ($(MAKE_EXPORTS), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
$(mkinstalldirs) '$(DESTDIR)$(pkglibdir)'
|
2001-09-16 18:11:11 +02:00
|
|
|
endif
|
2002-08-21 22:42:27 +02:00
|
|
|
|
2001-09-16 18:11:11 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
uninstall:
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -f '$(DESTDIR)$(bindir)/postgres$(X)' '$(DESTDIR)$(bindir)/postmaster'
|
1996-11-23 10:51:57 +01:00
|
|
|
ifeq ($(MAKE_EXPORTS), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -f '$(DESTDIR)$(pkglibdir)/$(POSTGRES_IMP)'
|
1996-11-23 10:51:57 +01:00
|
|
|
endif
|
2003-03-21 18:18:34 +01:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
1999-01-17 07:20:06 +01:00
|
|
|
ifeq ($(MAKE_DLL), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -f '$(DESTDIR)$(libdir)/libpostgres.a'
|
1999-01-17 07:20:06 +01:00
|
|
|
endif
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(PORTNAME), win32)
|
|
|
|
ifeq ($(MAKE_DLL), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -f '$(DESTDIR)$(libdir)/libpostgres.a'
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
endif
|
1999-01-17 07:20:06 +01:00
|
|
|
endif
|
2002-12-14 01:24:35 +01:00
|
|
|
$(MAKE) -C catalog uninstall-data
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -f '$(DESTDIR)$(datadir)/pg_hba.conf.sample' \
|
|
|
|
'$(DESTDIR)$(datadir)/pg_ident.conf.sample' \
|
|
|
|
'$(DESTDIR)$(datadir)/postgresql.conf.sample' \
|
|
|
|
'$(DESTDIR)$(datadir)/recovery.conf.sample'
|
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:
|
2006-07-24 18:32:45 +02:00
|
|
|
rm -f $(LOCALOBJS) postgres$(X) $(POSTGRES_IMP) \
|
2000-07-06 23:33:45 +02:00
|
|
|
$(top_srcdir)/src/include/parser/parse.h \
|
|
|
|
$(top_builddir)/src/include/utils/fmgroids.h
|
2003-03-21 18:18:34 +01:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
2000-07-06 23:33:45 +02:00
|
|
|
rm -f postgres.dll postgres.def libpostgres.a
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(PORTNAME), win32)
|
2004-12-31 20:09:37 +01:00
|
|
|
rm -f postgres.dll postgres.def libpostgres.a $(WIN32RES)
|
2000-07-06 23:33:45 +02:00
|
|
|
endif
|
2000-07-13 18:07:14 +02:00
|
|
|
for i in $(DIRS); do $(MAKE) -C $$i clean || exit; done
|
2000-03-08 23:00:19 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
distclean: clean
|
2002-05-05 02:03:29 +02:00
|
|
|
rm -f port/tas.s port/dynloader.c port/pg_sema.c port/pg_shmem.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
|
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
|