Skip to content

Commit c61db5b

Browse files
committed
Simplify build/install process for bki and description files. There's
no reason for them to be copied into src/backend rather than being installed straight from the catalog subdirectory. This also avoids some peculiar behavior (bugs?) present in at least gmake 3.78.1: it won't always update the bki files in backend/ even when the ones in backend/catalog/ are newer.
1 parent 4863829 commit c61db5b

File tree

2 files changed

+24
-35
lines changed

2 files changed

+24
-35
lines changed

src/backend/Makefile

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#
3535
#
3636
# IDENTIFICATION
37-
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.53 2000/06/04 01:44:28 petere Exp $
37+
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.54 2000/06/05 07:16:12 tgl Exp $
3838
#
3939
#-------------------------------------------------------------------------
4040

@@ -77,9 +77,7 @@ libpostgres.a: $(DLLOBJS) $(SRCDIR)/utils/dllinit.o postgres.def
7777
$(DLLTOOL) --dllname postgres.exe --def postgres.def --output-lib $@
7878
endif
7979

80-
all: prebuildheaders postgres $(POSTGRES_IMP) \
81-
global1.bki.source local1_template1.bki.source \
82-
global1.description local1_template1.description
80+
all: prebuildheaders postgres $(POSTGRES_IMP)
8381

8482
ifneq ($(PORTNAME), win)
8583

@@ -108,14 +106,6 @@ $(VERSIONOBJ): $(SRCDIR)/utils/version.c $(SRCDIR)/include/version.h
108106
$(SRCDIR)/utils/dllinit.o: $(SRCDIR)/utils/dllinit.c
109107
$(MAKE) -C $(SRCDIR)/utils dllinit.o
110108

111-
global1.bki.source local1_template1.bki.source \
112-
global1.description local1_template1.description: catalog/$@
113-
cp catalog/$@ .
114-
115-
catalog/global1.bki.source catalog/local1_template1.bki.source \
116-
catalog/global1.description catalog/local1_template1.description:
117-
$(MAKE) -C catalog $@
118-
119109
# The postgres.o target is needed by the rule in Makefile.global that
120110
# creates the exports file when MAKE_EXPORTS = true.
121111
postgres.o: $(OBJS)
@@ -148,9 +138,7 @@ utils/fmgroids.h: utils/Gen_fmgrtab.sh $(SRCDIR)/include/catalog/pg_proc.h
148138
clean:
149139
rm -f postgres$(X) $(POSTGRES_IMP) \
150140
$(SRCDIR)/include/parser/parse.h \
151-
$(SRCDIR)/include/utils/fmgroids.h \
152-
global1.bki.source local1_template1.bki.source \
153-
global1.description local1_template1.description
141+
$(SRCDIR)/include/utils/fmgroids.h
154142
ifeq ($(PORTNAME), win)
155143
ifeq ($(MAKE_DLL), true)
156144
rm -f postgres.dll postgres.def libpostgres.a
@@ -203,18 +191,9 @@ endif
203191
endif
204192

205193
install-templates: $(TEMPLATEDIR) \
206-
global1.bki.source local1_template1.bki.source \
207-
global1.description local1_template1.description \
208194
libpq/pg_hba.conf.sample libpq/pg_ident.conf.sample \
209195
utils/misc/postgresql.conf.sample
210-
$(INSTALL) $(INSTLOPTS) global1.bki.source \
211-
$(TEMPLATEDIR)/global1.bki.source
212-
$(INSTALL) $(INSTLOPTS) global1.description \
213-
$(TEMPLATEDIR)/global1.description
214-
$(INSTALL) $(INSTLOPTS) local1_template1.bki.source \
215-
$(TEMPLATEDIR)/local1_template1.bki.source
216-
$(INSTALL) $(INSTLOPTS) local1_template1.description \
217-
$(TEMPLATEDIR)/local1_template1.description
196+
$(MAKE) -C catalog install-bki-templates
218197
$(INSTALL) $(INSTLOPTS) libpq/pg_hba.conf.sample \
219198
$(TEMPLATEDIR)/pg_hba.conf.sample
220199
$(INSTALL) $(INSTLOPTS) libpq/pg_ident.conf.sample \

src/backend/catalog/Makefile

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,32 @@
44
# Makefile for catalog
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.21 2000/05/29 05:44:43 tgl Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.22 2000/06/05 07:16:13 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

1111
SRCDIR = ../..
12-
include ../../Makefile.global
12+
include $(SRCDIR)/Makefile.global
1313

1414
OBJS = catalog.o heap.o index.o indexing.o aclchk.o \
1515
pg_aggregate.o pg_operator.o pg_proc.o pg_type.o
1616

17-
all: SUBSYS.o global1.bki.source local1_template1.bki.source \
18-
global1.description local1_template1.description
17+
BKIFILES = global1.bki.source local1_template1.bki.source \
18+
global1.description local1_template1.description
19+
20+
all: SUBSYS.o $(BKIFILES)
1921

2022
SUBSYS.o: $(OBJS)
2123
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
2224

2325
GENBKI= ./genbki.sh
2426

25-
GLOBALBKI_SRCS= $(addprefix ../../include/catalog/, \
27+
GLOBALBKI_SRCS= $(addprefix $(SRCDIR)/include/catalog/, \
2628
pg_database.h pg_variable.h pg_shadow.h \
2729
pg_group.h pg_log.h \
2830
)
2931

30-
LOCALBKI_SRCS= $(addprefix ../../include/catalog/, \
32+
LOCALBKI_SRCS= $(addprefix $(SRCDIR)/include/catalog/, \
3133
pg_proc.h pg_type.h pg_attribute.h pg_class.h \
3234
pg_inherits.h pg_index.h pg_statistic.h \
3335
pg_operator.h pg_opclass.h pg_am.h pg_amop.h pg_amproc.h \
@@ -37,7 +39,7 @@ LOCALBKI_SRCS= $(addprefix ../../include/catalog/, \
3739
)
3840

3941
global1.bki.source: $(GENBKI) $(GLOBALBKI_SRCS) \
40-
$(addprefix ../../include/catalog/, indexing.h)
42+
$(addprefix $(SRCDIR)/include/catalog/, indexing.h)
4143
ifneq ($(PORTNAME), win)
4244
sh $(SHOPTS) $(GENBKI) $(BKIOPTS) $(GLOBALBKI_SRCS) > $@ 2>global1.description
4345
else
@@ -51,14 +53,22 @@ else
5153
$(GENBKI) $(BKIOPTS) $(LOCALBKI_SRCS) > $@ 2>local1_template1.description
5254
endif
5355

56+
install-bki-templates: $(BKIFILES)
57+
$(INSTALL) $(INSTLOPTS) global1.bki.source \
58+
$(TEMPLATEDIR)/global1.bki.source
59+
$(INSTALL) $(INSTLOPTS) global1.description \
60+
$(TEMPLATEDIR)/global1.description
61+
$(INSTALL) $(INSTLOPTS) local1_template1.bki.source \
62+
$(TEMPLATEDIR)/local1_template1.bki.source
63+
$(INSTALL) $(INSTLOPTS) local1_template1.description \
64+
$(TEMPLATEDIR)/local1_template1.description
65+
5466
depend dep:
5567
$(CC) -MM $(CFLAGS) *.c >depend
5668

5769
clean:
58-
rm -f SUBSYS.o $(OBJS) global1.bki.source local1_template1.bki.source \
59-
global1.description local1_template1.description
70+
rm -f SUBSYS.o $(OBJS) $(BKIFILES)
6071

6172
ifeq (depend,$(wildcard depend))
6273
include depend
6374
endif
64-

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy