Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f708e4

Browse files
author
Bryan Henderson
committed
Makefile simplification: the "bin" chapter
1 parenta751190 commit6f708e4

File tree

13 files changed

+190
-100
lines changed

13 files changed

+190
-100
lines changed

‎src/bin/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.4 1996/08/13 07:48:15 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.5 1996/11/11 13:39:09 bryanh Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

14-
MKDIR=../mk
15-
-include$(MKDIR)/../Makefile.global
14+
SRCDIR=..
15+
include$(SRCDIR)/Makefile.global
1616

1717
.DEFAULTall:
1818
#

‎src/bin/Makefile.global

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,16 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/Attic/Makefile.global,v 1.9 1996/11/09 06:24:23 momjian Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/Attic/Makefile.global,v 1.10 1996/11/11 13:39:10 bryanh Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

14-
CFLAGS+= -I$(srcdir)/backend \
15-
-I$(srcdir)/include \
16-
-I$(srcdir)/libpq
14+
LIBPQDIR:= $(SRCDIR)/libpq
1715

18-
#
19-
# link with libpq, so we put it here.
20-
#
21-
LIBPQ:= -L$(srcdir)/libpq -lpq
22-
23-
LD_ADD+= $(LIBPQ)
24-
DPADD+= $(LIBPQ)
16+
LD_ADD+= -L$(srcdir)/libpq -lpq
17+
DPADD+= -L$(srcdir)/libpq -lpq
2518
# LIB_DEP is the list of dependencies on libraries for the link.
26-
LIB_DEP+= $(srcdir)/libpq/libpq.a
19+
LIB_DEP+= $(LIBPQDIR)/libpq.a
2720

2821
#
2922
# And where libpq goes, so goes the authentication stuff...
@@ -33,3 +26,11 @@ LD_ADD+= $(KRBLIBS)
3326
CFLAGS+= $(KRBFLAGS)
3427
endif
3528

29+
30+
INCLUDE_OPT := \
31+
-I$(LIBPQDIR) \
32+
-I$(SRCDIR)/include \
33+
-I$(SRCDIR)/src/backend/port/$(PORTNAME)
34+
35+
CFLAGS += $(INCLUDE_OPT)
36+

‎src/bin/cleardbdir/Makefile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/cleardbdir/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:11 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/cleardbdir/Attic/Makefile,v 1.2 1996/11/11 13:39:31 bryanh Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

14-
SHPROG=cleardbdir
14+
all:cleardbdir
1515

16-
MKDIR=../../mk
17-
include$(MKDIR)/postgres.mk
18-
include ../Makefile.global
16+
cleardbdir:
17+
cp cleardbdir.sh cleardbdir
1918

20-
include$(MKDIR)/postgres.shell.mk
19+
install: cleardbdir
20+
$(INSTALL)$(INSTL_EXE_OPTS)$<$(DESTDIR)$(BINDIR)/$<
21+
22+
clean:
23+
rm -f cleardbdir
2124

‎src/bin/createdb/Makefile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,24 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/createdb/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:12 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/createdb/Attic/Makefile,v 1.2 1996/11/11 13:39:34 bryanh Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

14-
SHPROG=createdb
14+
SRCDIR= ../..
15+
include ../../Makefile.global
1516

16-
MKDIR=../../mk
17-
include$(MKDIR)/postgres.mk
18-
include ../Makefile.global
17+
SEDSCRIPT=\
18+
-e "s^_fUnKy_BINDIR_sTuFf_^$(BINDIR)^g"\
19+
-e "s^_fUnKy_POSTPORT_sTuFf_^$(POSTPORT)^g"
1920

20-
include$(MKDIR)/postgres.shell.mk
21+
all: createdb
2122

23+
createdb:
24+
sed$(SEDSCRIPT)<createdb.sh>createdb
25+
26+
install: createdb
27+
$(INSTALL)$(INSTL_EXE_OPTS)$<$(DESTDIR)$(BINDIR)/$<
28+
29+
clean:
30+
rm -f createdb

‎src/bin/createuser/Makefile

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,26 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:12 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/Makefile,v 1.2 1996/11/11 13:39:40 bryanh Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

14-
SHPROG=createuser
14+
SRCDIR= ../..
15+
include ../../Makefile.global
1516

16-
MKDIR=../../mk
17-
include$(MKDIR)/postgres.mk
18-
include ../Makefile.global
17+
SEDSCRIPT=\
18+
-e "s^_fUnKy_BINDIR_sTuFf_^$(BINDIR)^g"\
19+
-e "s^_fUnKy_POSTPORT_sTuFf_^$(POSTPORT)^g"\
20+
-e "s^_fUnKy_DASH_N_sTuFf_^$(DASH_N)^g"\
21+
-e "s^_fUnKy_BACKSLASH_C_sTuFf_^$(BACKSLASH_C)^g"
1922

20-
include$(MKDIR)/postgres.shell.mk
23+
all: createuser
2124

25+
createuser:
26+
sed$(SEDSCRIPT)<createuser.sh>createuser
27+
28+
install: createuser
29+
$(INSTALL)$(INSTL_EXE_OPTS)$<$(DESTDIR)$(BINDIR)/$<
30+
31+
clean:
32+
rm -f createuser

‎src/bin/destroydb/Makefile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,24 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/destroydb/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:12 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/destroydb/Attic/Makefile,v 1.2 1996/11/11 13:39:47 bryanh Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

14-
SHPROG=destroydb
14+
SRCDIR= ../..
15+
include ../../Makefile.global
1516

16-
MKDIR=../../mk
17-
include$(MKDIR)/postgres.mk
18-
include ../Makefile.global
17+
SEDSCRIPT=\
18+
-e "s^_fUnKy_BINDIR_sTuFf_^$(BINDIR)^g"\
19+
-e "s^_fUnKy_POSTPORT_sTuFf_^$(POSTPORT)^g"
1920

20-
include$(MKDIR)/postgres.shell.mk
21+
all: destroydb
2122

23+
destroydb:
24+
sed$(SEDSCRIPT)<destroydb.sh>destroydb
25+
26+
install: destroydb
27+
$(INSTALL)$(INSTL_EXE_OPTS)$<$(DESTDIR)$(BINDIR)/$<
28+
29+
clean:
30+
rm -f destroydb

‎src/bin/destroyuser/Makefile

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,26 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:12 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/Makefile,v 1.2 1996/11/11 13:40:04 bryanh Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

14-
SHPROG=destroyuser
14+
SRCDIR= ../..
15+
include ../../Makefile.global
1516

16-
MKDIR=../../mk
17-
include$(MKDIR)/postgres.mk
18-
include ../Makefile.global
17+
SEDSCRIPT=\
18+
-e "s^_fUnKy_BINDIR_sTuFf_^$(BINDIR)^g"\
19+
-e "s^_fUnKy_POSTPORT_sTuFf_^$(POSTPORT)^g"\
20+
-e "s^_fUnKy_DASH_N_sTuFf_^$(DASH_N)^g"\
21+
-e "s^_fUnKy_BACKSLASH_C_sTuFf_^$(BACKSLASH_C)^g"
1922

20-
include$(MKDIR)/postgres.shell.mk
23+
all: destroyuser
2124

25+
destroyuser:
26+
sed$(SEDSCRIPT)<destroyuser.sh>destroyuser
27+
28+
install: destroyuser
29+
$(INSTALL)$(INSTL_EXE_OPTS)$<$(DESTDIR)$(BINDIR)/$<
30+
31+
clean:
32+
rm -f destroyuser

‎src/bin/initdb/Makefile

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,28 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.1.1.1 1996/07/09 06:22:13 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.2 1996/11/11 13:40:25 bryanh Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

14-
SHPROG=initdb
14+
SRCDIR= ../..
15+
include ../../Makefile.global
1516

16-
MKDIR=../../mk
17-
include$(MKDIR)/postgres.mk
18-
include ../Makefile.global
17+
SEDSCRIPT=\
18+
-e "s^_fUnKy_BINDIR_sTuFf_^$(BINDIR)^g"\
19+
-e "s^_fUnKy_LIBDIR_sTuFf_^$(LIBDIR)^g"\
20+
-e "s^_fUnKy_DATADIR_sTuFf_^$(DATADIR)^g"\
21+
-e "s^_fUnKy_NAMEDATALEN_sTuFf_^$(NAMEDATALEN)^g"\
22+
-e "s^_fUnKy_OIDNAMELEN_sTuFf_^$(OIDNAMELEN)^g"\
23+
-e "s^_fUnKy_POSTPORT_sTuFf_^$(POSTPORT)^g"
1924

20-
include$(MKDIR)/postgres.shell.mk
25+
all: initdb
2126

27+
initdb:
28+
sed$(SEDSCRIPT)<initdb.sh>initdb
29+
30+
install: initdb
31+
$(INSTALL)$(INSTL_EXE_OPTS)$<$(DESTDIR)$(BINDIR)/$<
32+
33+
clean:
34+
rm -f initdb

‎src/bin/ipcclean/Makefile

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,23 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:13 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/Makefile,v 1.2 1996/11/11 13:40:39 bryanh Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

14-
SHPROG=ipcclean
14+
SRCDIR= ../..
15+
include ../../Makefile.global
1516

16-
MKDIR=../../mk
17-
include$(MKDIR)/postgres.mk
18-
include ../Makefile.global
17+
SEDSCRIPT=\
18+
-e "s^_fUnKy_IPCCLEANPATH_sTuFf_^$(IPCSDIR)^g"
1919

20-
include$(MKDIR)/postgres.shell.mk
20+
all: ipcclean
2121

22+
ipcclean:
23+
sed$(SEDSCRIPT)<ipcclean.sh>ipcclean
24+
25+
install: ipcclean
26+
$(INSTALL)$(INSTL_EXE_OPTS)$<$(DESTDIR)$(BINDIR)/$<
27+
28+
clean:
29+
rm -f ipcclean

‎src/bin/pg_dump/Makefile

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,34 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.6 1996/10/31 05:56:01 momjian Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.7 1996/11/11 13:40:46 bryanh Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

14-
PROG=pg_dump
15-
16-
MKDIR=../../mk
17-
include$(MKDIR)/postgres.mk
14+
SRCDIR= ../..
1815
include ../Makefile.global
16+
include ../../Makefile.global
17+
18+
OBJS= pg_dump.o common.o
19+
20+
all: submake pg_dump
21+
22+
pg_dump:$(OBJS)$(LIBPQDIR)/libpq.a
23+
$(CC)$(LDFLAGS) -o pg_dump -L$(LIBPQDIR)$(OBJS) -lpq$(LD_ADD)
24+
25+
.PHONY: submake
26+
submake:
27+
$(MAKE) -C$(LIBPQDIR) libpq.a
1928

20-
CFLAGS+= -I../../backend/port/$(PORTNAME)
29+
install:
30+
$(INSTALL)$(INSTL_EXE_OPTS) pg_dump$(DESTDIR)$(BINDIR)/pg_dump
2131

22-
SRCS=pg_dump.c common.c
32+
dependdep:
33+
$(CC) -MM$(INCLUDE_OPT)*.c>depend
2334

24-
include$(MKDIR)/postgres.prog.mk
35+
clean:
36+
rm -f pg_dump$(OBJS)
2537

38+
ifeq (depend,$(wildcard depend))
39+
include depend
40+
endif

‎src/bin/pg_id/Makefile

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,33 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:14 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.2 1996/11/11 13:41:08 bryanh Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

14-
PROG=pg_id
15-
16-
MKDIR=../../mk
17-
include$(MKDIR)/postgres.mk
14+
SRCDIR= ../..
1815
include ../Makefile.global
16+
include ../../Makefile.global
17+
18+
OBJS= pg_id.o
19+
20+
all: pg_id
21+
22+
pg_id:$(OBJS)$(LIBPQDIR)/libpq.a
23+
$(CC)$(LDFLAGS) -o pg_id -L$(LIBPQDIR)$(OBJS) -lpq$(LD_ADD)
24+
25+
$(LIBPQDIR)/libpq.a:
26+
$(MAKE) -C$(LIBPQDIR) libpq.a
27+
28+
install:
29+
$(INSTALL)$(INSTL_EXE_OPTS) pg_id$(DESTDIR)$(BINDIR)/pg_id
1930

20-
SRCS=pg_id.c
31+
dependdep:
32+
$(CC) -MM$(INCLUDE_OPT)*.c>depend
2133

22-
include$(MKDIR)/postgres.prog.mk
34+
clean:
35+
rm -f pg_id$(OBJS)
2336

37+
ifeq (depend,$(wildcard depend))
38+
include depend
39+
endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp