1996-07-09 08:22:35 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile--
|
1996-09-21 08:27:11 +02:00
|
|
|
# Makefile for the postgres backend (and the postmaster)
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
|
|
|
# Copyright (c) 1994, Regents of the University of California
|
|
|
|
#
|
1996-10-27 10:55:05 +01:00
|
|
|
# Functional notes:
|
|
|
|
#
|
|
|
|
# Parallel make:
|
|
|
|
#
|
|
|
|
# This make file is set up so that you can do a parallel make (with
|
|
|
|
# the --jobs option of make) and make multiple subdirectories at
|
|
|
|
# once.
|
|
|
|
#
|
|
|
|
# However, the subdirectory make files are not so careful.
|
|
|
|
# Normally, the --jobs option would get passed down to those
|
|
|
|
# subdirectory makes, like any other make option, and they would
|
|
|
|
# fail. But there's a trick: Put a value (max number of
|
|
|
|
# processes) on the --jobs option, e.g. --jobs=4. Now, due to a
|
|
|
|
# special feature of make, the --jobs option will not get passed
|
|
|
|
# to the subdirectory makes. (make does this because if you only
|
|
|
|
# want 4 tasks running, then splitting the subdirectory makes into
|
|
|
|
# multiple tasks would violate your wishes).
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Implementation notes:
|
|
|
|
#
|
|
|
|
# We don't use $(LD) for linking. We use $(CC) instead. This is because
|
|
|
|
# the $(CC) program apparently can do linking too, and it has certain
|
|
|
|
# thinks like default options and search paths for libraries set up for
|
|
|
|
# it that the more primitive $(LD) doesn't have.
|
|
|
|
#
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
|
|
|
# IDENTIFICATION
|
1997-03-12 21:44:57 +01:00
|
|
|
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.20 1997/03/12 20:44:57 scrappy Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
1996-10-27 10:55:05 +01:00
|
|
|
SRCDIR = ..
|
|
|
|
include ../Makefile.global
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1997-03-12 21:44:57 +01:00
|
|
|
DIRS = access bootstrap catalog commands executor lib libpq \
|
|
|
|
main nodes optimizer parser port postmaster regex rewrite \
|
|
|
|
storage tcop utils
|
1996-10-27 10:55:05 +01:00
|
|
|
|
|
|
|
ifdef TIOGA
|
1997-03-12 21:44:57 +01:00
|
|
|
DIRS += tioga
|
1996-10-27 10:55:05 +01:00
|
|
|
endif
|
|
|
|
|
1997-03-12 21:44:57 +01:00
|
|
|
OBJS = $(DIRS:%=%/SUBSYS.o)
|
|
|
|
|
1996-11-23 10:51:57 +01:00
|
|
|
ifeq ($(MAKE_EXPORTS), true)
|
|
|
|
EXP = postgres$(EXPSUFF)
|
|
|
|
else
|
|
|
|
EXP =
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: postgres $(EXP) global1.bki.source local1_template1.bki.source
|
1996-10-27 10:55:05 +01:00
|
|
|
|
1997-03-12 21:44:57 +01:00
|
|
|
postgres: $(OBJS) ../utils/version.o
|
|
|
|
gcc -o postgres $(LDFLAGS) $(OBJS) ../utils/version.o $(LDADD) -lm -ldl
|
|
|
|
|
|
|
|
$(OBJS): $(DIRS:%=%.dir)
|
|
|
|
|
|
|
|
$(DIRS:%=%.dir):
|
|
|
|
$(MAKE) -C $(subst .dir,,$@) all PORTNAME=$(PORTNAME)
|
|
|
|
|
|
|
|
../utils/version.o:
|
1996-11-12 07:47:10 +01:00
|
|
|
$(MAKE) -C ../utils version.o
|
1996-10-27 10:55:05 +01:00
|
|
|
|
1997-03-12 21:44:57 +01:00
|
|
|
global1.bki.source local1_template1.bki.source: catalog/$@
|
1996-11-03 10:05:30 +01:00
|
|
|
cp catalog/$@ .
|
1996-10-27 10:55:05 +01:00
|
|
|
|
1997-03-12 21:44:57 +01:00
|
|
|
catalog/global1.bki.source catalog/local1_template1.bki.source:
|
|
|
|
$(MAKE) -C catalog $@
|
|
|
|
|
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)
|
1997-01-05 22:17:45 +01:00
|
|
|
$(CC) $(LDFLAGS) -r -o postgres.o $(OBJS) $(LD_ADD)
|
1996-11-23 10:51:57 +01:00
|
|
|
|
1996-10-27 10:55:05 +01:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# The following targets are specified in make commands that appear in the
|
|
|
|
# make files in our subdirectories.
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1996-10-27 10:55:05 +01:00
|
|
|
parse.h:
|
|
|
|
$(MAKE) -C parser parse.h
|
1996-11-03 10:05:30 +01:00
|
|
|
cp parser/parse.h .
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1996-10-27 10:55:05 +01:00
|
|
|
fmgr.h:
|
|
|
|
$(MAKE) -C utils fmgr.h
|
1996-11-03 10:05:30 +01:00
|
|
|
cp utils/fmgr.h .
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
#############################################################################
|
1996-10-27 10:55:05 +01:00
|
|
|
clean:
|
|
|
|
rm -f postgres fmgr.h parse.h \
|
|
|
|
global1.bki.source local1_template1.bki.source
|
1997-03-12 21:44:57 +01:00
|
|
|
for i in $(DIRS); do $(MAKE) -C $$i clean PORTNAME=$(PORTNAME); done
|
1996-10-27 10:55:05 +01:00
|
|
|
|
|
|
|
.DEFAULT:
|
1997-03-12 21:44:57 +01:00
|
|
|
for i in $(DIRS); do $(MAKE) -C $$i $@ PORTNAME=$(PORTNAME); done
|
1996-10-27 10:55:05 +01:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
#############################################################################
|
|
|
|
#
|
|
|
|
# Installation.
|
|
|
|
#
|
1996-09-23 10:24:13 +02:00
|
|
|
# Install the backend program (postgres) to the binary directory and
|
|
|
|
# make a link as "postmaster". Install the bki files templates and sample
|
|
|
|
# files to the library directory.
|
|
|
|
#
|
|
|
|
# (History: Before Release 2, make install generated a bki.source file
|
|
|
|
# and then used build parameters to convert it to a bki file, then installed
|
|
|
|
# that bki file in the /files subdirectory of the default data directory.
|
|
|
|
# Initdb then used the bki file to generate the database catalog classes.
|
|
|
|
# That had to change because (1) there can be more than one database system,
|
|
|
|
# and (2) the parameters of a database system should be set at initdb time,
|
|
|
|
# not at postgres build time.
|
|
|
|
|
1996-11-23 10:51:57 +01:00
|
|
|
install: $(LIBDIR) $(BINDIR) $(HEADERDIR) postgres $(EXP) fmgr.h\
|
1996-09-23 10:24:13 +02:00
|
|
|
global1.bki.source local1_template1.bki.source \
|
1997-02-19 14:09:34 +01:00
|
|
|
libpq/pg_hba.conf.sample optimizer/geqo/pg_geqo.sample
|
1996-09-23 10:24:13 +02:00
|
|
|
|
1996-11-23 10:51:57 +01:00
|
|
|
$(INSTALL) $(INSTL_EXE_OPTS) postgres $(BINDIR)/postgres
|
|
|
|
ifeq ($(MAKE_EXPORTS), true)
|
|
|
|
$(INSTALL) $(INSTLOPTS) postgres$(EXPSUFF) $(LIBDIR)/postgres$(EXPSUFF)
|
|
|
|
endif
|
|
|
|
@rm -f $(BINDIR)/postmaster
|
|
|
|
cd $(BINDIR); ln -s postgres postmaster
|
1996-10-27 10:55:05 +01:00
|
|
|
$(INSTALL) $(INSTLOPTS) fmgr.h $(HEADERDIR)/fmgr.h
|
|
|
|
$(INSTALL) $(INSTLOPTS) global1.bki.source \
|
1996-11-23 10:51:57 +01:00
|
|
|
$(LIBDIR)/global1.bki.source
|
1996-10-27 10:55:05 +01:00
|
|
|
$(INSTALL) $(INSTLOPTS) local1_template1.bki.source \
|
1996-11-23 10:51:57 +01:00
|
|
|
$(LIBDIR)/local1_template1.bki.source
|
1996-10-12 09:44:39 +02:00
|
|
|
$(INSTALL) $(INSTLOPTS) libpq/pg_hba.conf.sample \
|
1996-11-23 10:51:57 +01:00
|
|
|
$(LIBDIR)/pg_hba.conf.sample
|
1997-02-19 14:09:34 +01:00
|
|
|
$(INSTALL) $(INSTLOPTS) optimizer/geqo/pg_geqo.sample \
|
|
|
|
$(LIBDIR)/pg_geqo.sample
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1996-11-23 10:51:57 +01:00
|
|
|
$(BINDIR) $(LIBDIR) $(HEADERDIR):
|
1996-10-27 10:55:05 +01:00
|
|
|
mkdir $@
|
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)
|
1997-01-05 22:17:45 +01:00
|
|
|
$(CC) $(LDFLAGS) -o postgres $(OBJS) $(LD_ADD)
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Build the file, "./ID", used by the "gid" (grep-for-identifier) tool
|
|
|
|
#
|
|
|
|
IDFILE= ID
|
|
|
|
.PHONY: $(IDFILE)
|
|
|
|
$(IDFILE):
|
1996-10-27 10:55:05 +01:00
|
|
|
./makeID $(PORTNAME)
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Special rule to generate cpp'd version of a .c file. This is
|
|
|
|
# especially useful given all the hellish macro processing going on.
|
|
|
|
# The cpp'd version has a .C suffix. To create foo.C from foo.c, just
|
|
|
|
# type
|
1996-10-27 10:55:05 +01:00
|
|
|
# make foo.C
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
|
|
|
%.cpp: %.c
|
1996-10-27 10:55:05 +01:00
|
|
|
$(CC) -E $(CFLAGS) $(<:.C=.c) | cat -s | cb | tr -s '\012*' '\012' \
|
|
|
|
> $(@F)
|