1- # $Header: /cvsroot/pgsql/contrib/contrib-global.mk,v 1.3 2002/09/05 18:28:45 petere Exp $
1+ # $Header: /cvsroot/pgsql/contrib/contrib-global.mk,v 1.4 2002/11/01 23:45:37 tgl Exp $
22
33# This file contains generic rules to build many kinds of simple
44# contrib modules. You only need to set a few variables and include
2424# which need to be built first
2525# DOCS -- random files to install under $PREFIX/doc/contrib
2626# SCRIPTS -- script files (not binaries) to install into $PREFIX/bin
27+ # SCRIPTS_built -- script files (not binaries) to install into $PREFIX/bin,
28+ # which need to be built first
2729# REGRESS -- list of regression test cases (without suffix)
2830#
2931# or at most one of these two:
@@ -52,7 +54,7 @@ ifdef PG_CPPFLAGS
5254override CPPFLAGS :=$(PG_CPPFLAGS ) $(CPPFLAGS )
5355endif
5456
55- all :$(PROGRAM ) $(DATA_built ) $(addsuffix $(DLSUFFIX ) ,$(MODULES ) )
57+ all :$(PROGRAM ) $(DATA_built ) $(SCRIPTS_built ) $( addsuffix $(DLSUFFIX ) ,$(MODULES ) )
5658
5759ifdef MODULE_big
5860# shared library parameters
@@ -100,6 +102,12 @@ ifdef SCRIPTS
100102 $(INSTALL_SCRIPT) $$file $(DESTDIR)$(bindir); \
101103done
102104endif # SCRIPTS
105+ ifdef SCRIPTS_built
106+ @for file in $(SCRIPTS_built); do \
107+ echo "$(INSTALL_SCRIPT) $$file $(DESTDIR)$(bindir)"; \
108+ $(INSTALL_SCRIPT) $$file $(DESTDIR)$(bindir); \
109+ done
110+ endif # SCRIPTS_built
103111
104112
105113installdirs :
@@ -112,7 +120,7 @@ endif
112120ifdef DOCS
113121$(mkinstalldirs) $(DESTDIR)$(docdir)/contrib
114122endif
115- ifneq (,$(PROGRAM )$(SCRIPTS ) )
123+ ifneq (,$(PROGRAM )$(SCRIPTS )$( SCRIPTS_built ) )
116124$(mkinstalldirs) $(DESTDIR)$(bindir)
117125endif
118126
@@ -136,6 +144,9 @@ endif
136144ifdef SCRIPTS
137145rm -f $(addprefix $(DESTDIR)$(bindir)/, $(SCRIPTS))
138146endif
147+ ifdef SCRIPTS_built
148+ rm -f $(addprefix $(DESTDIR)$(bindir)/, $(SCRIPTS_built))
149+ endif
139150
140151
141152clean :
@@ -145,6 +156,9 @@ endif
145156ifdef DATA_built
146157rm -f $(DATA_built)
147158endif
159+ ifdef SCRIPTS_built
160+ rm -f $(SCRIPTS_built)
161+ endif
148162ifdef PROGRAM
149163rm -f $(PROGRAM)$(X)
150164endif