Skip to content

Commit a057cbe

Browse files
committed
Qualify %.in rule to avoid triggering on configure.in, repair unportable
attempt to install more than one file per 'install' invocation, clean up some other oddities.
1 parent 7ceeeb6 commit a057cbe

File tree

1 file changed

+26
-33
lines changed

1 file changed

+26
-33
lines changed

contrib/rserv/Makefile

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,53 @@
11
# Makefile for erServer demonstration implementation
22
# (c) 2000 Vadim Mikheev, PostgreSQL Inc.
33

4-
#vpath %.pl perl
5-
#vpath %.pm perl
6-
74
subdir = contrib/rserv
85
top_builddir = ../..
96
include $(top_builddir)/src/Makefile.global
107

118
NAME = rserv
12-
OBJS = $(NAME).o
13-
DOCS = README.$(NAME)
9+
SONAME = $(NAME)$(DLSUFFIX)
1410
SQLS = master.sql slave.sql
1511
TCLS = RservTest
1612
PERLS = MasterInit MasterAddTable Replicate MasterSync CleanLog
1713
PERLS += SlaveInit SlaveAddTable GetSyncID
1814
PERLS += PrepareSnapshot ApplySnapshot
19-
LIBS = RServ.pm
2015
SCRIPTS = InitRservTest
21-
MODS = $(OBJS:.o=$(DLSUFFIX))
2216

2317
override CPPFLAGS += -I$(srcdir)
2418
override CFLAGS += $(CFLAGS_SL)
2519

26-
INPUTFILES = $(wildcard *.in)
27-
CLEANFILES = $(INPUTFILES:.in=)
28-
CLEANFILES += $(OBJS) $(MODS)
29-
30-
.PHONY: all install installdirs tarball
31-
32-
all: $(SQLS) $(TCLS) $(PERLS) $(SCRIPTS) $(MODS)
3320

34-
install: all installdirs
35-
$(INSTALL_DATA) $(SQLS) $(libdir)/contrib
36-
$(INSTALL_SCRIPT) $(TCLS) $(PERLS) $(SCRIPTS) $(bindir)
37-
$(INSTALL_SCRIPT) $(LIBS) $(libdir)/contrib
38-
$(INSTALL_SHLIB) $(MODS) $(libdir)/contrib
39-
$(INSTALL_DATA) $(DOCS) $(docdir)/contrib/$(NAME)
40-
41-
installdirs:
42-
$(mkinstalldirs) $(datadir)/contrib $(libdir)/contrib $(docdir)/contrib/$(NAME)
21+
all: $(SQLS) $(TCLS) $(PERLS) $(SCRIPTS) $(SONAME)
4322

4423
%.sql: %.sql.in
45-
rm -f $@; \
46-
C=`pwd`; \
4724
sed -e "s:_OBJWD_:$(libdir)/contrib:g" \
48-
-e "s:_DLSUFFIX_:$(DLSUFFIX):g" < $< > $@
25+
-e "s:_DLSUFFIX_:$(DLSUFFIX):g" $< >$@
4926

50-
%: %.in
27+
$(PERLS) $(TCLS) $(SCRIPTS): %: %.in
5128
sed -e "s:_OBJWD_:$(libdir)/contrib:g" \
5229
-e "s:_DLSUFFIX_:$(DLSUFFIX):g" \
53-
-e "s:@SQLDIR@:$(libdir)/contrib:g" \
30+
-e "s:@SQLDIR@:$(datadir)/contrib:g" \
5431
-e "s:@BINDIR@:$(bindir):g" \
55-
-e "s:@LIBDIR@:$(libdir)/contrib:g" < $< > $@
56-
chmod 775 $@
32+
-e "s:@LIBDIR@:$(datadir)/contrib:g" $< >$@
33+
chmod a+x $@
34+
35+
36+
install: all installdirs
37+
for file in $(SQLS); do \
38+
$(INSTALL_DATA) $$file $(DESTDIR)$(datadir)/contrib || exit ; \
39+
done
40+
for file in $(TCLS) $(PERLS) $(SCRIPTS); do \
41+
$(INSTALL_SCRIPT) $$file $(DESTDIR)$(bindir) || exit ; \
42+
done
43+
$(INSTALL_DATA) RServ.pm $(DESTDIR)$(datadir)/contrib
44+
$(INSTALL_SHLIB) $(SONAME) $(DESTDIR)$(libdir)/contrib
45+
$(INSTALL_DATA) README.$(NAME) $(DESTDIR)$(docdir)/contrib
46+
47+
installdirs:
48+
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/contrib \
49+
$(DESTDIR)$(libdir)/contrib $(DESTDIR)$(docdir)/contrib
50+
5751

58-
clean:
59-
# @echo "Removing $(CLEANFILES)"
60-
rm -f $(CLEANFILES)
52+
clean distclean maintainer-clean:
53+
rm -f $(SQLS) $(TCLS) $(PERLS) $(SCRIPTS) $(SONAME) $(NAME).o

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