head	1.12;
access;
symbols
	REL_0_4:1.1.1.1
	ANDREW_JOLLY:1.1.1;
locks; strict;
comment	@# @;


1.12
date	95.05.01.08.11.58;	author andrew;	state Exp;
branches;
next	1.11;

1.11
date	95.04.30.06.24.13;	author andrew;	state Exp;
branches;
next	1.10;

1.10
date	95.04.27.01.34.52;	author andrew;	state Exp;
branches;
next	1.9;

1.9
date	95.03.23.01.22.33;	author andrew;	state Exp;
branches;
next	1.8;

1.8
date	95.03.22.19.58.18;	author andrew;	state Exp;
branches;
next	1.7;

1.7
date	95.03.21.06.50.38;	author andrew;	state Exp;
branches;
next	1.6;

1.6
date	95.02.02.00.59.25;	author jolly;	state Exp;
branches;
next	1.5;

1.5
date	95.01.18.22.09.56;	author jolly;	state Exp;
branches;
next	1.4;

1.4
date	95.01.16.20.48.13;	author jolly;	state Exp;
branches;
next	1.3;

1.3
date	95.01.05.19.54.08;	author jolly;	state Exp;
branches;
next	1.2;

1.2
date	94.12.26.23.54.33;	author andrew;	state Exp;
branches;
next	1.1;

1.1
date	94.11.07.05.19.15;	author andrew;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	94.11.07.05.19.16;	author andrew;	state Exp;
branches;
next	;


desc
@@


1.12
log
@pg_id doesn't need LD_ADD
@
text
@#-------------------------------------------------------------------------
#
# Makefile--
#    Makefile for the postgres backend (and the postmaster)
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
#    $Header: /usr/local/devel/pglite/cvs/src/backend/Makefile,v 1.11 1995/04/30 06:24:13 andrew Exp $
#
#-------------------------------------------------------------------------

#
# The following turns on intermediate linking of partial objects to speed
# the link cycle during development. (To turn this off, put "BIGOBJS=false"
# in your custom makefile, ../Makefile.custom.)
BIGOBJS= true


PROG=	postgres

MKDIR=	../mk
include $(MKDIR)/postgres.mk


include $(CURDIR)/access/Makefile.inc
include $(CURDIR)/bootstrap/Makefile.inc
include $(CURDIR)/catalog/Makefile.inc
include $(CURDIR)/commands/Makefile.inc
include $(CURDIR)/executor/Makefile.inc
include $(CURDIR)/include/Makefile.inc
include $(CURDIR)/lib/Makefile.inc
include $(CURDIR)/libpq/Makefile.inc
include $(CURDIR)/main/Makefile.inc
include $(CURDIR)/nodes/Makefile.inc
include $(CURDIR)/optimizer/Makefile.inc
include $(CURDIR)/parser/Makefile.inc
include $(CURDIR)/port/Makefile.inc
include $(CURDIR)/postmaster/Makefile.inc
include $(CURDIR)/rewrite/Makefile.inc
include $(CURDIR)/storage/Makefile.inc
include $(CURDIR)/tcop/Makefile.inc
include $(CURDIR)/tioga/Makefile.inc
include $(CURDIR)/utils/Makefile.inc

SRCS:=	${SRCS_ACCESS} ${SRCS_BOOTSTRAP} $(SRCS_CATALOG) ${SRCS_COMMANDS} \
	${SRCS_EXECUTOR} $(SRCS_LIB) $(SRCS_LIBPQ) ${SRCS_MAIN} \
	${SRCS_NODES} ${SRCS_OPTIMIZER} ${SRCS_PARSER} ${SRCS_PORT} \
	$(SRCS_POSTMASTER) ${SRCS_REWRITE} ${SRCS_STORAGE} \
	${SRCS_TCOP} ${SRCS_UTILS} 

ifeq ($(BIGOBJS), true)
OBJS= ACCESS.o BOOTSTRAP.o COMMANDS.o EXECUTOR.o MAIN.o MISC.o NODES.o \
	PARSER.o OPTIMIZER.o REWRITE.o STORAGE.o TCOP.o UTILS.o
CLEANFILES+= $(subst .s,.o,$(SRCS:.c=.o)) $(OBJS)
else
OBJS:= $(subst .s,.o,$(SRCS:.c=.o))
CLEANFILES+= $(OBJS)
endif

#############################################################################
#
# TIOGA stuff
#
ifdef TIOGA
SRCS+= $(SRCS_TIOGA) 
   ifeq ($(BIGOBJS), true)
TIOGA.o: 	$(SRCS_TIOGA:%.c=$(objdir)/%.o)
	$(make_partial)
OBJS+= TIOGA.o
CLEANFILES+= $(SRCS_TIOGA:%.c=%.o) TIOGA.o
   else
OBJS+= $(SRCS_TIOGA:%.c=%.o)
   endif
endif


#############################################################################
#
# Compiling the postgres backend.
#
CFLAGS+=  -DPOSTGRESDIR='"$(POSTGRESDIR)"' \
	-DPGDATADIR='"$(DATADIR)"' \
	-I$(CURDIR)/. -I$(CURDIR)/$(objdir) \
	-I$(CURDIR)/include \
	-I$(CURDIR)/port/$(PORTNAME)

#
# All systems require the math library.
# Loader flags for system-dependent libraries are appended in
#	src/backend/port/$(PORTNAME)/Makefile.inc
#
LDADD+=	-lm

postgres: $(POSTGRES_DEPEND) $(OBJS)
	$(CC) $(LDFLAGS) -o $(objdir)/$(@@F) $(addprefix $(objdir)/,$(OBJS)) $(LDADD)

# Make this target first if you are doing a parallel make.
# The targets in 'first' need to be made sequentially because of dependencies.
# Then, you can make 'all' with parallelism turned on.
first: $(POSTGRES_DEPEND)


#############################################################################
#
# Partial objects for platforms with slow linkers.
#
ifeq ($(BIGOBJS), true)

OBJS_ACCESS:=	   $(SRCS_ACCESS:%.c=$(objdir)/%.o)
OBJS_BOOTSTRAP:=   $(SRCS_BOOTSTRAP:%.c=$(objdir)/%.o)
OBJS_CATALOG:=	   $(SRCS_CATALOG:%.c=$(objdir)/%.o)
OBJS_COMMANDS:=	   $(SRCS_COMMANDS:%.c=$(objdir)/%.o)
OBJS_EXECUTOR:=	   $(SRCS_EXECUTOR:%.c=$(objdir)/%.o)
OBJS_MAIN:=	   $(SRCS_MAIN:%.c=$(objdir)/%.o)
OBJS_POSTMASTER:=  $(SRCS_POSTMASTER:%.c=$(objdir)/%.o)
OBJS_LIB:=	   $(SRCS_LIB:%.c=$(objdir)/%.o)
OBJS_LIBPQ:=	   $(SRCS_LIBPQ:%.c=$(objdir)/%.o)
OBJS_PORT:=	   $(addprefix $(objdir)/,$(subst .s,.o,$(SRCS_PORT:.c=.o)))
OBJS_NODES:=	   $(SRCS_NODES:%.c=$(objdir)/%.o)
OBJS_PARSER:=	   $(SRCS_PARSER:%.c=$(objdir)/%.o)
OBJS_OPTIMIZER:=   $(SRCS_OPTIMIZER:%.c=$(objdir)/%.o)
OBJS_REWRITE:=	   $(SRCS_REWRITE:%.c=$(objdir)/%.o)
OBJS_STORAGE:=	   $(SRCS_STORAGE:%.c=$(objdir)/%.o)
OBJS_TCOP:=	   $(SRCS_TCOP:%.c=$(objdir)/%.o)
OBJS_UTILS:=	   $(SRCS_UTILS:%.c=$(objdir)/%.o)

ACCESS.o:	$(OBJS_ACCESS)
	$(make_partial)
BOOTSTRAP.o:	$(OBJS_BOOTSTRAP)
	$(make_partial)
COMMANDS.o:	$(OBJS_COMMANDS)
	$(make_partial)
EXECUTOR.o:	$(OBJS_EXECUTOR)
	$(make_partial)
MAIN.o:		$(OBJS_MAIN) $(OBJS_POSTMASTER)
	$(make_partial)
MISC.o:		$(OBJS_CATALOG) $(OBJS_LIB) $(OBJS_LIBPQ) $(OBJS_PORT)
	$(make_partial)
NODES.o:	$(OBJS_NODES)
	$(make_partial)
PARSER.o:	$(OBJS_PARSER)
	$(make_partial)
OPTIMIZER.o:	$(OBJS_OPTIMIZER)
	$(make_partial)
REWRITE.o:	$(OBJS_REWRITE)
	$(make_partial)
STORAGE.o:	$(OBJS_STORAGE)
	$(make_partial)
TCOP.o:		$(OBJS_TCOP)
	$(make_partial)
UTILS.o:	$(OBJS_UTILS)
	$(make_partial)
endif

#############################################################################
#
# Installation.
#
# Install the bki files to the data directory.  We also copy a version
# of them that has "PGUID" intact, so one can change the value of the
# postgres userid before running initdb in the case of customizing the
# binary release (i.e., fixing up PGUID w/o recompiling the system).
# Those files are copied out as foo.source.  The program newbki(1) can
# be run later to reset the postgres login id (but it must be run before
# initdb is run, or after clearing the data directory with
# cleardbdir(1)). [newbki distributed with v4r2 but not with Postgres95.]
#

install: beforeinstall pg_id $(BKIFILES) postgres
	$(INSTALL) $(INSTL_EXE_OPTS) $(objdir)/postgres $(DESTDIR)$(BINDIR)/postgres
	@@rm -f $(DESTDIR)$(BINDIR)/postmaster
	cd $(DESTDIR)$(BINDIR); ln -s postgres postmaster
	@@cd $(objdir); \
	PG_UID=`./pg_id $(POSTGRESLOGIN)`; \
	POSTGRESLOGIN=$(POSTGRESLOGIN);\
	case $$PG_UID in "NOUSER") \
		echo "Warning: no account named $(POSTGRESLOGIN), using yours";\
		POSTGRESLOGIN=`whoami`; \
		PG_UID=`./pg_id`;; \
	esac ;\
	for bki in $(BKIFILES); do \
		sed \
		    -e "s/postgres PGUID/$$POSTGRESLOGIN $$PG_UID/" \
		    -e "s/PGUID/$$PG_UID/" \
		    < $$bki > $$bki.sed ; \
		echo "Installing $(DESTDIR)$(DATADIR)/files/$$bki."; \
		$(INSTALL) $(INSTLOPTS) \
		    $$bki.sed $(DESTDIR)$(DATADIR)/files/$$bki; \
		rm -f $$bki.sed; \
		echo "Installing $(DESTDIR)$(DATADIR)/files/$$bki.source."; \
		$(INSTALL) $(INSTLOPTS) \
		    $$bki $(DESTDIR)$(DATADIR)/files/$$bki.source; \
	done;


# so we can get the UID of the postgres owner (w/o moving pg_id to
# src/tools). We just want the vanilla LDFLAGS for pg_id
IDLDFLAGS:= $(LDFLAGS)
ifeq ($(PORTNAME), hpux)
ifeq ($(CC), cc)
IDLDFLAGS+= -Aa -D_HPUX_SOURCE
endif
endif
pg_id:	$(srcdir)/bin/pg_id/pg_id.c
	$(CC) $(IDLDFLAGS) -o $(objdir)/$(@@F) $<

CLEANFILES+= pg_id postgres


#############################################################################
#
# Support for code development.
#

#
# Build the file, "./ID", used by the "gid" (grep-for-identifier) tool
#
IDFILE=	ID
.PHONY: $(IDFILE)
$(IDFILE):
	$(CURDIR)/makeID $(PORTNAME)

#
# 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
#	bmake foo.C
#
%.cpp:	%.c
	$(CC) -E $(CFLAGS) $(<:.C=.c) | cat -s | cb | tr -s '\012*' '\012' > $(objdir)/$(@@F)

cppall: $(SRCS:.c=.cpp)

#
# To use Purify (SunOS only), define PURIFY to be the path (and
# options) with which to invoke the Purify loader.  Only the executable
# needs to be loaded with Purify.
#
#.if defined(PURIFY)
#${PROG}: ${OBJS} ${LIBC} ${DPADD}
#	${PURIFY} ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
#
#CLEANFILES+= .purify* .pure .lock.*.o *_pure_*.o *.pure_*link*
#.endif

@


1.11
log
@remove rules for dependencies and vi tags (which don't work)
@
text
@d10 1
a10 1
#    $Header: /usr/local/devel/pglite/cvs/src/backend/Makefile,v 1.10 1995/04/27 01:34:52 andrew Exp $
d207 1
a207 1
	$(CC) $(IDLDFLAGS) -o $(objdir)/$(@@F) $< $(LDADD)
@


1.10
log
@change the define DATADIR to PGDATADIR (go hassle microsoft for why they
use DATADIR in their include files)
@
text
@d10 1
a10 1
#    $Header: /usr/local/devel/pglite/cvs/src/backend/Makefile,v 1.9 1995/03/23 01:22:33 andrew Exp $
a213 23
# Target dependencies.
#

#
# depend target: since the backend has a bazillion source files, doing
# a mkdep on the whole thing is unwieldly.  This method has a higher
# fixed cost, but we only remake the dependencies we need to and don't
# lose if the mkdep fails on a file.
#

#%.d: %.c
#	mkdep $(MKDEP) ${CFLAGS:M-[ID]*} ${.IMPSRC}; \
#	mv .depend ${.PREFIX}.d

#DSRCS+= ${SRCS:M*.c:S/.c/.d/g}

#depend: .depend
#.depend: ${DSRCS}
#	cat ${DSRCS} > .depend


#############################################################################
#
a217 6
# vi tags (to create emacs tags, do "gmake bigtags" in ../).
#
tags: $(HEADERS)
	echo $^ this is a fake		XXX FIX ME

#
@


1.9
log
@works for hpux, sparc and ultrix4 ports
@
text
@d10 1
a10 1
#    $Header: /usr/local/devel/pglite/cvs/src/backend/Makefile,v 1.8 1995/03/22 19:58:18 andrew Exp $
d84 1
a84 1
	-DDATADIR='"$(DATADIR)"' \
@


1.8
log
@make the big objs depend on $(objdir)/%.o
@
text
@d10 1
a10 1
#    $Header: /usr/local/devel/pglite/cvs/src/backend/Makefile,v 1.7 1995/03/21 06:50:38 andrew Exp $
d56 1
a56 1
CLEANFILES+= $(SRCS:%.c=%.o) $(OBJS)
d58 1
a58 1
OBJS:= $(SRCS:%.c=$(objdir)/%.o)
d97 1
a97 1
	$(CC) $(CDEBUG) -o $(objdir)/$(@@F) $(addprefix $(objdir)/,$(OBJS)) $(LDADD)
d110 20
a129 1
ACCESS.o:	$(SRCS_ACCESS:%.c=$(objdir)/%.o)
d131 1
a131 1
BOOTSTRAP.o:	$(SRCS_BOOTSTRAP:%.c=$(objdir)/%.o)
d133 1
a133 1
COMMANDS.o:	$(SRCS_COMMANDS:%.c=$(objdir)/%.o)
d135 1
a135 1
EXECUTOR.o:	$(SRCS_EXECUTOR:%.c=$(objdir)/%.o)
d137 1
a137 2
MAIN.o:		$(SRCS_MAIN:%.c=$(objdir)/%.o) \
		$(SRCS_POSTMASTER:%.c=$(objdir)/%.o)
d139 1
a139 4
MISC.o:		$(SRCS_CATALOG:%.c=$(objdir)/%.o) \
		$(SRCS_LIB:%.c=$(objdir)/%.o) \
		$(SRCS_LIBPQ:%.c=$(objdir)/%.o) \
		$(SRCS_PORT:%.c=$(objdir)/%.o)
d141 1
a141 1
NODES.o:	$(SRCS_NODES:%.c=$(objdir)/%.o)
d143 1
a143 1
PARSER.o:	$(SRCS_PARSER:%.c=$(objdir)/%.o)
d145 1
a145 1
OPTIMIZER.o:	$(SRCS_OPTIMIZER:%.c=$(objdir)/%.o)
d147 1
a147 1
REWRITE.o:	$(SRCS_REWRITE:%.c=$(objdir)/%.o)
d149 1
a149 1
STORAGE.o:	$(SRCS_STORAGE:%.c=$(objdir)/%.o)
d151 1
a151 1
TCOP.o:		$(SRCS_TCOP:%.c=$(objdir)/%.o)
d153 1
a153 1
UTILS.o:	$(SRCS_UTILS:%.c=$(objdir)/%.o)
@


1.7
log
@switch over to gmake
@
text
@d10 1
a10 1
#    $Header: /usr/local/devel/pglite/cvs/src/backend/Makefile,v 1.6 1995/02/02 00:59:25 jolly Exp $
d58 1
a58 1
OBJS:= $(SRCS:%.c=%.o)
d69 1
a69 1
TIOGA.o: 	$(SRCS_TIOGA:%.c=%.o)
d110 1
a110 1
ACCESS.o:	$(SRCS_ACCESS:%.c=%.o) 
d112 1
a112 1
BOOTSTRAP.o:	$(SRCS_BOOTSTRAP:%.c=%.o)
d114 1
a114 1
COMMANDS.o:	$(SRCS_COMMANDS:%.c=%.o)
d116 1
a116 1
EXECUTOR.o:	$(SRCS_EXECUTOR:%.c=%.o)
d118 2
a119 1
MAIN.o:		$(SRCS_MAIN:%.c=%.o) $(SRCS_POSTMASTER:%.c=%.o)
d121 4
a124 2
MISC.o:		$(SRCS_CATALOG:%.c=%.o) $(SRCS_LIB:%.c=%.o) \
		$(SRCS_LIBPQ:%.c=%.o) $(SRCS_PORT:%.c=%.o)
d126 1
a126 1
NODES.o:	$(SRCS_NODES:%.c=%.o)
d128 1
a128 1
PARSER.o:	$(SRCS_PARSER:%.c=%.o)
d130 1
a130 1
OPTIMIZER.o:	$(SRCS_OPTIMIZER:%.c=%.o)
d132 1
a132 1
REWRITE.o:	$(SRCS_REWRITE:%.c=%.o) 
d134 1
a134 1
STORAGE.o:	$(SRCS_STORAGE:%.c=%.o)
d136 1
a136 1
TCOP.o:		$(SRCS_TCOP:%.c=%.o)
d138 1
a138 1
UTILS.o:	$(SRCS_UTILS:%.c=%.o) 
@


1.6
log
@added Tioga specific targets.   only active if TIOGA is defined.
@
text
@d4 1
a4 1
#    Makefile for the postgres backend and the postmaster
d10 1
a10 1
#    $Header: /usr/local/devel/pglite/cvs/src/backend/Makefile,v 1.5 1995/01/18 22:09:56 jolly Exp $
d15 3
a17 7
# The following turns on intermediate linking of big objects to speed
# the link cycle during development.  It's on by default.  You can
# disable it by commenting out the line in your local copy, or by
# putting:
#	.undef BIGOBJS
# in the file obj/Makefile.global in your main tree.
#
a19 10
.include <postgres.global.mk>

#
# these systems have fast linkers and don't need the BIGOBJ stuff.
#
.if (${PORTNAME} == "aix" || ${PORTNAME} == "linux")
.undef BIGOBJS
.endif

PROG= postgres
d21 1
a21 4
#
# never strip backend
#
STRIP=
d23 2
a24 6
#
# Build the file, "./ID", used by the "gid" (grep-for-identifier) tool
#
IDFILE= ID
${IDFILE}:
	cd ${.CURDIR}; ./makeID ${PORTNAME}
a25 7
#
# We just want the vanilla LDFLAGS for pg_id
#
IDLDFLAGS:= ${LDFLAGS}
.if (${PORTNAME} == "hpux" && ${CC} == "cc")
IDLDFLAGS+= -Aa -D_HPUX_SOURCE
.endif
d27 61
a87 159
#
# This part pulls in the subdirectory partial makefiles.
#
.undef SRCS
.include "${.CURDIR}/access/Makefile.inc"
.if defined (BIGOBJS)
OBJS_ACCESS:= ${SRCS:S/.c/.o/g}
SRCS_ACCESS:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/bootstrap/Makefile.inc"
.if defined (BIGOBJS)
OBJS_BOOTSTRAP:= ${SRCS:S/.c/.o/g}
SRCS_BOOTSTRAP:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/commands/Makefile.inc"
.if defined (BIGOBJS)
OBJS_COMMANDS:= ${SRCS:S/.c/.o/g}
SRCS_COMMANDS:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/executor/Makefile.inc"
.if defined (BIGOBJS)
OBJS_EXECUTOR:= ${SRCS:S/.c/.o/g}
SRCS_EXECUTOR:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/main/Makefile.inc"
.include "${.CURDIR}/postmaster/Makefile.inc"
.if defined (BIGOBJS)
OBJS_MAIN:= ${SRCS:S/.c/.o/g}
SRCS_MAIN:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/catalog/Makefile.inc"
.include "${.CURDIR}/lib/Makefile.inc"
.include "${.CURDIR}/libpq/Makefile.inc"
.if defined (BIGOBJS)
OBJS_MISC:= ${SRCS:S/.c/.o/g}
SRCS_MISC:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/nodes/Makefile.inc"
.if defined (BIGOBJS)
OBJS_NODES:= ${SRCS:S/.c/.o/g}
SRCS_NODES:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/parser/Makefile.inc"
.if defined (BIGOBJS)
OBJS_PARSER:= ${SRCS:S/.c/.o/g}
SRCS_PARSER:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/optimizer/Makefile.inc"
.if defined (BIGOBJS)
OBJS_OPTIMIZER:= ${SRCS:S/.c/.o/g}
SRCS_OPTIMIZER:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/port/Makefile.inc"
.if defined (BIGOBJS)
OBJS_PORT:= ${SRCS:S/.c/.o/g:S/.s/.o/g}
SRCS_PORT:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/rewrite/Makefile.inc"
.if defined (BIGOBJS)
OBJS_REWRITE:= ${SRCS:S/.c/.o/g}
SRCS_REWRITE:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/storage/Makefile.inc"
.if defined (BIGOBJS)
OBJS_STORAGE:= ${SRCS:S/.c/.o/g}
SRCS_STORAGE:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/tcop/Makefile.inc"
.if defined (BIGOBJS)
OBJS_TCOP:= ${SRCS:S/.c/.o/g}
SRCS_TCOP:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/utils/Makefile.inc"
.if defined (BIGOBJS)
OBJS_UTILS:= ${SRCS:S/.c/.o/g}
SRCS_UTILS:= ${SRCS}
SRCS:=
.endif
.include "${.CURDIR}/tioga/Makefile.inc"
.if defined (TIOGA) && defined (BIGOBJS)
OBJS_TIOGA:= ${SRCS:S/.c/.o/g}
SRCS_TIOGA:= ${SRCS}
SRCS:=
.endif

.if defined (BIGOBJS)
SRCS:=	${SRCS_ACCESS} ${SRCS_BOOTSTRAP} ${SRCS_COMMANDS} ${SRCS_EXECUTOR} \
	${SRCS_MAIN} ${SRCS_MISC} ${SRCS_NODES} ${SRCS_PARSER} \
	${SRCS_OPTIMIZER} ${SRCS_PORT} ${SRCS_REWRITE} \
	${SRCS_STORAGE} ${SRCS_TCOP} ${SRCS_UTILS} ${SRCS_TIOGA}

PARTIAL_LINK: .USE 
	${LD} -r -o ${.TARGET} ${.ALLSRC}

ACCESS.o:	${OBJS_ACCESS} PARTIAL_LINK
CLEANFILES+=	${OBJS_ACCESS}
BOOTSTRAP.o:	${OBJS_BOOTSTRAP} PARTIAL_LINK
CLEANFILES+=	${OBJS_BOOTSTRAP}
COMMANDS.o:	${OBJS_COMMANDS} PARTIAL_LINK
CLEANFILES+=	${OBJS_COMMANDS}
EXECUTOR.o:	${OBJS_EXECUTOR} PARTIAL_LINK
CLEANFILES+=	${OBJS_EXECUTOR}
MISC.o:		${OBJS_MISC} ${OBJS_MAIN:S/^main.o$//} PARTIAL_LINK
CLEANFILES+=	${OBJS_MISC} main.o
NODES.o:	${OBJS_NODES} PARTIAL_LINK
CLEANFILES+=	${OBJS_NODES}
PARSER.o:	${OBJS_PARSER} PARTIAL_LINK
CLEANFILES+=	${OBJS_PARSER}
OPTIMIZER.o:	${OBJS_OPTIMIZER} PARTIAL_LINK
CLEANFILES+=	${OBJS_OPTIMIZER}
PORT.o:		${OBJS_PORT} PARTIAL_LINK
CLEANFILES+=	${OBJS_PORT}
REWRITE.o:	${OBJS_REWRITE} PARTIAL_LINK
CLEANFILES+=	${OBJS_REWRITE}
STORAGE.o:	${OBJS_STORAGE} PARTIAL_LINK
CLEANFILES+=	${OBJS_STORAGE}
TCOP.o:		${OBJS_TCOP} PARTIAL_LINK
CLEANFILES+=	${OBJS_TCOP}
UTILS.o:	${OBJS_UTILS} PARTIAL_LINK
CLEANFILES+=	${OBJS_UTILS}
TIOGA.o: 	${OBJS_TIOGA} PARTIAL_LINK
CLEANFILES+=	${OBJS_TIOGA}


.if defined (TIOGA)
SUBOBJS= ACCESS.o BOOTSTRAP.o COMMANDS.o EXECUTOR.o main.o MISC.o NODES.o \
	 PARSER.o OPTIMIZER.o PORT.o REWRITE.o STORAGE.o TCOP.o UTILS.o TIOGA.o
.else
SUBOBJS= ACCESS.o BOOTSTRAP.o COMMANDS.o EXECUTOR.o main.o MISC.o NODES.o \
	 PARSER.o OPTIMIZER.o PORT.o REWRITE.o STORAGE.o TCOP.o UTILS.o
.endif 

.endif

#
# If you change the value of the following you need to "bmake clean;
# bmake".  The only other solution is to track the dependencies, but
# that seems unreasonable.  If you feel inspired, I suppose you could
# "grep -w" the sources for POSTGRESDIR, DATADIR, etc. and make a
# dependency below somewhere.
#
CFLAGS+=  -DPOSTGRESDIR='"${POSTGRESDIR}"' \
	-DDATADIR='"${DATADIR}"' \
	-I${.CURDIR}/. -I${.CURDIR}/${MAKEOBJDIR} \
	-I${.CURDIR}/include \
	-I${.CURDIR}/port/${PORTNAME}
d92 1
a92 1
#	src/backend/port/<port>/Makefile.inc
d96 2
a97 3
#
# == BEGIN MACHINE-SPECIFIC SECTION ==
#
d99 39
a137 11
beforeinstall:
.if defined(OLD_MKDIR)
	@@-if test ! -d ${DESTDIR}${LIBDIR}; \
		then mkdir ${DESTDIR}${LIBDIR}; fi
	@@-if test ! -d ${DESTDIR}${BINDIR}; \
		then mkdir ${DESTDIR}${BINDIR}; fi
	@@-if test ! -d ${DESTDIR}${DATADIR}; \
		then mkdir ${DESTDIR}${DATADIR}; fi
	@@-if test ! -d ${DESTDIR}${DATADIR}/files; \
		then mkdir ${DESTDIR}${DATADIR}/files; fi
.endif
d139 3
d150 1
a150 1
# cleardbdir(1)).
d152 8
a159 6
afterinstall: pg_id
#	${INSTALL} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
#		postmaster ${DESTDIR}${BINDIR}/postmaster
	ln ${LN_OPTIONS} ${DESTDIR}${BINDIR}/postgres ${DESTDIR}${BINDIR}/postmaster
	-PG_UID=`./pg_id ${POSTGRESLOGIN}`; \
	POSTGRESLOGIN=${POSTGRESLOGIN};\
d161 1
a161 1
		echo "Warning: no account named ${POSTGRESLOGIN}, using yours";\
d165 1
a165 1
	for bki in ${BKIFILES}; do \
d170 3
a172 2
		${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
		    $$bki.sed ${DESTDIR}${DATADIR}/files/$$bki; \
d174 18
a191 3
		${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
		    $$bki ${DESTDIR}${DATADIR}/files/$$bki.source; \
	done
d194 1
d196 4
d205 4
a208 10
.SUFFIXES: .d
.c.d:
	mkdep ${MKDEP} ${CFLAGS:M-[ID]*} ${.IMPSRC}; \
	mv .depend ${.PREFIX}.d

DSRCS+= ${SRCS:M*.c:S/.c/.d/g}

depend: .depend
.depend: ${DSRCS}
	cat ${DSRCS} > .depend
d210 1
a210 10
#
# 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
#	bmake foo.C
#
.SUFFIXES: .C
.c.C:
	${CC} -E ${CFLAGS} ${.IMPSRC} | cat -s | cb > ${.TARGET}
d212 3
a214 1
cppall: ${SRCS:S/.c/.C/g}
d217 1
d219 1
a219 3
# To use Purify (SunOS only), define PURIFY to be the path (and
# options) with which to invoke the Purify loader.  Only the executable
# needs to be loaded with Purify.
a220 7
.if defined(PURIFY)
${PROG}: ${OBJS} ${LIBC} ${DPADD}
	${PURIFY} ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}

CLEANFILES+= .purify* .pure .lock.*.o *_pure_*.o *.pure_*link*
.endif

d223 1
a223 2
# so we can get the UID of the postgres owner (w/o moving pg_id to
# src/tools)
d225 2
a226 5
.PATH: ${.CURDIR}/../bin/pg_id
pg_id:	pg_id.c
	${CC} ${IDLDFLAGS} -o ${.TARGET} ${.ALLSRC} ${LDADD}

CLEANFILES+= pg_id
a227 1

d229 1
a229 3
# note:
# any ${PROG} dependencies should go below this .include.
# any ${PROG} creation rules (e.g., PURIFY) should go above this .include.
d231 4
a234 1
.include <postgres.prog.mk>
a235 1

d237 5
a241 1
# Support partial loading of big .o's
d243 2
a244 5
.if defined(BIGOBJS)
CLEANFILES+= ${OBJS}
OBJS= ${SUBOBJS}
${PROG}: ${SUBOBJS}
.endif
d246 1
d249 3
a251 15
# Support creation of symbol export files
#
.if defined(MAKE_EXPORTS)
${PROG}: ${EXPORTS}

installexp: ${EXPORTS}
	for i in ${EXPORTS}; do \
		${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
			$$i ${DESTDIR}${LIBDIR}/$$i; \
	done

all: installexp
.endif


d253 3
a255 3
# We have to set this after the .include so target "all" gets defined.
# This is a bit of a hack.  Could redo the .mk files to handle multiple
# program targets based on a common or overlapping set of sources.
d257 2
a258 13
.PATH: ${.CURDIR}/postmaster
postmaster: postmaster.o postgres ${OBJS}

all: postmaster

# make this target first if you are doing a parallel make.
# the targets in 'first' need to be made sequentially because of dependencies
# then, you can make 'all' with parallelism turned on
first: ${PARSEYACCS} ${BOOTYACCS} scan.c $(GENFMGRTABFILES)

CLEANFILES+= postmaster postmaster.o


@


1.5
log
@added $(GENFMGRTABFILES) to the "first" target.  The fmgr.h and fmgrtab.c
files must be made sequentially before a parallel bmake
@
text
@d10 1
a10 1
#    $Header: /usr/local/devel/pglite/cvs/src/backend/Makefile,v 1.4 1995/01/16 20:48:13 jolly Exp $
d146 6
a151 3

### the following to to get HEADERS from tmp/ (for ctags)
###.include "${.CURDIR}/tmp/Makefile.inc"
d157 1
a157 1
	${SRCS_STORAGE} ${SRCS_TCOP} ${SRCS_UTILS}
d188 2
d191 5
d198 1
@


1.4
log
@removed -DBINDIR, not used
@
text
@d10 1
a10 1
#    $Header: /usr/local/devel/pglite/cvs/src/backend/Makefile,v 1.3 1995/01/05 19:54:08 jolly Exp $
d363 1
a363 1
first: ${PARSEYACCS} ${BOOTYACCS} scan.c
@


1.3
log
@added a target called 'first' for parallel makes.
'first' should be always made sequentially first because there are dependencies
in the targets of 'first'.  After that, the normal 'all' target can be
made with parallelism enabled.
@
text
@d10 1
a10 1
#    $Header: /usr/local/devel/pglite/cvs/src/backend/Makefile,v 1.2 1994/12/26 23:54:33 andrew Exp $
a199 1
	-DBINDIR='"${BINDIR}"' \
@


1.2
log
@fix alignments for doubles (+ changes in pg_attribute.h and pg_type.h)
@
text
@d10 1
a10 1
#    $Header: /usr/local/devel/pglite/cvs/src/backend/Makefile,v 1.1.1.1 1994/11/07 05:19:16 andrew Exp $
d361 5
@


1.1
log
@Initial revision
@
text
@d10 1
a10 1
#    $Header: $
d51 3
@


1.1.1.1
log
@Copyright (c) 1994, POSTGRES Lite   Andrew Yu and Jolly Chen
@
text
@@
