head	1.42;
access;
symbols
	release_4_2:1.42
	aix_ok:1.34;
locks; strict;
comment	@# @;


1.42
date	94.01.30.05.23.01;	author aoki;	state Exp;
branches;
next	1.41;

1.41
date	94.01.29.00.57.32;	author aoki;	state Exp;
branches;
next	1.40;

1.40
date	94.01.18.21.48.25;	author aoki;	state Exp;
branches;
next	1.39;

1.39
date	94.01.18.10.11.03;	author aoki;	state Exp;
branches;
next	1.38;

1.38
date	94.01.18.09.36.45;	author aoki;	state Exp;
branches;
next	1.37;

1.37
date	93.12.27.23.40.36;	author jolly;	state Exp;
branches;
next	1.36;

1.36
date	93.12.12.23.15.57;	author aoki;	state Exp;
branches;
next	1.35;

1.35
date	93.11.06.03.16.06;	author aoki;	state Exp;
branches;
next	1.34;

1.34
date	93.10.02.02.03.33;	author aoki;	state Exp;
branches;
next	1.33;

1.33
date	93.10.01.20.24.33;	author aoki;	state Exp;
branches;
next	1.32;

1.32
date	93.09.30.17.53.32;	author aoki;	state Exp;
branches;
next	1.31;

1.31
date	93.09.30.00.30.53;	author aoki;	state Exp;
branches;
next	1.30;

1.30
date	93.09.27.04.57.11;	author aoki;	state Exp;
branches;
next	1.29;

1.29
date	93.08.09.19.11.14;	author aoki;	state Exp;
branches;
next	1.28;

1.28
date	93.08.04.11.02.54;	author aoki;	state Exp;
branches;
next	1.27;

1.27
date	93.07.29.00.38.16;	author andrew;	state Exp;
branches;
next	1.26;

1.26
date	93.07.28.23.41.43;	author aoki;	state Exp;
branches;
next	1.25;

1.25
date	93.07.14.02.24.26;	author aoki;	state Exp;
branches;
next	1.24;

1.24
date	93.07.14.02.19.31;	author aoki;	state Exp;
branches;
next	1.23;

1.23
date	93.07.13.00.41.36;	author olson;	state Exp;
branches;
next	1.22;

1.22
date	93.07.10.03.11.27;	author aoki;	state Exp;
branches;
next	1.21;

1.21
date	93.07.02.03.05.19;	author aoki;	state Exp;
branches;
next	1.20;

1.20
date	93.06.26.18.45.48;	author aoki;	state Exp;
branches;
next	1.19;

1.19
date	93.06.24.04.07.41;	author aoki;	state Exp;
branches;
next	1.18;

1.18
date	93.06.16.05.05.24;	author aoki;	state Exp;
branches;
next	1.17;

1.17
date	93.06.14.21.23.34;	author marc;	state Exp;
branches;
next	1.16;

1.16
date	93.04.14.19.57.56;	author aoki;	state Exp;
branches;
next	1.15;

1.15
date	93.03.21.08.47.04;	author aoki;	state Exp;
branches;
next	1.14;

1.14
date	93.03.11.21.09.39;	author marc;	state Exp;
branches;
next	1.13;

1.13
date	93.03.04.03.15.41;	author andrew;	state Exp;
branches;
next	1.12;

1.12
date	93.03.03.01.06.31;	author marc;	state Exp;
branches;
next	1.11;

1.11
date	93.02.18.02.41.48;	author marc;	state Exp;
branches;
next	1.10;

1.10
date	93.02.12.23.38.23;	author marc;	state Exp;
branches;
next	1.9;

1.9
date	92.12.18.23.42.26;	author mao;	state Exp;
branches;
next	1.8;

1.8
date	92.12.16.02.55.34;	author aoki;	state Exp;
branches;
next	1.7;

1.7
date	92.12.15.02.44.56;	author marc;	state Exp;
branches;
next	1.6;

1.6
date	92.12.13.05.43.49;	author olson;	state Exp;
branches;
next	1.5;

1.5
date	92.12.13.03.52.04;	author olson;	state Exp;
branches;
next	1.4;

1.4
date	92.12.02.22.35.15;	author marc;	state Exp;
branches;
next	1.3;

1.3
date	92.11.24.21.37.36;	author mao;	state Exp;
branches;
next	1.2;

1.2
date	92.11.24.21.33.53;	author marc;	state Exp;
branches;
next	1.1;

1.1
date	92.11.11.19.32.42;	author marc;	state Exp;
branches;
next	;


desc
@@


1.42
log
@whoops, the sed script wasn't always changing PGUID
@
text
@#
# $Header: /import/faerie/faerie/aoki/postgres/src/backend/RCS/Makefile,v 1.41 1994/01/29 00:57:32 aoki Exp aoki $
#

#
# 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.
#
BIGOBJS= true

.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

#
# never strip backend
#
STRIP=

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

#
# We just want the vanilla LDFLAGS for pg_id
#
IDLDFLAGS:= ${LDFLAGS}

#
# 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"
.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}/planner/Makefile.inc"
.if defined (BIGOBJS)
OBJS_PLANNER:= ${SRCS:S/.c/.o/g}
SRCS_PLANNER:= ${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}/rules/Makefile.inc"
.if defined (BIGOBJS)
OBJS_RULES:= ${SRCS:S/.c/.o/g}
SRCS_RULES:= ${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

# the following to to get HEADERS from tmp/ (for ctags)

.include "${.CURDIR}/tmp/Makefile.inc"

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

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}
PLANNER.o:	${OBJS_PLANNER} PARTIAL_LINK
CLEANFILES+=	${OBJS_PLANNER}
PORT.o:		${OBJS_PORT} PARTIAL_LINK
CLEANFILES+=	${OBJS_PORT}
REWRITE.o:	${OBJS_REWRITE} PARTIAL_LINK
CLEANFILES+=	${OBJS_REWRITE}
RULES.o:	${OBJS_RULES} PARTIAL_LINK
CLEANFILES+=	${OBJS_RULES}
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}
SUBOBJS= ACCESS.o BOOTSTRAP.o COMMANDS.o EXECUTOR.o main.o MISC.o NODES.o \
	 PARSER.o PLANNER.o PORT.o REWRITE.o RULES.o STORAGE.o TCOP.o UTILS.o

.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}"' \
	-DBINDIR='"${BINDIR}"' \
	-I${.CURDIR}/. -I${.CURDIR}/${MAKEOBJDIR} \
	-I${.CURDIR}/tmp \
	-I${.CURDIR}/port/${PORTNAME}

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

#
# == BEGIN MACHINE-SPECIFIC SECTION ==
#

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

#
# 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)).
#
afterinstall: pg_id
	${INSTALL} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
		postmaster ${DESTDIR}${BINDIR}/postmaster
	-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 ; \
		${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
		    $$bki.sed ${DESTDIR}${DATADIR}/files/$$bki; \
		rm -f $$bki.sed; \
		${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
		    $$bki ${DESTDIR}${DATADIR}/files/$$bki.source; \
	done


#
# 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.
#
.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

#
# 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}

cppall: ${SRCS:S/.c/.C/g}


#
# 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


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

CLEANFILES+= pg_id


#
# note:
# any ${PROG} dependencies should go below this .include.
# any ${PROG} creation rules (e.g., PURIFY) should go above this .include.
#
.include <postgres.prog.mk>


#
# Support partial loading of big .o's
#
.if defined(BIGOBJS)
CLEANFILES+= ${OBJS}
OBJS= ${SUBOBJS}
${PROG}: ${SUBOBJS}
.endif


#
# 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


#
# 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.
#
.PATH: ${.CURDIR}/postmaster
postmaster: postmaster.o ${OBJS}
	${CC} ${LDFLAGS} -o ${.TARGET} postmaster.o ${OBJS:S/^main.o$//} ${LDADD}
all: postmaster

CLEANFILES+= postmaster postmaster.o
@


1.41
log
@don't add backend port-specific flags to pg_id's LDFLAGS
@
text
@d2 1
a2 1
# $Header: /usr/local/devel/postgres/src/backend/RCS/Makefile,v 1.40 1994/01/18 21:48:25 aoki Exp aoki $
d244 3
a246 1
		sed -e "s/postgres PGUID/$$POSTGRESLOGIN $$PG_UID/" \
@


1.40
log
@whoops, was testing something and forgot to un-comment BIGOBJS
@
text
@d2 1
a2 1
# $Header: /usr/local/devel/postgres/src/backend/RCS/Makefile,v 1.39 1994/01/18 10:11:03 aoki Exp aoki $
d39 5
d304 1
a304 1
	${CC} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} ${LDADD}
@


1.39
log
@fix depend
@
text
@d2 1
a2 1
# $Header: /faerie/aoki/postgres/src/backend/RCS/Makefile,v 1.38 1994/01/18 09:36:45 aoki Exp aoki $
d13 1
a13 1
#BIGOBJS= true
@


1.38
log
@there's assembler in port/ now
@
text
@d2 1
a2 1
# $Header: /import/faerie/faerie/aoki/postgres/src/backend/RCS/Makefile,v 1.37 1993/12/27 23:40:36 jolly Exp aoki $
d260 1
a260 1
DSRCS+= ${SRCS:S/.c/.d/g}
@


1.37
log
@fixed a small problem with using the POSTGRESLOGIN environment variable
in generating bki files
@
text
@d2 1
a2 1
# $Header: /private/postgres/src/backend/RCS/Makefile,v 1.36 1993/12/12 23:15:57 aoki Exp jolly $
d13 1
a13 1
BIGOBJS= true
d100 1
a100 1
OBJS_PORT:= ${SRCS:S/.c/.o/g}
@


1.36
log
@if there is no postgres user, make the current user the superuser
@
text
@d2 1
a2 1
# $Header: /faerie/aoki/postgres/src/backend/RCS/Makefile,v 1.35 1993/11/06 03:16:06 aoki Exp aoki $
d232 1
@


1.35
log
@added LDADD to pg_id
@
text
@d2 1
a2 1
# $Header: /usr/local/devel/postgres/src/backend/RCS/Makefile,v 1.34 1993/10/02 02:03:33 aoki Exp aoki $
d234 1
d238 2
a239 1
		sed "s/PGUID/$$PG_UID/" < $$bki > $$bki.sed ; \
@


1.34
log
@whoops.  messed up .exp order dependency (aix only)
@
text
@d2 1
a2 1
# $Header: /usr/local/devel/postgres/src/backend/RCS/Makefile,v 1.33 1993/10/01 20:24:33 aoki Exp aoki $
d296 1
a296 1
	${CC} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} 
@


1.33
log
@moved extra rules around (again)
@
text
@d2 1
a2 1
# $Header: /faerie/aoki/postgres/src/backend/RCS/Makefile,v 1.32 1993/09/30 17:53:32 aoki Exp aoki $
d327 1
a327 1
		${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
d331 1
a331 1
afterinstall: installexp
@


1.32
log
@moved some stuff around for purify
@
text
@d2 1
a2 1
# $Header: /faerie/aoki/postgres/src/backend/RCS/Makefile,v 1.31 1993/09/30 00:30:53 aoki Exp aoki $
a275 15
#
# Support creation of symbol export files
#
.if defined(MAKE_EXPORTS)
${PROG}: ${EXPORTS}

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

afterinstall: installexp
.endif

d301 5
d317 16
@


1.31
log
@gotta hate those && and ||s
@
text
@d2 1
a2 1
# $Header: /faerie/aoki/postgres/src/backend/RCS/Makefile,v 1.30 1993/09/27 04:57:11 aoki Exp aoki $
a275 12
.include <postgres.prog.mk>

#
# Support partial loading of big .o's
#
.if defined(BIGOBJS)
CLEANFILES+= ${OBJS}
OBJS= ${SUBOBJS}
${PROG}: ${SUBOBJS}
.endif


a296 3
# (This has to be after <postgres.prog.mk>, which unconditionally
#  redefines the PROG target :-P)
#
d300 2
d315 13
@


1.30
log
@aix
(exports file generation)
@
text
@d2 1
a2 1
# $Header: /home2/aoki/master/src/backend/RCS/Makefile,v 1.29 1993/08/09 19:11:14 aoki Exp $
d20 1
a20 1
.if (${PORTNAME} == "aix" && ${PORTNAME} == "linux")
@


1.29
log
@put PURIFY back in here -- postgres.prog.mk unconditionally redefines
PROG :-P
@
text
@d2 1
a2 1
# $Header: /home2/aoki/master/src/backend/RCS/Makefile,v 1.28 1993/08/04 11:02:54 aoki Exp aoki $
d4 2
d17 7
d206 1
d208 2
a209 1
beforeinstall:
d212 4
a230 6
.if defined(OLD_MKDIR)
	@@-if test ! -d ${DESTDIR}${DATADIR}; \
		then mkdir ${DESTDIR}${DATADIR}; fi
	@@-if test ! -d ${DESTDIR}${DATADIR}/files; \
		then mkdir ${DESTDIR}${DATADIR}/files; fi
.endif
a244 10
#
# so we can get the UID of the postgres owner (w/o moving pg_id to
# src/tools)
#
.PATH: ${.CURDIR}/../bin/pg_id
pg_id:	pg_id.c
	${CC} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} 

CLEANFILES+= pg_id

d287 17
d317 12
@


1.28
log
@moved port-dependent cruft into port/<foo>/Makefile.inc
@
text
@d2 1
a2 1
# $Header$
d286 13
@


1.27
log
@DLD now gone.
@
text
@d2 6
a7 4
# 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:
d14 1
a14 3
#
# Use "bmake" (BSD 4.4 make) to run this Makefile
#
d173 5
a177 5
# If you change the value of the following you need to "bmake clean; bmake"
# Only other solution is to track the dependecies, but that seems
# unreasonable.  But if you feel inspired, I suppose you could grep -w
# the sources for POSTGRESDIR, DATADIR, etc and make a dependency
# below somewhere (wouldn't larry wall do that ;)?
d187 3
a189 1
# == BEGIN MACHINE-SPECIFIC SECTION ==
d191 1
a192 1
LDADD+=	-lm
d194 1
a194 1
# Linux needs the BSD ipc library
a195 20
.if (${PORTNAME} == "linux")
LDADD+= -lipc
#
# HP-UX needs:
# -Wl,-E - export symbols for linking with the shared libraries dynamic loader
# -Wp,-H400000 - expand cpp #define table size so Nodes files don't break it
#
.elif (${PORTNAME} == "hpux")
CFLAGS+= -W l,-E -W p,-H400000
LDFLAGS+= -W l,-E
LDADD+= -ll -ldld
.else
LDADD+=	-lln
#
# neither purify (SPARC) nor pixie (MIPS/Alpha) can handle OMAGIC files.
#
.  if (!defined(PROFILE) && !defined(PURIFY))
LDADD+= -N 
.  endif
.endif
d204 8
a211 9
# 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)).
d237 2
a238 1
# so we can get the UID of the postgres owner (w/o moving pg_id to tools/)
d246 6
a251 6
###
# depend target: since the backend has a bazillion source
#	files, doing a mkdep on the whole thing is unweildly. This
#	method has a higher fixed cost, but we only remake the
#	dependecies we need to and don't lose if the mkdep fails on
#	a file.
d265 4
a268 4
# 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
#
a276 10
#
# 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}
.endif

d289 3
a291 4
# (have to set this after the .include so target "all" gets defined)
# Bit of a hack.  Could redo .mk files to handle multiple
# program targets based on a common or overlapping set of
# sources.
@


1.26
log
@MAKEOBJDIR changes
@
text
@a185 4
.if defined(USE_DLD)
LDADD+= -ldld 
.endif

@


1.25
log
@whoops, forgot to @@ out the test's
@
text
@d182 1
a182 1
	-I${.CURDIR}/. -I${.CURDIR}/obj \
@


1.24
log
@added mkdir for BINDIR
@
text
@d221 1
a221 1
	-if test ! -d ${DESTDIR}${BINDIR}; \
d240 1
a240 1
	-if test ! -d ${DESTDIR}${DATADIR}; \
d242 1
a242 1
	-if test ! -d ${DESTDIR}${DATADIR}/files; \
@


1.23
log
@add target for the "ID" file used by the gid/lid tools
@
text
@d219 6
@


1.22
log
@parameterized NOFIXADE
@
text
@d23 7
@


1.21
log
@made the compilation line look like the system .mk files
so that LDFLAGS will be used.
@
text
@a212 9
# this turns off unaligned access fixup.
# (it's not a DEC builtin -- it invokes an explicit Ultrix syscall --
# so defining this anywhere else is useless.)
#
.if (${PORTNAME} == "ultrix4")
CFLAGS+= -DNOFIXADE
.endif

#
d282 1
a282 2
	${CC} -E ${CFLAGS} ${.IMPSRC} | cat -s > ${.TARGET}; \
	indent ${.TARGET}
d284 7
@


1.20
log
@if you set PURIFY=purify (or whatever you need to find it with
your PATH) the backend will build using Purify.

changed the postmaster ld statement to use LDFLAGS instead of
CFLAGS.
@
text
@d260 1
a260 1
	${CC} -o pg_id ${.ALLSRC} 
@


1.19
log
@added flags needed to build backend under hpux.
-W l,-E means export symbols for dynamic loading
-W p,-H400000 is so that the giant #define files will compile
without making cpp explode first
parameterized "install"
@
text
@d188 3
d193 5
d204 4
a207 1
.  ifndef PROFILE
d213 3
a215 2
# this turns off unaligned access fixup
# (it invokes a POSTGRES interface to syscall, it's not a DEC built-in)
d294 5
d318 1
a318 1
	${CC} ${CFLAGS} -o postmaster postmaster.o ${OBJS:S/^main.o$//} ${LDADD}
@


1.18
log
@cleaned up some old cruft (y.output no longer produced
parameterized old mkdir
cleanup of blahblah.sed files
added a linux compat section for libraries
@
text
@d187 1
d189 5
a193 1
LDADD+= -lm -lipc
d195 2
a196 1
.ifndef PROFILE
d198 1
a199 2
LDADD+=	-lm -lln
.endif
d221 1
a221 1
	install ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
d236 1
a236 1
		install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
d239 1
a239 1
		install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
@


1.17
log
@put a Makefile.inc in the tmp/ directory so we can teach ctags to scan
the tmp/*.h files.
@
text
@a162 4
.if defined(USE_DLD)
LDADD+= -ldld 
.endif

d176 1
d179 11
a192 1

d194 1
d197 2
a198 1
# XXX - grot: rename tmp to something sensible
d200 1
a200 3
CFLAGS+= -I${.CURDIR}/tmp

.if ${PORTNAME} == "ultrix4"
a204 5
# XXX - who makes this?
#
CLEANFILES+= y.output

#
d218 1
a218 5
.if ${PORTNAME} == "sparc"
#
# 	actually, if mkdir doesn't have the -p flag.  we'll paramaterize
# 	all this stuff in the next release so please bear with us.
#
d233 1
@


1.16
log
@pg_id was called "pg_ig" in CLEANFILES
@
text
@d116 8
a201 3
# TODO: include tmp/*.h and port/?/*.h files in $HEADERS


@


1.15
log
@don't use ld -N with profiling (it doesn't work).
@
text
@d241 1
a241 1
CLEANFILES+= pg_ig
@


1.14
log
@don't fail on failed test commands
@
text
@d174 5
a178 1
LDADD+=	-N -lm -lln
@


1.13
log
@additions for GNU dynamic loader stuff
@
text
@d212 1
a212 1
	if test ! -d ${DESTDIR}${DATADIR}; \
d214 1
a214 1
	if test ! -d ${DESTDIR}${DATADIR}/files; \
d217 1
a217 1
	PG_UID=`./pg_id ${POSTGRESLOGIN}`; \
@


1.12
log
@copy out *bki.source to data/ dir too, so we can change the PGUID later
@
text
@d154 5
@


1.11
log
@more files to clean
@
text
@d3 1
a3 1
# to spped the link cycle during development.  It's on by default.
d157 1
a157 1
# If you change the value of the folowing you need to "bmake clean; bmake"
d161 1
a161 1
# below somewhere.  Wouldn't larry wall do that?
d188 11
d221 2
@


1.10
log
@use pg_id to get postgres login UID
@
text
@d219 2
d272 2
@


1.9
log
@add -DNOFIXADE for ultrix4 to keep the damned kernel from screwing around
with bad pointers
@
text
@d188 1
a188 1
afterinstall:
d191 15
d207 1
a207 1
		sed "s/PGUID/`egrep '^postgres' /etc/passwd | sed -e 's/^[^:]*:[^:]*://' -e 's/:.*//'`/g" < $$bki > $$bki.sed ; \
d212 7
d220 1
a220 1
# `depend' experiment: since the backend has a bazillion source
d223 2
a224 1
#	dependecies we need to.
@


1.8
log
@initial load of stuff for ACLs
@
text
@d176 4
@


1.7
log
@make clean

wasn't working for big objects
@
text
@d188 1
d190 1
a190 1
		    $$bki ${DESTDIR}${DATADIR}/files/$$bki; \
@


1.6
log
@*** empty log message ***
@
text
@d125 1
d127 1
d129 1
d131 1
d133 1
d135 1
d137 1
d139 1
d141 1
d143 1
d145 1
d147 1
d149 1
d151 1
@


1.5
log
@fix for compiling postmaster on SunOS
@
text
@d128 1
a128 2
main.o:		${OBJS_MAIN} PARTIAL_LINK
MISC.o:		${OBJS_MISC} PARTIAL_LINK
@


1.4
log
@support large objects
@
text
@d50 6
a58 1
.include "${.CURDIR}/main/Makefile.inc"
d117 3
a119 3
	${SRCS_MISC} ${SRCS_NODES} ${SRCS_PARSER} ${SRCS_PLANNER} \
	${SRCS_PORT} ${SRCS_REWRITE} ${SRCS_RULES} ${SRCS_STORAGE} \
	${SRCS_TCOP} ${SRCS_UTILS}
d128 1
d139 2
a140 2
SUBOBJS= ACCESS.o BOOTSTRAP.o COMMANDS.o EXECUTOR.o MISC.o NODES.o PARSER.o \
	 PLANNER.o PORT.o REWRITE.o RULES.o STORAGE.o TCOP.o UTILS.o
@


1.3
log
@LDADD needs -N to permit dynamic linking to work with the backend
@
text
@d1 10
d25 1
d27 5
d33 5
a37 1
.include "${.CURDIR}/catalog/Makefile.inc"
d39 5
d45 6
d54 5
d60 5
d66 5
d72 5
d78 5
d84 5
d90 5
d96 5
d102 5
d108 28
d203 9
@


1.2
log
@checkpoint
@
text
@d46 1
a46 1
LDADD=	-lm -lln
@


1.1
log
@Initial revision
@
text
@d7 8
d34 5
a38 1
# If you change the folowing you need to "bmake clean; bmake"
d40 3
a42 2
CFLAGS+=  -DPOSTGRESHOME='"${POSTGRESHOME}"' \
	-DPOSTGRESDATA='"${POSTGRESDATA}"' \
d47 2
d50 1
a50 1
# - TRY REMOVING THIS AND SEE WHAT BREAKS
d53 1
d55 1
d60 40
d101 2
a102 1
# Bit of a hack.  Should redo .mk files to handle multiple
d108 2
a109 8
	${CC} -o postmaster postmaster.o ${OBJS:S/^main.o$//} ${LDADD}

# all: postmaster

# install: postmaster
	

.include <postgres.prog.mk>
@
