2000-06-15 22:55:34 +04:00
|
|
|
#
|
2000-07-09 17:14:19 +04:00
|
|
|
# $Header: /cvsroot/pgsql/contrib/spi/Makefile,v 1.17 2000/07/09 13:13:36 petere Exp $
|
2000-06-15 22:55:34 +04:00
|
|
|
#
|
1997-09-11 10:51:23 +04:00
|
|
|
|
2000-07-09 17:14:19 +04:00
|
|
|
subdir = contrib/spi
|
|
|
|
top_builddir = ../..
|
|
|
|
include ../../src/Makefile.global
|
1997-09-11 10:51:23 +04:00
|
|
|
|
2000-06-15 22:55:34 +04:00
|
|
|
OBJS = autoinc.o insert_username.o moddatetime.o refint.o timetravel.o
|
2000-06-19 17:54:50 +04:00
|
|
|
DOCS = README.spi
|
2000-06-15 22:55:34 +04:00
|
|
|
SQLS = $(OBJS:.o=.sql)
|
2000-07-09 17:14:19 +04:00
|
|
|
EXAMPLES= $(OBJS:.o=.example)
|
2000-06-15 22:55:34 +04:00
|
|
|
MODS = $(OBJS:.o=$(DLSUFFIX))
|
|
|
|
|
|
|
|
CFLAGS += -I. $(CFLAGS_SL)
|
1997-09-11 13:08:31 +04:00
|
|
|
|
|
|
|
ifdef REFINT_VERBOSE
|
|
|
|
CFLAGS+= -DREFINT_VERBOSE
|
|
|
|
endif
|
1997-09-11 10:51:23 +04:00
|
|
|
|
2000-06-15 22:55:34 +04:00
|
|
|
all: $(MODS) $(SQLS)
|
|
|
|
|
|
|
|
%.sql: %.sql.in
|
2000-07-09 17:14:19 +04:00
|
|
|
sed -e 's:MODULE_PATHNAME:$(libdir)/contrib/$(@:.sql=$(DLSUFFIX)):g' < $< > $@
|
2000-06-15 22:55:34 +04:00
|
|
|
|
2000-07-09 17:14:19 +04:00
|
|
|
install: all installdirs
|
2000-06-15 22:55:34 +04:00
|
|
|
for inst_file in $(SQLS); do \
|
2000-07-09 17:14:19 +04:00
|
|
|
$(INSTALL_DATA) $$inst_file $(datadir)/contrib || exit; \
|
2000-06-15 22:55:34 +04:00
|
|
|
done
|
|
|
|
for inst_file in $(MODS); do \
|
2000-07-09 17:14:19 +04:00
|
|
|
$(INSTALL_SHLIB) $$inst_file $(libdir)/contrib || exit; \
|
2000-06-15 22:55:34 +04:00
|
|
|
done
|
2000-07-09 17:14:19 +04:00
|
|
|
for inst_file in $(EXAMPLES) README.spi; do \
|
|
|
|
$(INSTALL_DATA) $$inst_file $(docdir)/contrib/spi || exit; \
|
2000-06-15 22:55:34 +04:00
|
|
|
done
|
|
|
|
|
2000-07-09 17:14:19 +04:00
|
|
|
installdirs:
|
|
|
|
$(mkinstalldirs) $(datadir)/contrib $(libdir)/contrib $(docdir)/contrib/spi
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(addprefix $(datadir)/contrib/, $(SQLS)) \
|
|
|
|
$(addprefix $(libdir)/contrib/, $(MODS)) \
|
|
|
|
$(addprefix $(docdir)/contrib/spi/, $(EXAMPLES) README.spi)
|
|
|
|
|
|
|
|
clean distclean maintainer-clean:
|
|
|
|
rm -f $(MODS) $(SQLS) $(OBJS)
|
|
|
|
|
2000-06-15 22:55:34 +04:00
|
|
|
depend dep:
|
|
|
|
$(CC) -MM -MG $(CFLAGS) *.c > depend
|
1997-09-11 10:51:23 +04:00
|
|
|
|
2000-06-15 22:55:34 +04:00
|
|
|
ifeq (depend,$(wildcard depend))
|
|
|
|
include depend
|
|
|
|
endif
|