Skip to content

Commit 335248c

Browse files
committed
Support for DESTDIR make variable. This is used as in `make install
DESTDIR=/else/where' and prepends the value of DESTDIR to the full installation paths (e.g., /else/where/usr/local/pgsql/bin). This allows users to install the package into a location different from the one that was configured and hard-coded into various scripts, e.g., for creating binary packages. DESTDIR is in many cases preferrable over `make install prefix=/else/where' because a) `prefix' affects the path that is hard-coded into the files, which can lead to a `make install prefix=xxx' (as done by the regression test driver) corrupting the files in the source tree with wrong paths. b) it doesn't work at all if a directory was overridden to not depend on `prefix', e.g., --sysconfdir=/etc. (Updating the regression test driver to use DESTDIR is a separate undertaking.) See also autoconf@gnu.org, From: Akim Demaille <akim@epita.fr>, Date: 08 Sep 2000 12:48:59 +0200, Message-ID: <mv4em2vb1lw.fsf@nostromo.lrde.epita.fr>, Subject: Re: HTML format documentation.
1 parent e930a9a commit 335248c

File tree

29 files changed

+151
-152
lines changed

29 files changed

+151
-152
lines changed

doc/Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/doc/Makefile,v 1.18 2000/07/17 22:31:57 petere Exp $
7+
# $Header: /cvsroot/pgsql/doc/Makefile,v 1.19 2000/09/17 13:02:28 petere Exp $
88
#
99
#----------------------------------------------------------------------------
1010

@@ -38,21 +38,21 @@ all:
3838
install: all installdirs
3939
ifneq ($(strip $(found_MODULES)),)
4040
for module in $(found_MODULES); do \
41-
gunzip -c $${module}.tar.gz | ( cd $(docdir)/$$module && $(TAR) xf - ) || \
41+
gzip -d -c $${module}.tar.gz | ( cd $(DESTDIR)$(docdir)/$$module && $(TAR) xf - ) || \
4242
exit; \
4343
done
4444
endif
4545
ifdef found_man
46-
gunzip -c man.tar.gz | ( cd $(mandir) && $(TAR) xf - )
46+
gzip -d -c man.tar.gz | ( cd $(DESTDIR)$(mandir) && $(TAR) xf - )
4747
endif
4848

4949

5050
installdirs:
51-
$(mkinstalldirs) $(mandir) $(addprefix $(docdir)/, . $(found_MODULES))
51+
$(mkinstalldirs) $(DESTDIR)$(mandir) $(addprefix $(DESTDIR)$(docdir)/, . $(found_MODULES))
5252

5353

5454
uninstall:
55-
-rm -rf $(addprefix $(docdir)/, $(MODULES))
55+
-rm -rf $(addprefix $(DESTDIR)$(docdir)/, $(MODULES))
5656
ifdef found_man
57-
-rm -f $(addprefix $(mandir)/, $(shell gunzip -c man.tar.gz | tar tf -))
57+
-rm -f $(addprefix $(DESTDIR)$(mandir)/, $(shell gunzip -c man.tar.gz | tar tf -))
5858
endif

src/Makefile.shlib

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 1998, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.22 2000/07/07 01:23:43 momjian Exp $
9+
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.23 2000/09/17 13:02:29 petere Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -274,19 +274,19 @@ endif # shlib
274274
install-lib: install-lib-static install-lib-shared
275275

276276
install-lib-static: lib$(NAME).a
277-
$(INSTALL_DATA) $< $(libdir)/lib$(NAME).a
277+
$(INSTALL_DATA) $< $(DESTDIR)$(libdir)/lib$(NAME).a
278278

279279
ifdef shlib
280280
install-lib-shared: $(shlib)
281-
$(INSTALL_SHLIB) $< $(libdir)/$(shlib)
281+
$(INSTALL_SHLIB) $< $(DESTDIR)$(libdir)/$(shlib)
282282
ifneq ($(PORTNAME), win)
283283
ifneq ($(shlib), lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION))
284-
cd $(libdir) && \
284+
cd $(DESTDIR)$(libdir) && \
285285
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) && \
286286
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
287287
endif
288288
ifneq ($(shlib), lib$(NAME)$(DLSUFFIX))
289-
cd $(libdir) && \
289+
cd $(DESTDIR)$(libdir) && \
290290
rm -f lib$(NAME)$(DLSUFFIX) && \
291291
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX)
292292
endif
@@ -301,11 +301,11 @@ endif # shlib
301301

302302
.PHONY: uninstall-lib
303303
uninstall-lib:
304-
rm -f $(libdir)/lib$(NAME).a
304+
rm -f $(DESTDIR)$(libdir)/lib$(NAME).a
305305
ifdef shlib
306-
rm -f $(libdir)/lib$(NAME)$(DLSUFFIX) \
307-
$(libdir)/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) \
308-
$(libdir)/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
306+
rm -f $(DESTDIR)$(libdir)/lib$(NAME)$(DLSUFFIX) \
307+
$(DESTDIR)$(libdir)/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) \
308+
$(DESTDIR)$(libdir)/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
309309
endif # shlib
310310

311311

src/backend/Makefile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.64 2000/08/31 16:09:23 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.65 2000/09/17 13:02:30 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -119,43 +119,43 @@ distprep:
119119
install: all installdirs install-bin
120120
ifeq ($(PORTNAME), win)
121121
ifeq ($(MAKE_DLL), true)
122-
$(INSTALL_DATA) libpostgres.a $(libdir)/libpostgres.a
122+
$(INSTALL_DATA) libpostgres.a $(DESTDIR)$(libdir)/libpostgres.a
123123
endif
124124
endif
125125
$(MAKE) -C catalog install-bki
126-
$(INSTALL_DATA) libpq/pg_hba.conf.sample $(datadir)/pg_hba.conf.sample
127-
$(INSTALL_DATA) libpq/pg_ident.conf.sample $(datadir)/pg_ident.conf.sample
128-
$(INSTALL_DATA) utils/misc/postgresql.conf.sample $(datadir)/postgresql.conf.sample
126+
$(INSTALL_DATA) libpq/pg_hba.conf.sample $(DESTDIR)$(datadir)/pg_hba.conf.sample
127+
$(INSTALL_DATA) libpq/pg_ident.conf.sample $(DESTDIR)$(datadir)/pg_ident.conf.sample
128+
$(INSTALL_DATA) utils/misc/postgresql.conf.sample $(DESTDIR)$(datadir)/postgresql.conf.sample
129129

130130
installdirs:
131-
$(mkinstalldirs) $(bindir) $(libdir) $(datadir)
131+
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(datadir)
132132

133133
install-bin: postgres $(POSTGRES_IMP) installdirs
134-
$(INSTALL_PROGRAM) postgres$(X) $(bindir)/postgres$(X)
135-
@rm -f $(bindir)/postmaster
136-
ln -s postgres$(X) $(bindir)/postmaster
134+
$(INSTALL_PROGRAM) postgres$(X) $(DESTDIR)$(bindir)/postgres$(X)
135+
@rm -f $(DESTDIR)$(bindir)/postmaster
136+
ln -s postgres$(X) $(DESTDIR)$(bindir)/postmaster
137137
ifeq ($(MAKE_EXPORTS), true)
138-
$(INSTALL_DATA) $(POSTGRES_IMP) $(libdir)/$(POSTGRES_IMP)
138+
$(INSTALL_DATA) $(POSTGRES_IMP) $(DESTDIR)$(libdir)/$(POSTGRES_IMP)
139139
endif
140140

141141
.PHONY: install-bin
142142

143143
##########################################################################
144144

145145
uninstall:
146-
rm -f $(bindir)/postgres$(X) $(bindir)/postmaster
146+
rm -f $(DESTDIR)$(bindir)/postgres$(X) $(DESTDIR)$(bindir)/postmaster
147147
ifeq ($(MAKE_EXPORTS), true)
148-
rm -f $(libdir)/$(POSTGRES_IMP)
148+
rm -f $(DESTDIR)$(libdir)/$(POSTGRES_IMP)
149149
endif
150150
ifeq ($(PORTNAME), win)
151151
ifeq ($(MAKE_DLL), true)
152-
rm -f $(libdir)/libpostgres.a
152+
rm -f $(DESTDIR)$(libdir)/libpostgres.a
153153
endif
154154
endif
155155
$(MAKE) -C catalog uninstall-bki
156-
rm -f $(datadir)/pg_hba.conf.sample \
157-
$(datadir)/pg_ident.conf.sample \
158-
$(datadir)/postgresql.conf.sample
156+
rm -f $(DESTDIR)$(datadir)/pg_hba.conf.sample \
157+
$(DESTDIR)$(datadir)/pg_ident.conf.sample \
158+
$(DESTDIR)$(datadir)/postgresql.conf.sample
159159

160160

161161
##########################################################################

src/backend/catalog/Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for catalog
44
#
5-
# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.24 2000/08/31 16:09:49 petere Exp $
5+
# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.25 2000/09/17 13:02:30 petere Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -43,17 +43,17 @@ template1.bki template1.description: genbki.sh $(TEMPLATE1_BKI_SRCS)
4343

4444
.PHONY: install-bki
4545
install-bki: $(BKIFILES) installdirs
46-
$(INSTALL_DATA) global.bki $(datadir)/global.bki
47-
$(INSTALL_DATA) global.description $(datadir)/global.description
48-
$(INSTALL_DATA) template1.bki $(datadir)/template1.bki
49-
$(INSTALL_DATA) template1.description $(datadir)/template1.description
46+
$(INSTALL_DATA) global.bki $(DESTDIR)$(datadir)/global.bki
47+
$(INSTALL_DATA) global.description $(DESTDIR)$(datadir)/global.description
48+
$(INSTALL_DATA) template1.bki $(DESTDIR)$(datadir)/template1.bki
49+
$(INSTALL_DATA) template1.description $(DESTDIR)$(datadir)/template1.description
5050

5151
installdirs:
52-
$(mkinstalldirs) $(datadir)
52+
$(mkinstalldirs) $(DESTDIR)$(datadir)
5353

5454
.PHONY: uninstall-bki
5555
uninstall-bki:
56-
rm -f $(addprefix $(datadir)/, $(BKIFILES))
56+
rm -f $(addprefix $(DESTDIR)$(datadir)/, $(BKIFILES))
5757

5858

5959
clean:

src/bin/initdb/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.23 2000/09/08 18:29:21 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.24 2000/09/17 13:02:31 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -23,13 +23,13 @@ initdb: initdb.sh $(top_builddir)/src/Makefile.global
2323
chmod a+x $@
2424

2525
install: all installdirs
26-
$(INSTALL_SCRIPT) initdb $(bindir)/initdb
26+
$(INSTALL_SCRIPT) initdb $(DESTDIR)$(bindir)/initdb
2727

2828
installdirs:
29-
$(mkinstalldirs) $(bindir)
29+
$(mkinstalldirs) $(DESTDIR)$(bindir)
3030

3131
uninstall:
32-
rm -f $(bindir)/initdb
32+
rm -f $(DESTDIR)$(bindir)/initdb
3333

3434
clean distclean maintainer-clean:
3535
rm -f initdb

src/bin/initlocation/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/Makefile,v 1.11 2000/09/08 18:29:22 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/Makefile,v 1.12 2000/09/17 13:02:32 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -19,13 +19,13 @@ initlocation: initlocation.sh
1919
chmod a+x $@
2020

2121
install: all installdirs
22-
$(INSTALL_SCRIPT) initlocation $(bindir)/initlocation
22+
$(INSTALL_SCRIPT) initlocation $(DESTDIR)$(bindir)/initlocation
2323

2424
installdirs:
25-
$(mkinstalldirs) $(bindir)
25+
$(mkinstalldirs) $(DESTDIR)$(bindir)
2626

2727
uninstall:
28-
rm -f $(bindir)/initlocation
28+
rm -f $(DESTDIR)$(bindir)/initlocation
2929

3030
clean distclean maintainer-clean:
3131
rm -f initlocation

src/bin/ipcclean/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/Makefile,v 1.13 2000/09/08 18:29:23 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/Makefile,v 1.14 2000/09/17 13:02:33 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -19,13 +19,13 @@ ipcclean: ipcclean.sh
1919
chmod a+x $@
2020

2121
install: all installdirs
22-
$(INSTALL_SCRIPT) ipcclean $(bindir)/ipcclean
22+
$(INSTALL_SCRIPT) ipcclean $(DESTDIR)$(bindir)/ipcclean
2323

2424
installdirs:
25-
$(mkinstalldirs) $(bindir)
25+
$(mkinstalldirs) $(DESTDIR)$(bindir)
2626

2727
uninstall:
28-
rm -f $(bindir)/ipcclean
28+
rm -f $(DESTDIR)$(bindir)/ipcclean
2929

3030
clean distclean maintainer-clean:
3131
rm -f ipcclean

src/bin/pg-config/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/src/bin/pg-config/Attic/Makefile,v 1.2 2000/09/08 18:29:26 petere Exp $
1+
# $Header: /cvsroot/pgsql/src/bin/pg-config/Attic/Makefile,v 1.3 2000/09/17 13:02:34 petere Exp $
22

33
subdir = src/bin/pg-config
44
top_builddir = ../../..
@@ -17,13 +17,13 @@ pg-config: pg-config.sh $(top_builddir)/config.status $(top_builddir)/src/Makefi
1717
chmod a+x $@
1818

1919
install: all installdirs
20-
$(INSTALL_SCRIPT) pg-config $(bindir)/pg-config
20+
$(INSTALL_SCRIPT) pg-config $(DESTDIR)$(bindir)/pg-config
2121

2222
installdirs:
23-
$(mkinstalldirs) $(bindir)
23+
$(mkinstalldirs) $(DESTDIR)$(bindir)
2424

2525
uninstall:
26-
rm -f $(bindir)/pg-config
26+
rm -f $(DESTDIR)$(bindir)/pg-config
2727

2828
clean distclean maintainer-clean:
2929
rm -f pg-config

src/bin/pg_ctl/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1999, PostgreSQL Global Development Group
66
#
7-
# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Makefile,v 1.8 2000/09/08 18:29:27 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Makefile,v 1.9 2000/09/17 13:02:35 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -19,13 +19,13 @@ pg_ctl: pg_ctl.sh
1919
chmod a+x $@
2020

2121
install: all installdirs
22-
$(INSTALL_SCRIPT) pg_ctl $(bindir)/pg_ctl
22+
$(INSTALL_SCRIPT) pg_ctl $(DESTDIR)$(bindir)/pg_ctl
2323

2424
installdirs:
25-
$(mkinstalldirs) $(bindir)
25+
$(mkinstalldirs) $(DESTDIR)$(bindir)
2626

2727
uninstall:
28-
rm -f $(bindir)/pg_ctl
28+
rm -f $(DESTDIR)$(bindir)/pg_ctl
2929

3030
clean distclean maintainer-clean:
3131
rm -f pg_ctl

src/bin/pg_dump/Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.24 2000/09/08 18:29:27 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.25 2000/09/17 13:02:36 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -41,16 +41,16 @@ submake:
4141
$(MAKE) -C $(libpq_builddir) all
4242

4343
install: all installdirs
44-
$(INSTALL_PROGRAM) pg_dump$(X) $(bindir)/pg_dump$(X)
45-
$(INSTALL_PROGRAM) pg_restore$(X) $(bindir)/pg_restore$(X)
46-
$(INSTALL_SCRIPT) pg_dumpall $(bindir)/pg_dumpall
47-
$(INSTALL_SCRIPT) pg_upgrade $(bindir)/pg_upgrade
44+
$(INSTALL_PROGRAM) pg_dump$(X) $(DESTDIR)$(bindir)/pg_dump$(X)
45+
$(INSTALL_PROGRAM) pg_restore$(X) $(DESTDIR)$(bindir)/pg_restore$(X)
46+
$(INSTALL_SCRIPT) pg_dumpall $(DESTDIR)$(bindir)/pg_dumpall
47+
$(INSTALL_SCRIPT) pg_upgrade $(DESTDIR)$(bindir)/pg_upgrade
4848

4949
installdirs:
50-
$(mkinstalldirs) $(bindir)
50+
$(mkinstalldirs) $(DESTDIR)$(bindir)
5151

5252
uninstall:
53-
rm -f $(addprefix $(bindir)/, pg_dump$(X) pg_restore$(X) pg_dumpall pg_upgrade)
53+
rm -f $(addprefix $(DESTDIR)$(bindir)/, pg_dump$(X) pg_restore$(X) pg_dumpall pg_upgrade)
5454

5555
depend dep:
5656
$(CC) -MM $(CFLAGS) *.c >depend

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