1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Makefile cleanup for bin and pl subtrees. They should now support

all the standard semantics. Also get rid of Makefile.in's on the
way and instead declare all variables in Makefile.global.
This commit is contained in:
Peter Eisentraut
2000-06-27 00:32:06 +00:00
parent ecef326850
commit 5bb8b62983
31 changed files with 597 additions and 640 deletions

14
configure vendored
View File

@ -8875,11 +8875,8 @@ trap 'rm -fr `echo "GNUmakefile
src/backend/port/Makefile src/backend/port/Makefile
src/backend/catalog/genbki.sh src/backend/catalog/genbki.sh
src/backend/utils/Gen_fmgrtab.sh src/backend/utils/Gen_fmgrtab.sh
src/bin/pg_dump/Makefile
src/bin/pg_version/Makefile
src/bin/pgtclsh/mkMakefile.tcldefs.sh src/bin/pgtclsh/mkMakefile.tcldefs.sh
src/bin/pgtclsh/mkMakefile.tkdefs.sh src/bin/pgtclsh/mkMakefile.tkdefs.sh
src/bin/psql/Makefile
src/include/version.h src/include/version.h
src/interfaces/Makefile src/interfaces/Makefile
src/interfaces/libpq/Makefile src/interfaces/libpq/Makefile
@ -8891,11 +8888,7 @@ trap 'rm -fr `echo "GNUmakefile
src/interfaces/libpgtcl/Makefile src/interfaces/libpgtcl/Makefile
src/interfaces/odbc/GNUmakefile src/interfaces/odbc/GNUmakefile
src/interfaces/python/GNUmakefile src/interfaces/python/GNUmakefile
src/pl/Makefile
src/pl/plpgsql/Makefile
src/pl/plpgsql/src/Makefile
src/pl/tcl/mkMakefile.tcldefs.sh src/pl/tcl/mkMakefile.tcldefs.sh
src/pl/plperl/GNUmakefile
src/test/regress/GNUmakefile src/test/regress/GNUmakefile
src/include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 src/include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF EOF
@ -9066,11 +9059,8 @@ CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile
src/backend/port/Makefile src/backend/port/Makefile
src/backend/catalog/genbki.sh src/backend/catalog/genbki.sh
src/backend/utils/Gen_fmgrtab.sh src/backend/utils/Gen_fmgrtab.sh
src/bin/pg_dump/Makefile
src/bin/pg_version/Makefile
src/bin/pgtclsh/mkMakefile.tcldefs.sh src/bin/pgtclsh/mkMakefile.tcldefs.sh
src/bin/pgtclsh/mkMakefile.tkdefs.sh src/bin/pgtclsh/mkMakefile.tkdefs.sh
src/bin/psql/Makefile
src/include/version.h src/include/version.h
src/interfaces/Makefile src/interfaces/Makefile
src/interfaces/libpq/Makefile src/interfaces/libpq/Makefile
@ -9082,11 +9072,7 @@ CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile
src/interfaces/libpgtcl/Makefile src/interfaces/libpgtcl/Makefile
src/interfaces/odbc/GNUmakefile src/interfaces/odbc/GNUmakefile
src/interfaces/python/GNUmakefile src/interfaces/python/GNUmakefile
src/pl/Makefile
src/pl/plpgsql/Makefile
src/pl/plpgsql/src/Makefile
src/pl/tcl/mkMakefile.tcldefs.sh src/pl/tcl/mkMakefile.tcldefs.sh
src/pl/plperl/GNUmakefile
src/test/regress/GNUmakefile src/test/regress/GNUmakefile
"} "}
EOF EOF

View File

@ -1193,11 +1193,8 @@ AC_OUTPUT(
src/backend/port/Makefile src/backend/port/Makefile
src/backend/catalog/genbki.sh src/backend/catalog/genbki.sh
src/backend/utils/Gen_fmgrtab.sh src/backend/utils/Gen_fmgrtab.sh
src/bin/pg_dump/Makefile
src/bin/pg_version/Makefile
src/bin/pgtclsh/mkMakefile.tcldefs.sh src/bin/pgtclsh/mkMakefile.tcldefs.sh
src/bin/pgtclsh/mkMakefile.tkdefs.sh src/bin/pgtclsh/mkMakefile.tkdefs.sh
src/bin/psql/Makefile
src/include/version.h src/include/version.h
src/interfaces/Makefile src/interfaces/Makefile
src/interfaces/libpq/Makefile src/interfaces/libpq/Makefile
@ -1209,10 +1206,6 @@ AC_OUTPUT(
src/interfaces/libpgtcl/Makefile src/interfaces/libpgtcl/Makefile
src/interfaces/odbc/GNUmakefile src/interfaces/odbc/GNUmakefile
src/interfaces/python/GNUmakefile src/interfaces/python/GNUmakefile
src/pl/Makefile
src/pl/plpgsql/Makefile
src/pl/plpgsql/src/Makefile
src/pl/tcl/mkMakefile.tcldefs.sh src/pl/tcl/mkMakefile.tcldefs.sh
src/pl/plperl/GNUmakefile
src/test/regress/GNUmakefile src/test/regress/GNUmakefile
) )

View File

@ -7,7 +7,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.52 2000/06/10 18:01:36 petere Exp $ # $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.53 2000/06/27 00:30:48 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -50,18 +50,15 @@ clean:
$(MAKE) -C ../contrib/spi clean $(MAKE) -C ../contrib/spi clean
# Not all subdirectories have a make distclean target yet # Not all subdirectories have a make distclean target yet
distclean: distclean maintainer-clean:
-$(MAKE) -C utils clean -$(MAKE) -C utils clean
-$(MAKE) -C backend clean -$(MAKE) -C backend clean
rm -f backend/port/Makefile backend/catalog/genbki.sh \ rm -f backend/port/Makefile backend/catalog/genbki.sh \
backend/utils/Gen_fmgrtab.sh \ backend/utils/Gen_fmgrtab.sh \
backend/port/tas.s backend/port/dynloader.c backend/port/tas.s backend/port/dynloader.c
-$(MAKE) -C interfaces distclean -$(MAKE) -C interfaces distclean
-$(MAKE) -C bin clean -$(MAKE) -C bin $@
rm -f bin/pg_dump/Makefile bin/pg_version/Makefile \ -$(MAKE) -C pl $@
bin/psql/Makefile bin/pgtclsh/mkMakefile.tcldefs.sh \
bin/pgtclsh/mkMakefile.tkdefs.sh
-$(MAKE) -C pl distclean
-$(MAKE) -C test clean -$(MAKE) -C test clean
rm -f test/regress/GNUmakefile rm -f test/regress/GNUmakefile
-$(MAKE) -C ../contrib/spi clean -$(MAKE) -C ../contrib/spi clean

View File

@ -7,7 +7,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.80 2000/06/19 16:58:35 petere Exp $ # $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.81 2000/06/27 00:30:48 petere Exp $
# #
# NOTES # NOTES
# Essentially all Postgres make files include this file and use the # Essentially all Postgres make files include this file and use the
@ -35,6 +35,17 @@
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
ifndef SRCDIR
# This should be changed once we have separate build dirs.
top_srcdir = $(top_builddir)
ifeq ($(top_builddir), $(top_srcdir))
srcdir = .
else
srcdir = $(top_srcdir)/$(subdir)
endif
VPATH = $(srcdir)
SRCDIR = $(top_builddir)/src
endif
############################################################################## ##############################################################################
# #
@ -61,33 +72,29 @@ LIBPQ= -L$(LIBPQDIR) -lpq
LIBPGTCL= -L$(LIBPGTCLDIR) -lpgtcl LIBPGTCL= -L$(LIBPGTCLDIR) -lpgtcl
LIBPGEASY= -L$(LIBPGEASYDIR) -lpgeasy LIBPGEASY= -L$(LIBPGEASYDIR) -lpgeasy
# For convenience, POSTGRESDIR is where BINDIR, and LIBDIR # installation directories
# and other target destinations are rooted. Of course, each of these is
# changable separately.
POSTGRESDIR= @prefix@
# Where the postgres executables live (changeable by just putting them prefix = @prefix@
# somewhere else and putting that directory in your shell PATH) exec_prefix = @exec_prefix@
BINDIR= $(POSTGRESDIR)/bin bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
includedir = @includedir@
# Where libpq.a gets installed. You must put it where your loader will # old variable names for installation directories
# look for it if you wish to use the -lpq convention. Otherwise you
# can just put the absolute pathname to the library at the end of your
# command line.
LIBDIR= $(POSTGRESDIR)/lib
# Where the database templates are stored POSTGRESDIR= $(prefix)
# BINDIR= $(bindir)
TEMPLATEDIR= $(POSTGRESDIR)/lib LIBDIR= $(libdir)
TEMPLATEDIR= $(libdir)
# Where the man pages (suitable for use with "man") get installed.
POSTMANDIR= $(POSTGRESDIR)/man POSTMANDIR= $(POSTGRESDIR)/man
# Where the formatted documents (e.g., the reference manual) get installed.
POSTDOCDIR= $(POSTGRESDIR)/doc POSTDOCDIR= $(POSTGRESDIR)/doc
HEADERDIR= $(includedir)
# Where the header files necessary to build frontend programs get installed.
HEADERDIR= $(POSTGRESDIR)/include
############################################################################## ##############################################################################
@ -105,6 +112,8 @@ ENFORCE_ALIGNMENT= true
#PROFILE= -p -non_shared #PROFILE= -p -non_shared
with_perl = @with_perl@
# #
# Please do not edit USE_TCL and USE_TK by hand. # Please do not edit USE_TCL and USE_TK by hand.
# #
@ -125,13 +134,21 @@ MULTIBYTE=@MULTIBYTE@
# #
# For many ports, INSTALL is overridden below. # For many ports, INSTALL is overridden below.
INSTALL= @INSTALL@ INSTALL= @INSTALL@
RANLIB= @RANLIB@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SHLIB = @INSTALL_SHLIB@
mkinstalldirs = @mkinstalldirs@
# don't use these any more
INSTLOPTS= @INSTLOPTS@ INSTLOPTS= @INSTLOPTS@
INSTL_EXE_OPTS= @INSTL_EXE_OPTS@ INSTL_EXE_OPTS= @INSTL_EXE_OPTS@
INSTL_LIB_OPTS= @INSTL_LIB_OPTS@ INSTL_LIB_OPTS= @INSTL_LIB_OPTS@
INSTL_SHLIB_OPTS= @INSTL_SHLIB_OPTS@ INSTL_SHLIB_OPTS= @INSTL_SHLIB_OPTS@
RANLIB= @RANLIB@
#------------------------------------------------------------- #-------------------------------------------------------------
# See the subdirectory template for default settings for these # See the subdirectory template for default settings for these
@ -154,6 +171,8 @@ DLSUFFIX= @DLSUFFIX@
LN_S= @LN_S@ LN_S= @LN_S@
TAR= @tar@ TAR= @tar@
GZCAT= @GZCAT@ GZCAT= @GZCAT@
PERL = @PERL@
############################################################################## ##############################################################################
# #
@ -238,3 +257,13 @@ ifdef PROFILE
CFLAGS+= $(PROFILE) CFLAGS+= $(PROFILE)
LDFLAGS+= $(PROFILE) LDFLAGS+= $(PROFILE)
endif endif
# substitute implementations of the C library
STRERROR = @STRERROR@
STRERROR2 = @STRERROR2@
SNPRINTF = @SNPRINTF@
STRDUP = @STRDUP@
.DEFAULT: all
.PHONY: all install installdirs uninstall dep depend clean distclean maintainer-clean

View File

@ -1,30 +1,27 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile # Makefile for src/bin (client programs)
# Makefile for src/bin (client programs)
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# # $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.26 2000/06/27 00:30:49 petere Exp $
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.25 2000/01/20 21:51:02 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
SRCDIR= .. subdir = src/bin
top_builddir = ../..
include ../Makefile.global include ../Makefile.global
DIRS = pg_id pg_version psql pg_dump pg_passwd \ DIRS := initdb initlocation ipcclean pg_ctl pg_dump pg_id \
scripts initdb initlocation ipcclean \ pg_passwd pg_version psql scripts
pg_ctl
ALLDIRS := $(DIRS) pg_encoding pgaccess pgtclsh
ifdef MULTIBYTE ifdef MULTIBYTE
DIRS += pg_encoding DIRS += pg_encoding
endif endif
#
# TCL/TK programs # TCL/TK programs
#
ifeq ($(USE_TCL), true) ifeq ($(USE_TCL), true)
ifeq ($(USE_TK), true) ifeq ($(USE_TK), true)
DIRS += pgaccess DIRS += pgaccess
@ -32,5 +29,11 @@ endif
DIRS += pgtclsh DIRS += pgtclsh
endif endif
.DEFAULT all: all install installdirs uninstall depend:
for i in $(DIRS); do $(MAKE) -C $$i $@; done @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit 1; done
clean:
@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
distclean maintainer-clean:
@for dir in $(ALLDIRS); do $(MAKE) -C $$dir $@; done

View File

@ -1,28 +1,30 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile.inc-- # Makefile for src/bin/initdb
# Makefile for bin/initdb
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# # $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.18 2000/06/27 00:30:53 petere Exp $
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.17 2000/02/16 21:25:59 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
SRCDIR= ../.. subdir = src/bin/initdb
top_builddir = ../../..
include ../../Makefile.global include ../../Makefile.global
all: initdb all: initdb
initdb: initdb.sh initdb: initdb.sh
sed -e 's/__MULTIBYTE__/$(MULTIBYTE)/g' < initdb.sh > initdb sed -e 's/__MULTIBYTE__/$(MULTIBYTE)/g' < $< > $@
install: initdb install: all installdirs
$(INSTALL) $(INSTL_EXE_OPTS) $+ $(BINDIR)/$+ $(INSTALL_SCRIPT) initdb $(bindir)/initdb
clean: installdirs:
$(mkinstalldirs) $(bindir)
uninstall:
rm -f $(bindir)/initdb
clean distclean maintainer-clean:
rm -f initdb rm -f initdb
dep depend:

View File

@ -1,28 +1,30 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile.inc-- # Makefile for src/bin/initlocation
# Makefile for bin/initlocation
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# # $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/Makefile,v 1.9 2000/06/27 00:31:00 petere Exp $
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/Makefile,v 1.8 1999/12/08 10:29:43 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
SRCDIR= ../.. subdir = src/bin/initlocation
top_builddir = ../../..
include ../../Makefile.global include ../../Makefile.global
all: initlocation all: initlocation
initlocation: initlocation.sh initlocation: initlocation.sh
cp -p initlocation.sh initlocation cp $< $@
install: initlocation install: all installdirs
$(INSTALL) $(INSTL_EXE_OPTS) $+ $(BINDIR) $(INSTALL_SCRIPT) initlocation $(bindir)/initlocation
clean: installdirs:
$(mkinstalldirs) $(bindir)
uninstall:
rm -f $(bindir)/initlocation
clean distclean maintainer-clean:
rm -f initlocation rm -f initlocation
dep depend:

View File

@ -1,16 +1,15 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile for bin/ipcclean # Makefile for src/bin/ipcclean
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# # $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/Makefile,v 1.11 2000/06/27 00:31:05 petere Exp $
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/Makefile,v 1.10 2000/04/14 23:43:43 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
SRCDIR= ../.. subdir = src/bin/ipcclean
top_builddir = ../../..
include ../../Makefile.global include ../../Makefile.global
all: ipcclean all: ipcclean
@ -18,10 +17,14 @@ all: ipcclean
ipcclean: ipcclean.sh ipcclean: ipcclean.sh
cp $< $@ cp $< $@
install: ipcclean install: all installdirs
$(INSTALL) $(INSTL_EXE_OPTS) $^ $(BINDIR) $(INSTALL_SCRIPT) ipcclean $(bindir)/ipcclean
clean: installdirs:
$(mkinstalldirs) $(bindir)
uninstall:
rm -f $(bindir)/ipcclean
clean distclean maintainer-clean:
rm -f ipcclean rm -f ipcclean
dep depend:

View File

@ -1,28 +1,30 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile.inc-- # Makefile for src/bin/pg_ctl
# Makefile for bin/pg_ctl
# #
# Copyright (c) 1999, PostgreSQL Global Development Group # Copyright (c) 1999, PostgreSQL Global Development Group
# #
# # $Header: /cvsroot/pgsql/src/bin/pg_ctl/Makefile,v 1.6 2000/06/27 00:31:08 petere Exp $
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Makefile,v 1.5 2000/06/04 01:44:36 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
SRCDIR= ../.. subdir = src/bin/pg_ctl
top_builddir = ../../..
include ../../Makefile.global include ../../Makefile.global
all: pg_ctl all: pg_ctl
pg_ctl: pg_ctl.sh pg_ctl: pg_ctl.sh
cat pg_ctl.sh > pg_ctl cp $< $@
install: pg_ctl install: all installdirs
$(INSTALL) $(INSTL_EXE_OPTS) $+ $(BINDIR) $(INSTALL_SCRIPT) pg_ctl $(bindir)/pg_ctl
clean: installdirs:
$(mkinstalldirs) $(bindir)
uninstall:
rm -f $(bindir)/pg_ctl
clean distclean maintainer-clean:
rm -f pg_ctl rm -f pg_ctl
dep depend:

51
src/bin/pg_dump/Makefile Normal file
View File

@ -0,0 +1,51 @@
#-------------------------------------------------------------------------
#
# Makefile for src/bin/pg_dump
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.15 2000/06/27 00:31:12 petere Exp $
#
#-------------------------------------------------------------------------
subdir = src/bin/pg_dump
top_builddir = ../../..
include ../../Makefile.global
OBJS= pg_dump.o common.o $(STRDUP)
CFLAGS+= -I$(LIBPQDIR)
all: submake pg_dump$(X)
pg_dump$(X): $(OBJS) $(LIBPQDIR)/libpq.a
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBPQ) $(LDFLAGS)
../../utils/strdup.o:
$(MAKE) -C ../../utils strdup.o
.PHONY: submake
submake:
$(MAKE) -C $(LIBPQDIR) libpq.a
install: all installdirs
$(INSTALL_PROGRAM) pg_dump$(X) $(bindir)/pg_dump$(X)
$(INSTALL_SCRIPT) pg_dumpall $(bindir)/pg_dumpall
$(INSTALL_SCRIPT) pg_upgrade $(bindir)/pg_upgrade
installdirs:
$(mkinstalldirs) $(bindir)
uninstall:
rm -f $(addprefix $(bindir)/, pg_dump$(X) pg_dumpall pg_upgrade)
depend dep:
$(CC) -MM $(CFLAGS) *.c >depend
clean distclean maintainer-clean:
rm -f pg_dump$(X) $(OBJS)
ifeq (depend,$(wildcard depend))
include depend
endif

View File

@ -1,47 +0,0 @@
#-------------------------------------------------------------------------
#
# Makefile.inc--
# Makefile for bin/pg_dump
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/Makefile.in,v 1.14 2000/06/17 00:09:44 petere Exp $
#
#-------------------------------------------------------------------------
SRCDIR= ../..
include ../../Makefile.global
OBJS= pg_dump.o common.o @STRDUP@
CFLAGS+= -I$(LIBPQDIR)
all: submake pg_dump
pg_dump: $(OBJS) $(LIBPQDIR)/libpq.a
$(CC) $(CFLAGS) -o pg_dump $(OBJS) $(LIBPQ) $(LDFLAGS)
../../utils/strdup.o:
$(MAKE) -C ../../utils strdup.o
.PHONY: submake
submake:
$(MAKE) -C $(LIBPQDIR) libpq.a
install: pg_dump
$(INSTALL) $(INSTL_EXE_OPTS) pg_dump$(X) $(BINDIR)/pg_dump$(X)
$(INSTALL) $(INSTL_EXE_OPTS) pg_dumpall $(BINDIR)/pg_dumpall
$(INSTALL) $(INSTL_EXE_OPTS) pg_upgrade $(BINDIR)/pg_upgrade
depend dep:
$(CC) -MM $(CFLAGS) *.c >depend
clean:
rm -f pg_dump$(X) $(OBJS)
ifeq (depend,$(wildcard depend))
include depend
endif

View File

@ -1,37 +1,42 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile for bin/pg_encoding # Makefile for src/bin/pg_encoding
# #
# Copyright (c) 1998, PostgreSQL development group # Copyright (c) 1998, PostgreSQL Global Development Group
# #
# # $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.8 2000/06/27 00:31:17 petere Exp $
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.7 2000/05/29 05:45:44 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
SRCDIR= ../.. subdir = src/bin/pg_encoding
include $(SRCDIR)/Makefile.global top_builddir = ../../..
include ../../Makefile.global
OBJS= pg_encoding.o OBJS= pg_encoding.o
all: submake pg_encoding all: submake pg_encoding$(X)
pg_encoding: $(OBJS) pg_encoding$(X): $(OBJS)
$(CC) -o pg_encoding $(OBJS) $(LIBPQ) $(LDFLAGS) $(CFLAGS) $(CC) -o $@ $(OBJS) $(LIBPQ) $(LDFLAGS) $(CFLAGS)
.PHONY: submake .PHONY: submake
submake: submake:
$(MAKE) -C $(LIBPQDIR) libpq.a $(MAKE) -C $(LIBPQDIR) libpq.a
install: pg_encoding install: all installdirs
$(INSTALL) $(INSTL_EXE_OPTS) pg_encoding$(X) $(BINDIR)/pg_encoding$(X) $(INSTALL_PROGRAM) pg_encoding$(X) $(bindir)/pg_encoding$(X)
installdirs:
$(mkinstalldirs) $(bindir)
uninstall:
rm -f $(bindir)/pg_encoding$(X)
depend dep: depend dep:
$(CC) -MM $(CFLAGS) *.c >depend $(CC) -MM $(CFLAGS) *.c >depend
clean: clean distclean maintainer-clean:
rm -f pg_encoding$(X) pg_encoding.o rm -f pg_encoding$(X) pg_encoding.o
ifeq (depend,$(wildcard depend)) ifeq (depend,$(wildcard depend))

View File

@ -1,32 +1,36 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile # Makefile for src/bin/pg_id
# Makefile for bin/pg_id
# #
# Copyright (C) 2000 by PostgreSQL Global Development Team # Copyright (C) 2000 by PostgreSQL Global Development Team
# #
# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.16 2000/03/31 14:14:32 momjian Exp $ # $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.17 2000/06/27 00:31:20 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
SRCDIR= ../.. subdir = src/bin/pg_id
top_builddir = ../../..
include ../../Makefile.global include ../../Makefile.global
OBJS= pg_id.o all: pg_id$(X)
all: pg_id pg_id$(X): pg_id.o
$(CC) -o $@ $^ $(LDFLAGS)
pg_id: $(OBJS) install: all installdirs
$(CC) -o pg_id $(OBJS) $(LDFLAGS) $(INSTALL_PROGRAM) pg_id$(X) $(bindir)/pg_id$(X)
install: pg_id installdirs:
$(INSTALL) $(INSTL_EXE_OPTS) pg_id$(X) $(BINDIR)/pg_id$(X) $(mkinstalldirs) $(bindir)
uninstall:
rm -f $(bindir)/pg_id$(X)
depend dep: depend dep:
$(CC) -MM $(CFLAGS) *.c >depend $(CC) -MM $(CFLAGS) *.c >depend
clean: clean distclean maintainer-clean:
rm -f pg_id$(X) $(OBJS) rm -f pg_id$(X) pg_id.o
ifeq (depend,$(wildcard depend)) ifeq (depend,$(wildcard depend))
include depend include depend

View File

@ -1,31 +1,30 @@
#-------------------------------------------------------------------------
# #
# Makefile # Makefile for src/bin/pg_passwd
# Makefile for bin/pg_passwd #
#-------------------------------------------------------------------------
SRCDIR= ../.. subdir = src/bin/pg_passwd
top_builddir = ../../..
include ../../Makefile.global include ../../Makefile.global
OBJS= pg_passwd.o all: pg_passwd$(X)
all: pg_passwd pg_passwd$(X): pg_passwd.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
pg_passwd: $(OBJS) install: all installdirs
$(CC) $(CFLAGS) -o pg_passwd $(OBJS) $(LDFLAGS) $(INSTALL_PROGRAM) pg_passwd$(X) $(bindir)/pg_passwd$(X)
install: pg_passwd installdirs:
$(INSTALL) $(INSTL_EXE_OPTS) pg_passwd$(X) $(BINDIR)/pg_passwd$(X) $(mkinstalldirs) $(bindir)
.PHONY: submake uninstall:
submake: rm -f $(bindir)/pg_passwd$(X)
$(MAKE) -C $(LIBPQDIR) libpq.a
depend dep: depend dep:
$(CC) -MM $(CFLAGS) *.c >depend $(CC) -MM $(CFLAGS) *.c >depend
clean: clean distclean maintainer-clean:
rm -f pg_passwd$(X) $(OBJS) rm -f pg_passwd$(X) pg_passwd.o
ifeq (depend,$(wildcard depend)) ifeq (depend,$(wildcard depend))
include depend include depend

View File

@ -0,0 +1,43 @@
#-------------------------------------------------------------------------
#
# Makefile for src/bin/pg_version
#
# Portions Copyright (c) 1996-2000, PostgreSQL, Inc
# Portions Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/Makefile,v 1.7 2000/06/27 00:31:29 petere Exp $
#
#-------------------------------------------------------------------------
subdir = src/bin/pg_version
top_builddir = ../../..
include ../../Makefile.global
OBJS= pg_version.o $(top_builddir)/src/utils/version.o $(STRERROR2)
all: pg_version$(X)
pg_version$(X): $(OBJS)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
$(top_builddir)/src/utils/version.o: $(top_srcdir)/src/utils/version.c $(top_builddir)/src/include/version.h
$(MAKE) -C $(top_builddir)/src/utils version.o
install: all installdirs
$(INSTALL_PROGRAM) pg_version$(X) $(bindir)/pg_version$(X)
installdirs:
$(mkinstalldirs) $(bindir)
uninstall:
rm -f $(bindir)/pg_version$(X)
depend dep:
$(CC) -MM $(CFLAGS) *.c >depend
clean distclean maintainer-clean:
rm -f pg_version$(X) pg_version.o
ifeq (depend,$(wildcard depend))
include depend
endif

View File

@ -1,38 +0,0 @@
#-------------------------------------------------------------------------
#
# Makefile.in--
# Makefile for bin/pg_version
#
# Portions Copyright (c) 1996-2000, PostgreSQL, Inc
# Portions Copyright (c) 1994, Regents of the University of California
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/Makefile.in,v 1.9 2000/05/29 05:45:46 tgl Exp $
#
#-------------------------------------------------------------------------
SRCDIR= ../..
include $(SRCDIR)/Makefile.global
OBJS= pg_version.o $(SRCDIR)/utils/version.o @STRERROR2@
all: pg_version
pg_version: $(OBJS)
$(CC) $(CFLAGS) -o pg_version $(OBJS) $(LDFLAGS)
$(SRCDIR)/utils/version.o: $(SRCDIR)/utils/version.c $(SRCDIR)/include/version.h
$(MAKE) -C $(SRCDIR)/utils version.o
install: pg_version
$(INSTALL) $(INSTL_EXE_OPTS) pg_version$(X) $(BINDIR)/pg_version$(X)
depend dep:
$(CC) -MM $(CFLAGS) *.c >depend
clean:
rm -f pg_version$(X) pg_version.o
ifeq (depend,$(wildcard depend))
include depend
endif

View File

@ -1,37 +1,38 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile # Makefile for src/bin/pgaccess
# Makefile for pgaccess
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# IDENTIFICATION # $Header: /cvsroot/pgsql/src/bin/pgaccess/Attic/Makefile,v 1.9 2000/06/27 00:31:34 petere Exp $
# $Header: /cvsroot/pgsql/src/bin/pgaccess/Attic/Makefile,v 1.8 1999/12/16 01:25:10 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
SRCDIR= ../.. subdir = src/bin/pgaccess
include $(SRCDIR)/Makefile.global top_builddir = ../../..
include ../../Makefile.global
pgaccessdir = $(datadir)/pgaccess
all: pgaccess all: pgaccess
pgaccess: pgaccess.sh pgaccess: pgaccess.sh
sed -e 's;__wish__;$(WISH);' pgaccess.sh | \ sed -e 's,__wish__,$(WISH),' -e 's,__PGACCESSHOME__,$(pgaccessdir),' < $< > $@
sed -e 's;__POSTGRESDIR__;$(POSTGRESDIR);' \
> pgaccess
install: install: all installdirs
$(INSTALL) $(INSTL_EXE_OPTS) pgaccess $(BINDIR)/pgaccess $(INSTALL_SCRIPT) pgaccess $(bindir)/pgaccess
-@if [ ! -d $(POSTGRESDIR)/pgaccess ]; then mkdir $(POSTGRESDIR)/pgaccess; fi $(INSTALL_SCRIPT) main.tcl $(pgaccessdir)
$(INSTALL) $(INSTL_EXE_OPTS) main.tcl $(POSTGRESDIR)/pgaccess $(INSTALL_DATA) lib/*.tcl $(pgaccessdir)/lib
-@if [ ! -d $(POSTGRESDIR)/pgaccess/lib ]; then mkdir $(POSTGRESDIR)/pgaccess/lib; fi $(INSTALL_DATA) lib/help/*.hlp $(pgaccessdir)/lib/help
$(INSTALL) $(INSTLOPTS) lib/*.tcl $(POSTGRESDIR)/pgaccess/lib $(INSTALL_DATA) lib/languages/[a-z]* $(pgaccessdir)/lib/languages
-@if [ ! -d $(POSTGRESDIR)/pgaccess/lib/help ]; then mkdir $(POSTGRESDIR)/pgaccess/lib/help; fi $(INSTALL_DATA) images/*.gif $(pgaccessdir)/images
$(INSTALL) $(INSTLOPTS) lib/help/*.hlp $(POSTGRESDIR)/pgaccess/lib/help
-@if [ ! -d $(POSTGRESDIR)/pgaccess/lib/languages ]; then mkdir $(POSTGRESDIR)/pgaccess/lib/languages; fi
$(INSTALL) $(INSTLOPTS) lib/languages/[a-z]* $(POSTGRESDIR)/pgaccess/lib/languages
-@if [ ! -d $(POSTGRESDIR)/pgaccess/images ]; then mkdir $(POSTGRESDIR)/pgaccess/images; fi
$(INSTALL) $(INSTLOPTS) images/*.gif $(POSTGRESDIR)/pgaccess/images
clean: installdirs:
$(mkinstalldirs) $(bindir) $(pgaccessdir)/lib/help $(pgaccessdir)/lib/languages $(pgaccessdir)/images
uninstall:
rm -f $(bindir)/pgaccess
rm -rf $(pgaccessdir)
clean distclean maintainer-clean:
rm -f pgaccess rm -f pgaccess

View File

@ -1,10 +1,9 @@
#!/bin/sh #! /bin/sh
PATH_TO_WISH=__wish__ PATH_TO_WISH=__wish__
PGACCESS_HOME=__POSTGRESDIR__/pgaccess PGACCESS_HOME=__PGACCESSHOME__
export PATH_TO_WISH export PATH_TO_WISH
export PGACCESS_HOME export PGACCESS_HOME
exec ${PATH_TO_WISH} ${PGACCESS_HOME}/main.tcl "$@" exec ${PATH_TO_WISH} ${PGACCESS_HOME}/main.tcl "$@"

View File

@ -1,17 +1,16 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile # Makefile for src/bin/pgtclsh
# Makefile for a tclsh workalike with pgtcl commands installed # (a tclsh workalike with pgtcl commands installed)
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# # $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.28 2000/06/27 00:31:40 petere Exp $
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.27 2000/06/17 00:09:47 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
SRCDIR= ../.. subdir = src/bin/pgtclsh
top_builddir = ../../..
include ../../Makefile.global include ../../Makefile.global
# #
@ -26,42 +25,55 @@ CFLAGS+= $(X_CFLAGS) -I$(LIBPGTCLDIR)
# If we are here then TCL is available # If we are here then TCL is available
PGMS = pgtclsh PROGRAMS = pgtclsh
INSTPGMS = install_tcl
# Add TK targets if TK is available # Add TK targets if TK is available
ifeq ($(USE_TK), true) ifeq ($(USE_TK), true)
PGMS += pgtksh PROGRAMS += pgtksh
INSTPGMS += install_tk
endif endif
all: $(PGMS) all: submake $(PROGRAMS)
pgtclsh: pgtclAppInit.o pgtclsh: pgtclAppInit.o
$(CC) $(CFLAGS) $(TCL_DEFS) -o $@ pgtclAppInit.o \ $(CC) $(CFLAGS) $(TCL_DEFS) -o $@ $< \
$(LIBPGTCL) $(LIBPQ) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS) $(LIBPGTCL) $(LIBPQ) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS)
pgtksh: pgtkAppInit.o pgtksh: pgtkAppInit.o
$(CC) $(CFLAGS) $(TK_DEFS) -o $@ pgtkAppInit.o \ $(CC) $(CFLAGS) $(TK_DEFS) -o $@ $< \
$(LIBPGTCL) $(LIBPQ) $(X_LIBS) $(TK_LIB_SPEC) $(TK_LIBS) \ $(LIBPGTCL) $(LIBPQ) $(X_LIBS) $(TK_LIB_SPEC) $(TK_LIBS) \
$(TCL_LIB_SPEC) $(X11_LIBS) $(LDFLAGS) $(TCL_LIB_SPEC) $(X11_LIBS) $(LDFLAGS)
install: $(INSTPGMS) .PHONY: submake
submake:
$(MAKE) -C $(LIBPGTCLDIR) all
install_tcl: pgtclsh install: all installdirs
$(INSTALL) $(INSTL_EXE_OPTS) pgtclsh $(BINDIR)/pgtclsh $(INSTALL_PROGRAM) pgtclsh $(bindir)/pgtclsh
ifeq ($(USE_TK), true)
$(INSTALL_PROGRAM) pgtksh $(bindir)/pgtksh
endif
install_tk: pgtksh installdirs:
$(INSTALL) $(INSTL_EXE_OPTS) pgtksh $(BINDIR)/pgtksh $(mkinstalldirs) $(bindir)
uninstall:
rm -f $(bindir)/pgtclsh $(bindir)/pgtksh
Makefile.tcldefs: mkMakefile.tcldefs.sh Makefile.tcldefs: mkMakefile.tcldefs.sh
/bin/sh ./mkMakefile.tcldefs.sh $(SHELL) $<
Makefile.tkdefs: mkMakefile.tkdefs.sh Makefile.tkdefs: mkMakefile.tkdefs.sh
/bin/sh ./mkMakefile.tkdefs.sh $(SHELL) $<
mkMakefile.tcldefs.sh mkMakefile.tkdefs.sh: $(top_builddir)/config.status
mkMakefile.tcldefs.sh mkMakefile.tkdefs.sh: % : %.in
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
clean: clean:
rm -f *.o Makefile.t*defs pgtclsh pgtksh rm -f *.o Makefile.tcldefs Makefile.tkdefs pgtclsh pgtksh
distclean maintainer-clean: clean
rm -f mkMakefile.tcldefs.sh mkMakefile.tkdefs.sh
dep depend: dep depend:
$(CC) -MM $(CFLAGS) *.c > depend $(CC) -MM $(CFLAGS) *.c > depend

88
src/bin/psql/Makefile Normal file
View File

@ -0,0 +1,88 @@
#-------------------------------------------------------------------------
#
# Makefile for src/bin/psql
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.21 2000/06/27 00:31:41 petere Exp $
#
#-------------------------------------------------------------------------
subdir = src/bin/psql
top_builddir = ../../..
include ../../Makefile.global
REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref
CFLAGS+= -I$(LIBPQDIR)
OBJS=command.o common.o help.o input.o stringutils.o mainloop.o \
copy.o startup.o prompt.o variables.o large_obj.o print.o describe.o \
tab-complete.o
all: submake psql$(X)
ifdef STRDUP
OBJS+=$(top_builddir)/src/utils/strdup.o
$(top_builddir)/src/utils/strdup.o:
$(MAKE) -C $(top_builddir)/src/utils strdup.o
endif
# Move these to the utils directory?
ifdef STRERROR
OBJS+=$(top_builddir)/src/backend/port/strerror.o
$(top_builddir)/src/backend/port/strerror.o:
$(MAKE) -C $(top_builddir)/src/backend/port strerror.o
endif
ifdef SNPRINTF
OBJS+=$(top_builddir)/src/backend/port/snprintf.o
$(top_builddir)/src/backend/port/snprintf.o:
$(MAKE) -C $(top_builddir)/src/backend/port snprintf.o
endif
# End of hacks for picking up backend 'port' modules
psql$(X): $(OBJS) $(LIBPQDIR)/libpq.a
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBPQ) $(LDFLAGS)
help.o: $(srcdir)/sql_help.h
ifdef PERL
$(srcdir)/sql_help.h: create_help.pl $(wildcard $(REFDOCDIR)/*.sgml)
$(PERL) $< $(REFDOCDIR) $@
else
$(srcdir)/sql_help.h:
@echo "*** Perl is needed to build psql help."
endif
.PHONY: submake
submake:
$(MAKE) -C $(LIBPQDIR) libpq.a
install: all installdirs
$(INSTALL_PROGRAM) psql$(X) $(bindir)/psql$(X)
installdirs:
$(mkinstalldirs) $(bindir)
uninstall:
rm -f $(bindir)/psql$(X)
depend dep:
$(CC) -MM -MG $(CFLAGS) *.c >depend
clean distclean:
rm -f psql$(X) $(OBJS)
maintainer-clean: distclean
rm -f sql_help.h
ifeq (depend,$(wildcard depend))
include depend
endif

View File

@ -1,89 +0,0 @@
#-------------------------------------------------------------------------
#
# Makefile.in--
# Makefile for bin/psql
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.26 2000/06/17 00:09:51 petere Exp $
#
#-------------------------------------------------------------------------
SRCDIR= ../..
include $(SRCDIR)/Makefile.global
DOCDIR= $(SRCDIR)/../doc/src/sgml/ref
PERL = @PERL@
CFLAGS+= -I$(LIBPQDIR)
OBJS=command.o common.o help.o input.o stringutils.o mainloop.o \
copy.o startup.o prompt.o variables.o large_obj.o print.o describe.o \
tab-complete.o
all: submake psql
ifneq (@STRDUP@,)
OBJS+=$(SRCDIR)/utils/strdup.o
$(SRCDIR)/utils/strdup.o:
$(MAKE) -C $(SRCDIR)/utils strdup.o
endif
# Move these to the utils directory?
ifneq (@STRERROR@,)
OBJS+=$(SRCDIR)/backend/port/strerror.o
$(SRCDIR)/backend/port/strerror.o:
$(MAKE) -C $(SRCDIR)/backend/port strerror.o
endif
ifneq (@SNPRINTF@,)
OBJS+=$(SRCDIR)/backend/port/snprintf.o
$(SRCDIR)/backend/port/snprintf.o:
$(MAKE) -C $(SRCDIR)/backend/port snprintf.o
endif
# End of hacks for picking up backend 'port' modules
psql: $(OBJS) $(LIBPQDIR)/libpq.a
$(CC) $(CFLAGS) -o psql $(OBJS) $(LIBPQ) $(LDFLAGS)
help.o: sql_help.h
ifneq ($(strip $(PERL)),)
sql_help.h: $(wildcard $(DOCDIR)/*.sgml) create_help.pl
$(PERL) create_help.pl $(DOCDIR) sql_help.h
else
sql_help.h:
@echo "*** Perl is needed to build psql help."
endif
.PHONY: submake
submake:
$(MAKE) -C $(LIBPQDIR) libpq.a
install: psql
$(INSTALL) $(INSTL_EXE_OPTS) psql$(X) $(BINDIR)/psql$(X)
depend dep:
$(CC) -MM -MG $(CFLAGS) *.c >depend
clean:
rm -f psql$(X) $(OBJS)
# Some people might get in trouble if they do a make clean and the
# sql_help.h is gone, for it needs the docs in the right place to be
# regenerated. -- (pe)
maintainer-clean: clean
rm -f sql_help.h
ifeq (depend,$(wildcard depend))
include depend
endif

View File

@ -5,7 +5,7 @@
# #
# Copyright 2000 by PostgreSQL Global Development Group # Copyright 2000 by PostgreSQL Global Development Group
# #
# $Header: /cvsroot/pgsql/src/bin/psql/create_help.pl,v 1.6 2000/04/16 18:07:22 tgl Exp $ # $Header: /cvsroot/pgsql/src/bin/psql/create_help.pl,v 1.7 2000/06/27 00:31:41 petere Exp $
################################################################# #################################################################
# #
@ -22,7 +22,14 @@
$docdir = $ARGV[0] || die "$0: missing required argument: docdir\n"; $docdir = $ARGV[0] || die "$0: missing required argument: docdir\n";
$outputfile = $ARGV[1] || die "$0: missing required argument: output file\n"; $outputfile = $ARGV[1] || die "$0: missing required argument: output file\n";
$define = $outputfile; if ($outputfile =~ m!.*/([^/]+)$!) {
$outputfilebasename = $1;
}
else {
$outputfilebasename = $outputfile;
}
$define = $outputfilebasename;
$define =~ tr/a-z/A-Z/; $define =~ tr/a-z/A-Z/;
$define =~ s/\W/_/g; $define =~ s/\W/_/g;
@ -33,12 +40,11 @@ open(OUT, ">$outputfile")
print OUT print OUT
"/* "/*
* *** Do not change this file. It is machine-generated. *** * *** Do not change this file by hand. It is automatically
* *** generated from the DocBook documentation.
* *
* This file was generated by * generated by
* $^X $0 $outputfile * $^X $0 @ARGV
* from the DocBook documentation in
* $docdir
* *
*/ */
@ -108,7 +114,7 @@ foreach $file (sort readdir DIR) {
$count++; $count++;
} }
else { else {
print STDERR "$0: parsing file '$file' failed at or near line $. (N='$cmdname' D='$cmddesc')\n"; print STDERR "$0: parsing file '$file' failed (N='$cmdname' D='$cmddesc')\n";
} }
} }

View File

@ -1,40 +1,32 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile.inc-- # Makefile for src/bin/scripts
# Makefile for bin/scripts
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# # $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.5 2000/06/27 00:31:44 petere Exp $
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.4 1999/12/16 01:25:11 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
.SUFFIXES: subdir = src/bin/scripts
top_builddir = ../../..
SRCDIR=../..
include ../../Makefile.global include ../../Makefile.global
SCRIPTS=createdb dropdb createuser dropuser createlang droplang vacuumdb SCRIPTS := createdb dropdb createuser dropuser createlang droplang vacuumdb
all: $(SCRIPTS) all: $(SCRIPTS)
createdb:
dropdb:
createuser:
dropuser:
createlang: createlang.sh createlang: createlang.sh
sed -e 's/__DLSUFFIX__/$(DLSUFFIX)/' createlang.sh > createlang sed -e 's/__DLSUFFIX__/$(DLSUFFIX)/' $< > $@
droplang:
vacuumdb: install: all installdirs
$(INSTALL_SCRIPT) $(SCRIPTS) $(bindir)
install: $(SCRIPTS) installdirs:
for i in $+; do $(INSTALL) $(INSTL_EXE_OPTS) $$i $(BINDIR); done $(mkinstalldirs) $(bindir)
clean: uninstall:
rm -f $(addprefix $(bindir)/, $(SCRIPTS))
clean distclean maintainer-clean:
rm -f createlang rm -f createlang
dep depend:

36
src/pl/Makefile Normal file
View File

@ -0,0 +1,36 @@
#-------------------------------------------------------------------------
#
# Makefile for src/pl (procedural languages)
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/pl/Makefile,v 1.9 2000/06/27 00:31:48 petere Exp $
#
#-------------------------------------------------------------------------
subdir = src/pl
top_builddir = ../..
include ../Makefile.global
DIRS := plpgsql
ifeq ($(USE_TCL), true)
DIRS += tcl
endif
# Disabled because it doesn't work
#ifeq ($(with_perl), yes)
# $(MAKE) -C plperl $@
#endif
ALLDIRS := plpgsql tcl plperl
all install installdirs uninstall depend:
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit 1; done
clean:
@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
distclean maintainer-clean:
@for dir in $(ALLDIRS); do $(MAKE) -C $$dir $@; done

View File

@ -1,51 +0,0 @@
#-------------------------------------------------------------------------
#
# Makefile for src/pl (procedural languages)
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/pl/Attic/Makefile.in,v 1.2 2000/06/20 16:40:04 petere Exp $
#
#-------------------------------------------------------------------------
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../..
subdir = src/pl
with_perl = @with_perl@
USE_TCL = @USE_TCL@
all install clean:
$(MAKE) -C plpgsql $@
ifeq ($(USE_TCL), true)
$(MAKE) -C tcl $@
endif
# Disabled because it doesn't work
#ifeq ($(with_perl), yes)
# $(MAKE) -C plperl $@
#endif
distclean maintainer-clean:
-$(MAKE) -C plpgsql $@
ifeq ($(USE_TCL), true)
$(MAKE) -C tcl clean
endif
rm -f tcl/mkMakefile.tcldefs.sh
-$(MAKE) -C plperl $@
rm -f Makefile
.PHONY: all install clean distclean maintainer-clean
Makefile: Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
$(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck

28
src/pl/plperl/GNUmakefile Normal file
View File

@ -0,0 +1,28 @@
# $Header: /cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.1 2000/06/27 00:31:49 petere Exp $
subdir = src/pl/plperl
top_builddir = ../../..
include ../../Makefile.global
plperl_installdir = $(libdir)
all: Makefile
$(MAKE) -f $< all
Makefile: Makefile.PL
@plperl_installdir='$(plperl_installdir)' \
EXTRA_INCLUDES='-I$(top_srcdir)/src/include $(INCLUDES)' \
$(PERL) $< POLLUTE=1
install: all installdirs
$(MAKE) -f $< install
installdirs:
$(mkinstalldirs) $(plperl_installdir)
uninstall:
rm -f $(libdir)/plperl$(DLSUFFIX)
clean distclean maintainer-clean:
-[ -f Makefile ] && $(MAKE) -f Makefile realclean

View File

@ -1,40 +0,0 @@
# $Header: /cvsroot/pgsql/src/pl/plperl/Attic/GNUmakefile.in,v 1.2 2000/06/17 00:10:21 petere Exp $
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../../..
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
plperl_installdir = $(libdir)
mkinstalldirs = @mkinstalldirs@
PERL = @PERL@
INCLUDES = @INCLUDES@
all: Makefile
$(MAKE) -f $< all
Makefile: Makefile.PL
@plperl_installdir='$(plperl_installdir)' \
EXTRA_INCLUDES='-I$(top_srcdir)/src/include $(INCLUDES)' \
$(PERL) $< POLLUTE=1
install: Makefile installdirs
$(MAKE) -f $< install
installdirs:
$(mkinstalldirs) $(plperl_installdir)
clean:
-[ -f Makefile ] && $(MAKE) -f Makefile realclean
distclean maintainer-clean: clean
rm -f GNUmakefile
.PHONY: all install installdirs clean distclean maintainer-clean

19
src/pl/plpgsql/Makefile Normal file
View File

@ -0,0 +1,19 @@
#-------------------------------------------------------------------------
#
# Makefile for src/pl/plpgsql (PostgreSQL's SQL procedural language)
#
# 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 $
#
#-------------------------------------------------------------------------
subdir = src/pl/plpgsql
top_builddir = ../../..
include ../../Makefile.global
all install installdirs uninstall:
$(MAKE) -C src $@
clean distclean maintainer-clean:
-$(MAKE) -C src $@

View File

@ -1,34 +0,0 @@
#-------------------------------------------------------------------------
#
# Makefile for src/pl/plpgsql (PostgreSQL's SQL procedural language)
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/pl/plpgsql/Attic/Makefile.in,v 1.1 2000/06/20 16:40:07 petere Exp $
#
#-------------------------------------------------------------------------
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../../..
subdir = src/pl/plpgsql
.DEFAULT all install clean:
$(MAKE) -C src $@
distclean maintainer-clean:
-$(MAKE) -C src $@
rm -f Makefile
.PHONY: all install clean distclean maintainer-clean
Makefile: Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
$(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck

View File

@ -2,42 +2,25 @@
# #
# Makefile for the plpgsql shared object # Makefile for the plpgsql shared object
# #
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.26 2000/06/20 16:40:10 petere Exp $ # $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.3 2000/06/27 00:32:01 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../../../..
subdir = src/pl/plpgsql/src subdir = src/pl/plpgsql/src
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
INSTALL = @INSTALL@
INSTALL_SHLIB = @INSTALL_SHLIB@
mkinstalldirs = @mkinstalldirs@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
# Shared library parameters # Shared library parameters
NAME= plpgsql NAME= plpgsql
SO_MAJOR_VERSION= 1 SO_MAJOR_VERSION= 1
SO_MINOR_VERSION= 0 SO_MINOR_VERSION= 0
DLSUFFIX = @DLSUFFIX@
SRCDIR = $(top_srcdir)/src
include $(SRCDIR)/Makefile.global
CPPFLAGS += -I$(srcdir) CPPFLAGS += -I$(srcdir)
OBJS= pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o OBJS = pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
# Shared library stuff, also default 'all' target # Shared library stuff, also default `all' target
include $(SRCDIR)/Makefile.shlib include $(top_srcdir)/src/Makefile.shlib
# In order to use Makefile.shlib, we allow it to build a static # In order to use Makefile.shlib, we allow it to build a static
@ -46,8 +29,8 @@ include $(SRCDIR)/Makefile.shlib
# call it that when installed, however, so we ignore the install-shlib # call it that when installed, however, so we ignore the install-shlib
# rule and do this instead: # rule and do this instead:
install: installdirs $(shlib) install: installdirs all
ifneq ($(shlib),) ifdef shlib
$(INSTALL_SHLIB) $(shlib) $(libdir)/plpgsql$(DLSUFFIX) $(INSTALL_SHLIB) $(shlib) $(libdir)/plpgsql$(DLSUFFIX)
else else
@echo "*****"; \ @echo "*****"; \
@ -58,9 +41,12 @@ endif
installdirs: installdirs:
$(mkinstalldirs) $(libdir) $(mkinstalldirs) $(libdir)
pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h pl.tab.h uninstall:
rm -f $(libdir)/plpgsql$(DLSUFFIX)
pl_parse.o: pl_gram.c pl_scan.c plpgsql.h pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h $(srcdir)/pl.tab.h
pl_parse.o: $(srcdir)/pl_gram.c $(srcdir)/pl_scan.c plpgsql.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
# Note: Since the yacc and lex files are shipped in the distribution, # Note: Since the yacc and lex files are shipped in the distribution,
@ -82,25 +68,8 @@ mklang.sql: mklang.sql.in
sed -e 's%__libdir__%$(libdir)%g' -e 's%__DLSUFFIX__%$(DLSUFFIX)%g' < $< > $@ sed -e 's%__libdir__%$(libdir)%g' -e 's%__DLSUFFIX__%$(DLSUFFIX)%g' < $< > $@
clean: clean-shlib clean distclean: clean-shlib
rm -f lib$(NAME).a *.o y.tab.c y.tab.h lex.yy.c mklang.sql rm -f lib$(NAME).a *.o y.tab.c y.tab.h lex.yy.c mklang.sql
distclean: clean
rm -f Makefile
maintainer-clean: clean maintainer-clean: clean
rm -f $(srcdir)/pl_gram.c $(srcdir)/pl.tab.h $(srcdir)/pl_scan.c rm -f $(srcdir)/pl_gram.c $(srcdir)/pl.tab.h $(srcdir)/pl_scan.c
rm -f Makefile
.PHONY: all install installdirs clean distclean maintainer-clean
Makefile: Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
$(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
$(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck

View File

@ -1,34 +1,23 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile # Makefile for the pltcl shared object
# Makefile for the pltcl shared object
# #
# IDENTIFICATION # $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.18 2000/06/27 00:32:06 petere Exp $
# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.17 2000/06/17 00:10:25 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# subdir = src/pl/tcl
# Tell make where the postgresql sources live top_builddir = ../../..
# include ../../Makefile.global
SRCDIR= ../../../src
include $(SRCDIR)/Makefile.global
#
# Include definitions from the tclConfig.sh file
# NOTE: GNU make will make this file automatically if it doesn't exist,
# using the make rule that appears below. Cute, eh?
#
include Makefile.tcldefs include Makefile.tcldefs
# # Find out whether Tcl was built as a shared library --- if not, we
# Find out whether Tcl was built as a shared library --- if not, # can't link a shared library that depends on it, and have to forget
# we can't link a shared library that depends on it, and have to # about building pltcl. In Tcl 8, tclConfig.sh sets TCL_SHARED_BUILD
# forget about building pltcl. # for us, but in older Tcl releases it doesn't. In that case we guess
# In Tcl 8, tclConfig.sh sets TCL_SHARED_BUILD for us, but in # based on the name of the Tcl library.
# older Tcl releases it doesn't. In that case we guess based on
# the name of the Tcl library.
#
ifndef TCL_SHARED_BUILD ifndef TCL_SHARED_BUILD
ifneq (,$(findstring $(DLSUFFIX),$(TCL_LIB_FILE))) ifneq (,$(findstring $(DLSUFFIX),$(TCL_LIB_FILE)))
TCL_SHARED_BUILD=1 TCL_SHARED_BUILD=1
@ -38,14 +27,13 @@ endif
endif endif
# Change following to how shared library that contains # Change following to how shared library that contains references to
# references to libtcl must get built on your system. # libtcl must get built on your system. Since these definitions come
# Since these definitions come from the tclConfig.sh script, # from the tclConfig.sh script, they should work if the shared build
# they should work if the shared build of tcl was successful # of tcl was successful on this system. However, tclConfig.sh lies to
# on this system. However, tclConfig.sh lies to us a little bit # us a little bit (at least in versions 7.6 through 8.0.4) --- it
# (at least in versions 7.6 through 8.0.4) --- it doesn't mention -lc # doesn't mention -lc in TCL_LIBS, but you still need it on systems
# in TCL_LIBS, but you still need it on systems that want to hear about # that want to hear about dependent libraries...
# dependent libraries...
ifneq ($(TCL_SHLIB_LD_LIBS),) ifneq ($(TCL_SHLIB_LD_LIBS),)
# link command for a shared lib must mention shared libs it uses # link command for a shared lib must mention shared libs it uses
@ -55,28 +43,30 @@ else
SHLIB_EXTRA_LIBS= SHLIB_EXTRA_LIBS=
endif endif
%$(TCL_SHLIB_SUFFIX): %.o %$(TCL_SHLIB_SUFFIX): %.o
$(TCL_SHLIB_LD) -o $@ $< $(TCL_LIB_SPEC) $(SHLIB_EXTRA_LIBS) $(TCL_SHLIB_LD) -o $@ $< $(TCL_LIB_SPEC) $(SHLIB_EXTRA_LIBS)
CC = $(TCL_CC) CC = $(TCL_CC)
# Since we are using Tcl's choice of C compiler, which might not be the # Since we are using Tcl's choice of C compiler, which might not be
# same one selected for Postgres, do NOT use CFLAGS from Makefile.global. # the same one selected for Postgres, do NOT use CFLAGS from
# Instead use TCL's CFLAGS plus necessary -I directives. # Makefile.global. Instead use TCL's CFLAGS plus necessary -I
# directives.
# Can choose either TCL_CFLAGS_OPTIMIZE or TCL_CFLAGS_DEBUG here, as needed # Can choose either TCL_CFLAGS_OPTIMIZE or TCL_CFLAGS_DEBUG here, as
# needed
CFLAGS= $(TCL_CFLAGS_OPTIMIZE) CFLAGS= $(TCL_CFLAGS_OPTIMIZE)
CFLAGS+= $(TCL_SHLIB_CFLAGS) $(TCL_DEFS) CFLAGS+= $(TCL_SHLIB_CFLAGS) $(TCL_DEFS)
CFLAGS+= -I$(SRCDIR)/include $(INCLUDES) CFLAGS+= -I$(top_srcdir)/src/include $(INCLUDES)
#
# Uncomment the following to enable the unknown command lookup # Uncomment the following to enable the unknown command lookup on the
# on the first of all calls to the call handler. See the doc # first of all calls to the call handler. See the doc in the modules
# in the modules directory about details. # directory about details.
#
#CFLAGS+= -DPLTCL_UNKNOWN_SUPPORT #CFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
@ -95,42 +85,39 @@ INFILES+= $(DLOBJS:.o=$(EXPSUFF))
endif endif
ifeq ($(TCL_SHARED_BUILD),1) # Provide dummy targets for the case where we can't build the shared library.
ifeq ($(TCL_SHARED_BUILD), 1)
#
# Build the shared lib
#
all: $(INFILES) all: $(INFILES)
install: all install: all installdirs
$(INSTALL) $(INSTL_SHLIB_OPTS) $(DLOBJS) $(LIBDIR)/$(DLOBJS) $(INSTALL_SHLIB) $(DLOBJS) $(libdir)/$(DLOBJS)
installdirs:
$(mkinstalldirs) $(libdir)
uninstall:
rm -f $(libdir)/$(DLOBJS)
else else
# all install:
# Oops, can't build it @echo "*****"; \
# echo "* Cannot build pltcl because Tcl is not a shared library; skipping it."; \
all: echo "*****"
@echo "Cannot build pltcl because Tcl is not a shared library; skipping it."
install:
@echo "Cannot build pltcl because Tcl is not a shared library; skipping it."
endif endif
#
# Make targets that are still valid when we can't build pltcl
# should be below here.
#
Makefile.tcldefs: mkMakefile.tcldefs.sh Makefile.tcldefs: mkMakefile.tcldefs.sh
/bin/sh ./mkMakefile.tcldefs.sh $(SHELL) $<
mkMakefile.tcldefs.sh: mkMakefile.tcldefs.sh.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
#
# Clean
#
clean: clean:
rm -f $(INFILES) *.o rm -f $(INFILES) *.o Makefile.tcldefs
rm -f Makefile.tcldefs
dep depend: distclean maintainer-clean: clean
rm -f mkMakefile.tcldefs.sh