mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-15 08:20:16 +08:00
Makefile simplification: the "bin" chapter
This commit is contained in:
parent
a7511908e1
commit
6f708e42d1
@ -7,12 +7,12 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.4 1996/08/13 07:48:15 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.5 1996/11/11 13:39:09 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
MKDIR=../mk
|
||||
-include $(MKDIR)/../Makefile.global
|
||||
SRCDIR=..
|
||||
include $(SRCDIR)/Makefile.global
|
||||
|
||||
.DEFAULT all:
|
||||
#
|
||||
|
@ -7,23 +7,16 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/Attic/Makefile.global,v 1.9 1996/11/09 06:24:23 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/Attic/Makefile.global,v 1.10 1996/11/11 13:39:10 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
CFLAGS+= -I$(srcdir)/backend \
|
||||
-I$(srcdir)/include \
|
||||
-I$(srcdir)/libpq
|
||||
LIBPQDIR:= $(SRCDIR)/libpq
|
||||
|
||||
#
|
||||
# link with libpq, so we put it here.
|
||||
#
|
||||
LIBPQ:= -L$(srcdir)/libpq -lpq
|
||||
|
||||
LD_ADD+= $(LIBPQ)
|
||||
DPADD+= $(LIBPQ)
|
||||
LD_ADD+= -L$(srcdir)/libpq -lpq
|
||||
DPADD+= -L$(srcdir)/libpq -lpq
|
||||
# LIB_DEP is the list of dependencies on libraries for the link.
|
||||
LIB_DEP+= $(srcdir)/libpq/libpq.a
|
||||
LIB_DEP+= $(LIBPQDIR)/libpq.a
|
||||
|
||||
#
|
||||
# And where libpq goes, so goes the authentication stuff...
|
||||
@ -33,3 +26,11 @@ LD_ADD+= $(KRBLIBS)
|
||||
CFLAGS+= $(KRBFLAGS)
|
||||
endif
|
||||
|
||||
|
||||
INCLUDE_OPT := \
|
||||
-I$(LIBPQDIR) \
|
||||
-I$(SRCDIR)/include \
|
||||
-I$(SRCDIR)/src/backend/port/$(PORTNAME)
|
||||
|
||||
CFLAGS += $(INCLUDE_OPT)
|
||||
|
||||
|
@ -7,15 +7,18 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/cleardbdir/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:11 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/cleardbdir/Attic/Makefile,v 1.2 1996/11/11 13:39:31 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
SHPROG= cleardbdir
|
||||
all: cleardbdir
|
||||
|
||||
MKDIR= ../../mk
|
||||
include $(MKDIR)/postgres.mk
|
||||
include ../Makefile.global
|
||||
cleardbdir:
|
||||
cp cleardbdir.sh cleardbdir
|
||||
|
||||
include $(MKDIR)/postgres.shell.mk
|
||||
install: cleardbdir
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) $< $(DESTDIR)$(BINDIR)/$<
|
||||
|
||||
clean:
|
||||
rm -f cleardbdir
|
||||
|
||||
|
@ -7,15 +7,24 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/createdb/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:12 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/createdb/Attic/Makefile,v 1.2 1996/11/11 13:39:34 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
SHPROG= createdb
|
||||
SRCDIR= ../..
|
||||
include ../../Makefile.global
|
||||
|
||||
MKDIR= ../../mk
|
||||
include $(MKDIR)/postgres.mk
|
||||
include ../Makefile.global
|
||||
SEDSCRIPT= \
|
||||
-e "s^_fUnKy_BINDIR_sTuFf_^$(BINDIR)^g" \
|
||||
-e "s^_fUnKy_POSTPORT_sTuFf_^$(POSTPORT)^g"
|
||||
|
||||
include $(MKDIR)/postgres.shell.mk
|
||||
all: createdb
|
||||
|
||||
createdb:
|
||||
sed $(SEDSCRIPT) <createdb.sh >createdb
|
||||
|
||||
install: createdb
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) $< $(DESTDIR)$(BINDIR)/$<
|
||||
|
||||
clean:
|
||||
rm -f createdb
|
||||
|
@ -7,15 +7,26 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:12 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/Makefile,v 1.2 1996/11/11 13:39:40 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
SHPROG= createuser
|
||||
SRCDIR= ../..
|
||||
include ../../Makefile.global
|
||||
|
||||
MKDIR= ../../mk
|
||||
include $(MKDIR)/postgres.mk
|
||||
include ../Makefile.global
|
||||
SEDSCRIPT= \
|
||||
-e "s^_fUnKy_BINDIR_sTuFf_^$(BINDIR)^g" \
|
||||
-e "s^_fUnKy_POSTPORT_sTuFf_^$(POSTPORT)^g" \
|
||||
-e "s^_fUnKy_DASH_N_sTuFf_^$(DASH_N)^g" \
|
||||
-e "s^_fUnKy_BACKSLASH_C_sTuFf_^$(BACKSLASH_C)^g"
|
||||
|
||||
include $(MKDIR)/postgres.shell.mk
|
||||
all: createuser
|
||||
|
||||
createuser:
|
||||
sed $(SEDSCRIPT) <createuser.sh >createuser
|
||||
|
||||
install: createuser
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) $< $(DESTDIR)$(BINDIR)/$<
|
||||
|
||||
clean:
|
||||
rm -f createuser
|
||||
|
@ -7,15 +7,24 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/destroydb/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:12 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/destroydb/Attic/Makefile,v 1.2 1996/11/11 13:39:47 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
SHPROG= destroydb
|
||||
SRCDIR= ../..
|
||||
include ../../Makefile.global
|
||||
|
||||
MKDIR= ../../mk
|
||||
include $(MKDIR)/postgres.mk
|
||||
include ../Makefile.global
|
||||
SEDSCRIPT= \
|
||||
-e "s^_fUnKy_BINDIR_sTuFf_^$(BINDIR)^g" \
|
||||
-e "s^_fUnKy_POSTPORT_sTuFf_^$(POSTPORT)^g"
|
||||
|
||||
include $(MKDIR)/postgres.shell.mk
|
||||
all: destroydb
|
||||
|
||||
destroydb:
|
||||
sed $(SEDSCRIPT) <destroydb.sh >destroydb
|
||||
|
||||
install: destroydb
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) $< $(DESTDIR)$(BINDIR)/$<
|
||||
|
||||
clean:
|
||||
rm -f destroydb
|
||||
|
@ -7,15 +7,26 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:12 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/Makefile,v 1.2 1996/11/11 13:40:04 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
SHPROG= destroyuser
|
||||
SRCDIR= ../..
|
||||
include ../../Makefile.global
|
||||
|
||||
MKDIR= ../../mk
|
||||
include $(MKDIR)/postgres.mk
|
||||
include ../Makefile.global
|
||||
SEDSCRIPT= \
|
||||
-e "s^_fUnKy_BINDIR_sTuFf_^$(BINDIR)^g" \
|
||||
-e "s^_fUnKy_POSTPORT_sTuFf_^$(POSTPORT)^g" \
|
||||
-e "s^_fUnKy_DASH_N_sTuFf_^$(DASH_N)^g" \
|
||||
-e "s^_fUnKy_BACKSLASH_C_sTuFf_^$(BACKSLASH_C)^g"
|
||||
|
||||
include $(MKDIR)/postgres.shell.mk
|
||||
all: destroyuser
|
||||
|
||||
destroyuser:
|
||||
sed $(SEDSCRIPT) <destroyuser.sh >destroyuser
|
||||
|
||||
install: destroyuser
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) $< $(DESTDIR)$(BINDIR)/$<
|
||||
|
||||
clean:
|
||||
rm -f destroyuser
|
||||
|
@ -7,15 +7,28 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.1.1.1 1996/07/09 06:22:13 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.2 1996/11/11 13:40:25 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
SHPROG= initdb
|
||||
SRCDIR= ../..
|
||||
include ../../Makefile.global
|
||||
|
||||
MKDIR= ../../mk
|
||||
include $(MKDIR)/postgres.mk
|
||||
include ../Makefile.global
|
||||
SEDSCRIPT= \
|
||||
-e "s^_fUnKy_BINDIR_sTuFf_^$(BINDIR)^g" \
|
||||
-e "s^_fUnKy_LIBDIR_sTuFf_^$(LIBDIR)^g" \
|
||||
-e "s^_fUnKy_DATADIR_sTuFf_^$(DATADIR)^g" \
|
||||
-e "s^_fUnKy_NAMEDATALEN_sTuFf_^$(NAMEDATALEN)^g" \
|
||||
-e "s^_fUnKy_OIDNAMELEN_sTuFf_^$(OIDNAMELEN)^g" \
|
||||
-e "s^_fUnKy_POSTPORT_sTuFf_^$(POSTPORT)^g"
|
||||
|
||||
include $(MKDIR)/postgres.shell.mk
|
||||
all: initdb
|
||||
|
||||
initdb:
|
||||
sed $(SEDSCRIPT) <initdb.sh >initdb
|
||||
|
||||
install: initdb
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) $< $(DESTDIR)$(BINDIR)/$<
|
||||
|
||||
clean:
|
||||
rm -f initdb
|
||||
|
@ -7,15 +7,23 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:13 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/Makefile,v 1.2 1996/11/11 13:40:39 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
SHPROG= ipcclean
|
||||
SRCDIR= ../..
|
||||
include ../../Makefile.global
|
||||
|
||||
MKDIR= ../../mk
|
||||
include $(MKDIR)/postgres.mk
|
||||
include ../Makefile.global
|
||||
SEDSCRIPT= \
|
||||
-e "s^_fUnKy_IPCCLEANPATH_sTuFf_^$(IPCSDIR)^g"
|
||||
|
||||
include $(MKDIR)/postgres.shell.mk
|
||||
all: ipcclean
|
||||
|
||||
ipcclean:
|
||||
sed $(SEDSCRIPT) <ipcclean.sh >ipcclean
|
||||
|
||||
install: ipcclean
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) $< $(DESTDIR)$(BINDIR)/$<
|
||||
|
||||
clean:
|
||||
rm -f ipcclean
|
||||
|
@ -7,19 +7,34 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.6 1996/10/31 05:56:01 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.7 1996/11/11 13:40:46 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
PROG= pg_dump
|
||||
|
||||
MKDIR= ../../mk
|
||||
include $(MKDIR)/postgres.mk
|
||||
SRCDIR= ../..
|
||||
include ../Makefile.global
|
||||
include ../../Makefile.global
|
||||
|
||||
CFLAGS+= -I../../backend/port/$(PORTNAME)
|
||||
OBJS= pg_dump.o common.o
|
||||
|
||||
SRCS= pg_dump.c common.c
|
||||
all: submake pg_dump
|
||||
|
||||
include $(MKDIR)/postgres.prog.mk
|
||||
pg_dump: $(OBJS) $(LIBPQDIR)/libpq.a
|
||||
$(CC) $(LDFLAGS) -o pg_dump -L$(LIBPQDIR) $(OBJS) -lpq $(LD_ADD)
|
||||
|
||||
.PHONY: submake
|
||||
submake:
|
||||
$(MAKE) -C $(LIBPQDIR) libpq.a
|
||||
|
||||
install:
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) pg_dump $(DESTDIR)$(BINDIR)/pg_dump
|
||||
|
||||
depend dep:
|
||||
$(CC) -MM $(INCLUDE_OPT) *.c >depend
|
||||
|
||||
clean:
|
||||
rm -f pg_dump $(OBJS)
|
||||
|
||||
ifeq (depend,$(wildcard depend))
|
||||
include depend
|
||||
endif
|
||||
|
@ -7,17 +7,33 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:14 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.2 1996/11/11 13:41:08 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
PROG= pg_id
|
||||
|
||||
MKDIR= ../../mk
|
||||
include $(MKDIR)/postgres.mk
|
||||
SRCDIR= ../..
|
||||
include ../Makefile.global
|
||||
include ../../Makefile.global
|
||||
|
||||
SRCS= pg_id.c
|
||||
OBJS= pg_id.o
|
||||
|
||||
include $(MKDIR)/postgres.prog.mk
|
||||
all: pg_id
|
||||
|
||||
pg_id: $(OBJS) $(LIBPQDIR)/libpq.a
|
||||
$(CC) $(LDFLAGS) -o pg_id -L$(LIBPQDIR) $(OBJS) -lpq $(LD_ADD)
|
||||
|
||||
$(LIBPQDIR)/libpq.a:
|
||||
$(MAKE) -C $(LIBPQDIR) libpq.a
|
||||
|
||||
install:
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) pg_id $(DESTDIR)$(BINDIR)/pg_id
|
||||
|
||||
depend dep:
|
||||
$(CC) -MM $(INCLUDE_OPT) *.c >depend
|
||||
|
||||
clean:
|
||||
rm -f pg_id $(OBJS)
|
||||
|
||||
ifeq (depend,$(wildcard depend))
|
||||
include depend
|
||||
endif
|
||||
|
@ -7,40 +7,33 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.3 1996/11/04 05:14:34 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.4 1996/11/11 13:41:25 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
MKDIR= ../../mk
|
||||
include $(MKDIR)/postgres.mk
|
||||
SRCDIR= ../..
|
||||
include ../../Makefile.global
|
||||
include ../Makefile.global
|
||||
|
||||
CFLAGS+= -I$(TCL_INCDIR) -I$(TK_INCDIR) -I$(X11_INCDIR) -I$(srcdir)/libpgtcl
|
||||
CFLAGS+= -I$(TCL_INCDIR) -I$(TK_INCDIR) -I$(X11_INCDIR) -I$(SRCDIR)/libpgtcl
|
||||
|
||||
# try to find libpgtcl.a in either directory
|
||||
LIBPGTCL= -L$(srcdir)/libpgtcl/$(objdir) -L$(LIBDIR) -lpgtcl
|
||||
LIBPGTCL= -L$(SRCDIR)/libpgtcl -L$(LIBDIR) -lpgtcl
|
||||
|
||||
pgtclsh: $(objdir)/pgtclAppInit.o
|
||||
$(CC) $(CFLAGS) -o $(objdir)/$(@F) $(objdir)/pgtclAppInit.o\
|
||||
$(LIBPGTCL) $(LIBPQ) -L$(TCL_LIBDIR) $(TCL_LIB) -lm $(LD_ADD)
|
||||
all: pgtclsh pgtksh
|
||||
|
||||
pgtksh: $(objdir)/pgtkAppInit.o
|
||||
$(CC) $(CFLAGS) -o $(objdir)/$(@F) $(objdir)/pgtkAppInit.o \
|
||||
$(LIBPGTCL) $(LIBPQ) -L$(TCL_LIBDIR) -L$(TK_LIBDIR) -L$(X11_LIBDIR) \
|
||||
$(TK_LIB) $(TCL_LIB) -lX11 -lm $(LD_ADD)
|
||||
pgtclsh: pgtclAppInit.o
|
||||
$(CC) $(CFLAGS) -o $@ pgtclAppInit.o \
|
||||
$(LIBPGTCL) $(LIBPQ) -L$(TCL_LIBDIR) $(TCL_LIB) -lm $(LD_ADD)
|
||||
|
||||
install:: localobj pgtclsh pgtksh
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) $(objdir)/pgtclsh $(DESTDIR)$(BINDIR)/pgtclsh
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) $(objdir)/pgtksh $(DESTDIR)$(BINDIR)/pgtksh
|
||||
|
||||
CLEANFILES = pgtclAppInit.o pgtkAppInit.o pgtclsh pgtksh
|
||||
|
||||
PROG=pgtclsh
|
||||
|
||||
all:: pgtclsh pgtksh
|
||||
|
||||
# don't use the default template for generating executables since we have
|
||||
# two executable targets
|
||||
# include $(MKDIR)/postgres.prog.mk
|
||||
pgtksh: pgtkAppInit.o
|
||||
$(CC) $(CFLAGS) -o $@ pgtkAppInit.o \
|
||||
$(LIBPGTCL) $(LIBPQ) -L$(TCL_LIBDIR) -L$(TK_LIBDIR) -L$(X11_LIBDIR) \
|
||||
$(TK_LIB) $(TCL_LIB) -lX11 -lm $(LD_ADD)
|
||||
|
||||
install: pgtclsh pgtksh
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) pgtclsh $(DESTDIR)$(BINDIR)/pgtclsh
|
||||
$(INSTALL) $(INSTL_EXE_OPTS) pgtksh $(DESTDIR)$(BINDIR)/pgtksh
|
||||
|
||||
clean:
|
||||
rm -f pgtclAppInit.o pgtkAppInit.o pgtclsh pgtksh
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.10 1996/11/09 06:24:39 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.11 1996/11/11 13:41:36 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -63,12 +63,13 @@ ifneq ($(USE_READLINE), true)
|
||||
OBJS+= rlstubs.o
|
||||
endif
|
||||
|
||||
all: psql
|
||||
all: submake psql
|
||||
|
||||
psql: $(OBJS) $(LIBPQDIR)/libpq.a
|
||||
$(CC) $(LDFLAGS) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LD_ADD)
|
||||
|
||||
$(srcdir)/libpq/libpq.a:
|
||||
.PHONY: submake
|
||||
submake:
|
||||
$(MAKE) -C $(LIBPQDIR) libpq.a
|
||||
|
||||
install:
|
||||
|
Loading…
Reference in New Issue
Block a user