Skip to content

Commit 17cc78e

Browse files
committed
To fix the perpetually broken makefiles in the contrib tree, I have
written a generic framework of rules that the contrib makefiles can use instead of writing their own each time. You only need to set a few variables and off you go.
1 parent 22ae53d commit 17cc78e

File tree

32 files changed

+394
-1061
lines changed

32 files changed

+394
-1061
lines changed

contrib/Makefile

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/contrib/Makefile,v 1.26 2001/09/04 19:21:42 tgl Exp $
1+
# $Header: /cvsroot/pgsql/contrib/Makefile,v 1.27 2001/09/06 10:49:29 petere Exp $
22

33
subdir = contrib
44
top_builddir = ..
@@ -18,8 +18,6 @@ WANTED_DIRS = \
1818
intarray \
1919
isbn_issn \
2020
lo \
21-
mSQL-interface \
22-
mac \
2321
miscutil \
2422
noupdate \
2523
oid2name \
@@ -28,24 +26,32 @@ WANTED_DIRS = \
2826
pg_logger \
2927
pg_resetxlog \
3028
pgbench \
31-
pgcrypto \
3229
rserv \
3330
rtree_gist \
3431
seg \
3532
spi \
3633
string \
3734
tips \
3835
userlock \
39-
vacuumlo
36+
vacuumlo
37+
38+
# Missing:
39+
# ipc_check \ (does not have a makefile)
40+
# mSQL-interface \ (requires msql installed)
41+
# mac \ (does not have a makefile)
42+
# mysql \ (does not have a makefile)
43+
# oracle \ (does not have a makefile)
44+
# pgcrypto \ (non-standard makefile)
45+
# start-scripts \ (does not have a makefile)
46+
# tools \ (does not have a makefile)
47+
# xml \ (non-standard makefile)
4048

4149
ifeq ($(with_java),yes)
4250
WANTED_DIRS += retep
4351
endif
4452

4553

46-
all install installdirs uninstall clean distclean maintainer-clean:
47-
for dir in $(WANTED_DIRS); do \
48-
if [ -f $$dir/Makefile ]; then \
49-
$(MAKE) -C $$dir $@; \
50-
fi; \
54+
all install installdirs uninstall clean distclean maintainer-clean check installcheck:
55+
@for dir in $(WANTED_DIRS); do \
56+
$(MAKE) -C $$dir $@ || exit; \
5157
done

contrib/array/Makefile

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,11 @@
1-
#
2-
# $Header: /cvsroot/pgsql/contrib/array/Attic/Makefile,v 1.15 2001/06/18 21:38:01 momjian Exp $
3-
#
1+
# $Header: /cvsroot/pgsql/contrib/array/Attic/Makefile,v 1.16 2001/09/06 10:49:29 petere Exp $
42

53
subdir = contrib/array
64
top_builddir = ../..
75
include $(top_builddir)/src/Makefile.global
86

9-
NAME := array_iterator
10-
SONAME := $(NAME)$(DLSUFFIX)
7+
MODULES = array_iterator
8+
DATA_built = array_iterator.sql
9+
DOCS = README.array_iterator
1110

12-
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
13-
override CFLAGS += $(CFLAGS_SL)
14-
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
15-
16-
all: $(SONAME) $(NAME).sql
17-
18-
$(NAME).sql: $(NAME).sql.in
19-
sed -e 's:MODULE_PATHNAME:$(libdir)/contrib/$(SONAME):g' < $< > $@
20-
21-
install: all installdirs
22-
$(INSTALL_DATA) README.$(NAME) $(docdir)/contrib
23-
$(INSTALL_DATA) $(NAME).sql $(datadir)/contrib
24-
$(INSTALL_SHLIB) $(SONAME) $(libdir)/contrib
25-
26-
installdirs:
27-
$(mkinstalldirs) $(docdir)/contrib $(datadir)/contrib $(libdir)/contrib
28-
29-
uninstall:
30-
rm -rf $(docdir)/contrib/README.$(NAME) $(datadir)/contrib/$(NAME).sql $(libdir)/contrib/$(SONAME)
31-
32-
clean distclean maintainer-clean:
33-
rm -f $(SONAME) $(NAME).sql
34-
35-
depend dep:
36-
$(CC) -MM -MG $(CFLAGS) *.c > depend
37-
38-
ifeq (depend,$(wildcard depend))
39-
include depend
40-
endif
11+
include $(top_srcdir)/contrib/contrib-global.mk

contrib/btree_gist/Makefile

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,12 @@
1+
# $Header: /cvsroot/pgsql/contrib/btree_gist/Makefile,v 1.3 2001/09/06 10:49:29 petere Exp $
2+
13
subdir = contrib/btree_gist
24
top_builddir = ../..
35
include $(top_builddir)/src/Makefile.global
46

5-
# override libdir to install shlib in contrib not main directory
6-
libdir := $(libdir)/contrib
7-
8-
# shared library parameters
9-
NAME= btree_gist
10-
SO_MAJOR_VERSION= 1
11-
SO_MINOR_VERSION= 0
12-
13-
override CPPFLAGS += -I$(srcdir)
14-
15-
OBJS= btree_gist.o
16-
17-
all: all-lib $(NAME).sql
18-
19-
# Shared library stuff
20-
include $(top_srcdir)/src/Makefile.shlib
21-
22-
23-
$(NAME).sql: $(NAME).sql.in
24-
sed -e 's:MODULE_PATHNAME:$(libdir)/$(shlib):g' < $< > $@
25-
26-
.PHONY: submake
27-
submake:
28-
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress
29-
30-
# against installed postmaster
31-
installcheck: submake
32-
$(top_builddir)/src/test/regress/pg_regress btree_gist
33-
34-
# in-tree test doesn't work yet (no way to install my shared library)
35-
#check: all submake
36-
# $(top_builddir)/src/test/regress/pg_regress --temp-install \
37-
# --top-builddir=$(top_builddir) btree_gist
38-
check:
39-
@echo "'make check' is not supported."
40-
@echo "Do 'make install', then 'make installcheck' instead."
41-
42-
install: all installdirs install-lib
43-
$(INSTALL_DATA) $(srcdir)/README.$(NAME) $(docdir)/contrib
44-
$(INSTALL_DATA) $(NAME).sql $(datadir)/contrib
45-
46-
installdirs:
47-
$(mkinstalldirs) $(docdir)/contrib $(datadir)/contrib $(libdir)
48-
49-
uninstall: uninstall-lib
50-
rm -f $(docdir)/contrib/README.$(NAME) $(datadir)/contrib/$(NAME).sql
51-
52-
clean distclean maintainer-clean: clean-lib
53-
rm -f *.so y.tab.c y.tab.h $(OBJS) $(NAME).sql
54-
# things created by various check targets
55-
rm -rf results tmp_check log
56-
rm -f regression.diffs regression.out regress.out run_check.out
57-
ifeq ($(PORTNAME), win)
58-
rm -f regress.def
59-
endif
60-
61-
depend dep:
62-
$(CC) -MM $(CFLAGS) *.c >depend
7+
MODULES = btree_gist
8+
DATA_built = btree_gist.sql
9+
DOCS = README.btree_gist
10+
REGRESS = btree_gist
6311

64-
ifeq (depend,$(wildcard depend))
65-
include depend
66-
endif
12+
include $(top_srcdir)/contrib/contrib-global.mk

contrib/chkpass/Makefile

Lines changed: 5 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,11 @@
1-
#
2-
# $Header: /cvsroot/pgsql/contrib/chkpass/Makefile,v 1.2 2001/08/23 16:50:33 tgl Exp $
3-
#
1+
# $Header: /cvsroot/pgsql/contrib/chkpass/Makefile,v 1.3 2001/09/06 10:49:29 petere Exp $
42

53
subdir = contrib/chkpass
64
top_builddir = ../..
75
include $(top_builddir)/src/Makefile.global
86

9-
# override libdir to install shlib in contrib not main directory
10-
libdir := $(libdir)/contrib
7+
MODULES = chkpass
8+
DATA_built = chkpass.sql
9+
DOCS = README.chkpass
1110

12-
# shared library parameters
13-
NAME= chkpass
14-
SO_MAJOR_VERSION= 1
15-
SO_MINOR_VERSION= 0
16-
17-
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
18-
19-
ifdef REFINT_VERBOSE
20-
override CPPFLAGS+= -DREFINT_VERBOSE
21-
endif
22-
23-
OBJS= chkpass.o
24-
25-
all: all-lib $(NAME).sql
26-
27-
# Shared library stuff
28-
include $(top_srcdir)/src/Makefile.shlib
29-
30-
31-
$(NAME).sql: $(NAME).sql.in
32-
sed -e 's:MODULE_PATHNAME:$(libdir)/$(shlib):g' < $< > $@
33-
34-
install: all installdirs install-lib
35-
$(INSTALL_DATA) $(srcdir)/README.$(NAME) $(docdir)/contrib
36-
$(INSTALL_DATA) $(NAME).sql $(datadir)/contrib
37-
38-
installdirs:
39-
$(mkinstalldirs) $(docdir)/contrib $(datadir)/contrib $(libdir)
40-
41-
uninstall: uninstall-lib
42-
rm -f $(docdir)/contrib/README.$(NAME) $(datadir)/contrib/$(NAME).sql
43-
44-
clean distclean maintainer-clean: clean-lib
45-
rm -f $(OBJS) $(NAME).sql
46-
47-
depend dep:
48-
$(CC) -MM -MG $(CFLAGS) *.c >depend
49-
50-
ifeq (depend,$(wildcard depend))
51-
include depend
52-
endif
11+
include $(top_srcdir)/contrib/contrib-global.mk

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