#
# PostgreSQL top level makefile
#
-# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.8 2000/07/17 22:31:56 petere Exp $
+# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.9 2000/07/19 16:29:41 petere Exp $
#
subdir =
$(MAKE) -C src install
@cat $(srcdir)/register.txt
-installdirs uninstall clean:
+installdirs uninstall clean distprep:
$(MAKE) -C doc $@
$(MAKE) -C src $@
# aclocal.m4' or `make configure'.
$(top_srcdir)/aclocal.m4: $(wildcard $(top_srcdir)/config/*.m4)
cat $^ > $@
+
+
+##########################################################################
+
+distdir := postgresql-$(VERSION)
+dummy := =install=
+garbage := =* "#"* ."#"* *~* *.orig *.rej core postgresql-*
+
+
+dist: $(distdir).tar.gz
+ifeq ($(split-dist), yes)
+dist: $(distdir).base.tar.gz $(distdir).docs.tar.gz $(distdir).support.tar.gz $(distdir).test.tar.gz
+endif
+dist:
+ -rm -rf $(distdir)
+
+$(distdir).tar: distdir
+ $(TAR) chf $@ $(distdir)
+
+$(distdir).base.tar: distdir
+ $(TAR) -c $(addprefix --exclude $(distdir)/, doc src/test src/interfaces src/bin) \
+ -f $@ $(distdir)
+
+$(distdir).docs.tar: distdir
+ $(TAR) cf $@ $(distdir)/doc
+
+$(distdir).support.tar: distdir
+ $(TAR) cf $@ $(distdir)/src/interfaces $(distdir)/src/bin
+
+$(distdir).test.tar: distdir
+ $(TAR) cf $@ $(distdir)/src/test
+
+%.gz: %
+ gzip -f --best $<
+ @text="$@ is ready for distribution." ; \
+ frame=`echo "$$text" | sed -e 's/./=/g'` ; \
+ echo "$$frame" ; echo "$$text" ; echo "$$frame"
+
+distdir: distprep
+ -rm -rf $(distdir)* $(install)
+ for x in `cd $(top_srcdir) && find . -name CVS -prune -o -print`; do \
+ file=`expr $$x : '\./\(.*\)'`; \
+ if test -d "$(top_srcdir)/$$file" ; then \
+ mkdir "$(distdir)/$$file" && chmod 777 "$(distdir)/$$file"; \
+ else \
+ ln "$(top_srcdir)/$$file" "$(distdir)/$$file"; \
+ fi || exit; \
+ done
+ $(MAKE) -C $(distdir) distclean
+
+distcheck: dist
+ -rm -rf $(dummy)
+ mkdir $(dummy)
+ gunzip -c $(distdir).tar.gz | $(TAR) xf -
+ install_prefix=`cd $(dummy) && pwd`; \
+ cd $(distdir) \
+ && ./configure --prefix="$$install_prefix"
+ $(MAKE) -C $(distdir) -q distprep
+ $(MAKE) -C $(distdir)
+ $(MAKE) -C $(distdir) install
+ $(MAKE) -C $(distdir) uninstall
+ @echo "checking whether \`$(MAKE) uninstall' works"
+ test `find $(dummy) -not -type d | wc -l` -eq 0
+ $(MAKE) -C $(distdir) dist
+# Room for improvement: Check here whether this distribution tarball
+# is sufficiently similar to the original one.
+ -rm -rf $(distdir) $(dummy)
+ @echo "Distribution integrity checks out."
+
+.PHONY: dist distdir distcheck
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "GNUmakefile
- src/GNUmakefile
- src/Makefile.global
- src/backend/port/Makefile
- src/test/regress/GNUmakefile
+trap 'rm -fr `echo "
+ GNUmakefile
+ src/GNUmakefile
+ src/Makefile.global
+ src/backend/port/Makefile
+ src/test/regress/GNUmakefile
src/include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile
- src/GNUmakefile
- src/Makefile.global
- src/backend/port/Makefile
- src/test/regress/GNUmakefile
+ src/GNUmakefile
+ src/Makefile.global
+ src/backend/port/Makefile
+ src/test/regress/GNUmakefile
"}
EOF
cat >> $CONFIG_STATUS <<\EOF
EOF
cat >> $CONFIG_STATUS <<\EOF
+echo timestamp > src/include/stamp-h
exit 0
EOF
dnl Finally ready to produce output files ...
AC_OUTPUT(
- GNUmakefile
- src/GNUmakefile
- src/Makefile.global
- src/backend/port/Makefile
- src/test/regress/GNUmakefile
+[
+ GNUmakefile
+ src/GNUmakefile
+ src/Makefile.global
+ src/backend/port/Makefile
+ src/test/regress/GNUmakefile
+],
+[echo timestamp > src/include/stamp-h]
)
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.57 2000/07/06 21:33:12 petere Exp $
+# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.58 2000/07/19 16:29:42 petere Exp $
#
#-------------------------------------------------------------------------
include Makefile.global
-all install installdirs uninstall dep depend:
+all install installdirs uninstall dep depend distprep:
$(MAKE) -C backend $@
$(MAKE) -C include $@
$(MAKE) -C interfaces $@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.88 2000/07/17 22:31:59 petere Exp $
+# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.89 2000/07/19 16:29:42 petere Exp $
#
# NOTES
# Essentially all Postgres make files include this file and use the
SNPRINTF = @SNPRINTF@
STRDUP = @STRDUP@
-.PHONY: all install installdirs uninstall dep depend clean distclean maintainer-clean
+.PHONY: all install installdirs uninstall dep depend clean distclean maintainer-clean distprep
.SILENT: installdirs
# make `all' the default target
all:
+
+# Remake Makefile.global from Makefile.global.in if the latter
+# changed. In order to trigger this rule, the including file must
+# write `include $(top_builddir)/src/Makefile.global', not some
+# shortcut thereof.
$(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES=src/Makefile.global CONFIG_HEADERS= ./config.status
+# Remake config.h from config.h.in if the latter changed.
+# config.status will not change the timestamp on config.h if it
+# doesn't change, so as to avoid recompiling the entire tree
+# unnecessarily. Therefore config.status will update a timestamp file
+# everytime it runs so that we don't trigger this rule everytime.
+#
+# Of course you need to turn on dependency tracking to get any
+# dependencies on config.h
+$(top_builddir)/src/include/config.h: $(top_builddir)/src/include/stamp-h
+$(top_builddir)/src/include/stamp-h: $(top_srcdir)/src/include/config.h.in $(top_builddir)/config.status
+ cd $(top_builddir) && CONFIG_FILES= CONFIG_HEADERS=src/include/config.h ./config.status
+
+# When configure changes, rerun configure with the same options as
+# last time. To change configure, you need to run autoconf manually.
$(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.62 2000/07/16 14:50:44 petere Exp $
+# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.63 2000/07/19 16:29:44 petere Exp $
#
#-------------------------------------------------------------------------
##########################################################################
+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
+
+
+##########################################################################
+
install: all installdirs install-bin
ifeq ($(PORTNAME), win)
ifeq ($(MAKE_DLL), true)
installdirs:
$(mkinstalldirs) $(bindir) $(libdir) $(datadir)
-install-bin:
+install-bin: postgres $(POSTGRES_IMP) installdirs
$(INSTALL_PROGRAM) postgres$(X) $(bindir)/postgres$(X)
@rm -f $(bindir)/postmaster
ln -s postgres$(X) $(bindir)/postmaster
$(INSTALL_DATA) $(POSTGRES_IMP) $(libdir)/$(POSTGRES_IMP)
endif
-.PHONY: install installdirs install-bin
+.PHONY: install-bin
##########################################################################
#-------------------------------------------------------------------------
#
-# Makefile--
-# Makefile for the bootstrap module
+# Makefile for the bootstrap module
#
-# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.23 2000/06/07 16:26:37 petere Exp $
-#
-#
-# We must build bootparse.c and bootscanner.c with yacc and lex and sed,
-# but bootstrap.c is part of the distribution.
-#
-# Another kinda weird Makefile cause we need two
-# scanner/parsers in the backend and most yaccs and lexs
-# don't have the prefix option.
-#
-# sed files are HACK CITY! - redo...
+# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.24 2000/07/19 16:29:47 petere Exp $
#
#-------------------------------------------------------------------------
-SRCDIR= ../..
-include $(SRCDIR)/Makefile.global
+subdir = src/backend/bootstrap
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
-ifeq ($(CC), gcc)
+ifeq ($(GCC), yes)
CFLAGS+= -Wno-error
endif
-BOOTYACCS= bootstrap_tokens.h bootparse.c
-
+# qnx4's wlink currently crashes with bootstrap.o
ifneq ($(PORTNAME), qnx4)
OBJS= bootparse.o bootscanner.o bootstrap.o
else
-# qnx4's wlink currently crashes with bootstrap.o
OBJS= bootparse.o bootscanner.o
endif
+
# make sure bootstrap.o is built even on qnx4
all: SUBSYS.o bootstrap.o
SUBSYS.o: $(OBJS)
- $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
+ $(LD) $(LDREL) $(LDOUT) $@ $^
+
-# bootstrap.o's dependency on bootstrap_tokens.h is computed by the
-# make depend, but we state it here explicitly anyway because
-# bootstrap_tokens.h doesn't even exist at first and if user fails to
-# do make depend, we still want the build to succeed.
+bootstrap.o bootscanner.c: $(srcdir)/bootstrap_tokens.h
-bootstrap.o: bootstrap_tokens.h
-bootstrap_tokens.h bootparse.c: bootparse.y
+# `sed' rules to remove conflicts between bootstrap scanner and parser
+# and the SQL scanner and parser. For correctness' sake the rules that
+# use this must depend on this Makefile.
+define sed-magic
+sed -e 's/^yy/Int_yy/g' \
+ -e 's/\([^a-zA-Z0-9_]\)yy/\1Int_yy/g'
+endef
+
+
+$(srcdir)/bootparse.c $(srcdir)/bootstrap_tokens.h: bootparse.y Makefile
$(YACC) -d $(YFLAGS) $<
- grep -v "^#" boot.sed > sedfile
- sed -f sedfile < y.tab.c > bootparse.c
- mv y.tab.h bootstrap_tokens.h
- rm -f y.tab.c sedfile
+ $(sed-magic) < y.tab.c > $(srcdir)/bootparse.c
+ $(sed-magic) < y.tab.h > $(srcdir)/bootstrap_tokens.h
+ rm -f y.tab.c y.tab.h
-bootscanner.c: bootscanner.l
+$(srcdir)/bootscanner.c: bootscanner.l Makefile
$(LEX) $(LFLAGS) $<
- grep -v "^#" boot.sed > sedfile
- sed -f sedfile < lex.yy.c > bootscanner.c
- rm -f lex.yy.c sedfile
+ $(sed-magic) < lex.yy.c > $@
+ rm -f lex.yy.c
clean:
rm -f SUBSYS.o $(OBJS) bootstrap.o
# And the garbage that might have been left behind by partial build:
- rm -f y.tab.h y.tab.c y.output lex.yy.c
+ @rm -f y.tab.h y.tab.c y.output lex.yy.c
+
# This is unusual: We actually have to build some of the parts before
# we know what the header file dependencies are.
#-------------------------------------------------------------------------
#
-# Makefile--
-# Makefile for parser
+# Makefile for parser
#
-# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.27 2000/07/14 15:32:04 thomas Exp $
+# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.28 2000/07/19 16:29:50 petere Exp $
#
#-------------------------------------------------------------------------
-SRCDIR= ../..
-include $(SRCDIR)/Makefile.global
+subdir = src/backend/parser
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
-ifeq ($(CC), gcc)
+ifeq ($(GCC), yes)
CFLAGS+= -Wno-error
endif
parse_expr.o parse_func.o parse_node.o parse_oper.o parse_relation.o \
parse_type.o parse_coerce.o parse_target.o scan.o scansup.o
-all: $(SRCDIR)/include/parser/parse.h SUBSYS.o
-SUBSYS.o: $(OBJS)
- $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
+all: SUBSYS.o
-$(SRCDIR)/include/parser/parse.h: parse.h
- cp $< $@
+SUBSYS.o: $(OBJS)
+ $(LD) $(LDREL) $(LDOUT) $@ $^
-gram.c parse.h: gram.y
+$(srcdir)/gram.c $(srcdir)/parse.h: gram.y
$(YACC) -d $(YFLAGS) $<
- mv y.tab.c gram.c
- mv y.tab.h parse.h
+ mv y.tab.c $(srcdir)/gram.c
+ mv y.tab.h $(srcdir)/parse.h
-scan.c: scan.l
+$(srcdir)/scan.c: scan.l
$(LEX) $(LFLAGS) $<
- mv lex.yy.c scan.c
+ mv lex.yy.c $@
+
-# The following dependencies on parse.h are computed by
-# make depend, but we state them here explicitly anyway because
-# parse.h doesn't even exist at first and if user fails to
-# do make depend, we still want the build to succeed.
+analyze.o keywords.o parse_clause.o parse_expr.o scan.o: $(srcdir)/parse.h
+
+
+# gram.c, parse.h, and scan.c are in the distribution tarball, so they
+# are not cleaned here.
+clean:
+ rm -f SUBSYS.o $(OBJS)
+# And the garbage that might have been left behind by partial build:
+ @rm -f y.tab.c y.tab.h lex.yy.c
-analyze.o keywords.o scan.o: parse.h
# This is unusual: We actually have to build some of the parts before
# we know what the header file dependencies are.
dep depend: gram.c scan.c
$(CC) -MM $(CFLAGS) *.c >depend
-# Remove scan.c from the clean since we want to avoid rebuilding when using
-# the original source distribution. This should help Solaris machines whose
-# lex has trouble with exclusive states.
-# Remove gram.c, parse.h from the clean since we have now started to exceed
-# internal limits for some non-bison yaccs. - thomas 1998-02-17
-clean:
- rm -f SUBSYS.o $(OBJS) # gram.c parse.h # scan.c
-# And the garbage that might have been left behind by partial build:
- rm -f y.tab.c y.tab.h lex.yy.c
-
ifeq (depend,$(wildcard depend))
include depend
endif
-
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.28 2000/07/02 15:20:56 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.29 2000/07/19 16:29:53 petere Exp $
#
#-------------------------------------------------------------------------
DIRS += pgtclsh
endif
-all install installdirs uninstall depend:
- @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit 1; done
+all install installdirs uninstall depend distprep:
+ @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
clean distclean maintainer-clean:
-@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.22 2000/06/28 18:29:31 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.23 2000/07/19 16:29:56 petere Exp $
#
#-------------------------------------------------------------------------
submake:
$(MAKE) -C $(LIBPQDIR) all
+distprep: $(srcdir)/sql_help.h
+
install: all installdirs
$(INSTALL_PROGRAM) psql$(X) $(bindir)/psql$(X)
# Install exported headers to the include directory (these headers are
# the minimal ones needed to build loadable backend extensions).
#
-# $Header: /cvsroot/pgsql/src/include/Makefile,v 1.1 2000/07/06 21:33:44 petere Exp $
+# $Header: /cvsroot/pgsql/src/include/Makefile,v 1.2 2000/07/19 16:29:58 petere Exp $
#
#-------------------------------------------------------------------------
rm -f utils/fmgroids.h parser/parse.h
distclean maintainer-clean: clean
- rm -f config.h dynloader.h os.h
+ rm -f config.h dynloader.h os.h stamp-h
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.40 2000/06/28 18:29:35 petere Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.41 2000/07/19 16:30:06 petere Exp $
#
#-------------------------------------------------------------------------
endif
-all install installdirs uninstall dep depend:
- @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit 1; done
+all install installdirs uninstall dep depend distprep:
+ @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
clean:
@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
top_builddir = ../../..
include ../../Makefile.global
-all install installdirs uninstall dep depend:
+all install installdirs uninstall dep depend distprep:
$(MAKE) -C include $@
$(MAKE) -C lib $@
$(MAKE) -C preproc $@
$(LEX) $(LFLAGS) $<
mv lex.yy.c $@
+distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
+
install: all installdirs
$(INSTALL_PROGRAM) ecpg$(X) $(bindir)
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/pl/Makefile,v 1.10 2000/07/01 15:02:27 petere Exp $
+# $Header: /cvsroot/pgsql/src/pl/Makefile,v 1.11 2000/07/19 16:30:16 petere Exp $
#
#-------------------------------------------------------------------------
#DIRS += plperl
#endif
-all install installdirs uninstall depend:
- @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit 1; done
+all install installdirs uninstall depend distprep:
+ @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
clean distclean maintainer-clean:
@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/pl/plpgsql/Makefile,v 1.3 2000/06/27 00:31:56 petere Exp $
+# $Header: /cvsroot/pgsql/src/pl/plpgsql/Makefile,v 1.4 2000/07/19 16:30:21 petere Exp $
#
#-------------------------------------------------------------------------
top_builddir = ../../..
include ../../Makefile.global
-all install installdirs uninstall:
+all install installdirs uninstall distprep:
$(MAKE) -C src $@
clean distclean maintainer-clean:
#
# Makefile for the plpgsql shared object
#
-# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.4 2000/06/28 18:30:16 petere Exp $
+# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.5 2000/07/19 16:30:24 petere Exp $
#
#-------------------------------------------------------------------------
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < lex.yy.c > $@
rm -f lex.yy.c
+
+distprep: $(srcdir)/pl_scan.c $(srcdir)/pl.tab.h $(srcdir)/pl_gram.c
+
mklang.sql: mklang.sql.in
sed -e 's%__libdir__%$(libdir)%g' -e 's%__DLSUFFIX__%$(DLSUFFIX)%g' < $< > $@
-#!/bin/sh
+#! /bin/sh
#
# release_prep: prepare the Postgres source tree for distribution
#
# Run the script from the toplevel Postgres directory, ie, do
# cd pgsql
# src/tools/release_prep
-# (Right now, the cleanup tasks are all in the src subdirectory, but we
-# might want to add housekeeping in doc too?)
#
# The script's tasks are:
# 1. Run configure to prepare usable Makefiles on the local system.
# 2. Generate distribution copies of some derived files such as gram.c.
# (We do this so that recipients of the distribution don't have to have
# tools that can create these files.)
-# Note we force these files to be recreated, to ensure they will have
-# newer timestamps than their master files.
# 3. "make distclean" to get rid of the configure outputs, as well as any
# other cruft that might be laying about.
# Select make to use --- default gmake, can be overridden by env var
-MAKE=${MAKE:-gmake}
-
-# Configure ... should we run autoconf here???
-
-./configure
-
-# Generate parser's yacc and lex files
-
-cd src/backend/parser
-rm -f gram.c parse.h scan.c
-$MAKE gram.c parse.h scan.c
-cd ../../..
-
-# Generate bootstrap parser's yacc and lex files
-
-cd src/backend/bootstrap
-rm -f bootstrap_tokens.h bootparse.c bootscanner.c
-$MAKE bootstrap_tokens.h bootparse.c bootscanner.c
-cd ../../..
-
-# Generate configuration file scanner
-
-cd src/backend/utils/misc
-rm -f guc-file.c lex.yy.c
-$MAKE guc-file.c
-cd ../../../..
-
-# Generate ecpg preprocessor's yacc and lex files
-
-cd src/interfaces/ecpg/preproc
-rm -f preproc.c preproc.h pgc.c
-$MAKE preproc.c preproc.h pgc.c
-cd ../../../..
-
-# Generate plpgsql's yacc and lex files
-
-cd src/pl/plpgsql/src
-rm -f pl_scan.c pl.tab.h pl_gram.c
-$MAKE pl_scan.c pl.tab.h pl_gram.c
-cd ../../../..
-
-# Generate psql's help on SQL command from the SGML docs
-
-cd src/bin/psql
-rm -f sql_help.h
-$MAKE sql_help.h
-cd ../../..
-
-# Clean up
+: ${MAKE=gmake}
+./configure && \
+$MAKE distprep && \
$MAKE distclean
-
-exit 0