1998-10-19 08:00:51 +08:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile.shlib
|
|
|
|
# Common rules for building shared libraries
|
|
|
|
#
|
|
|
|
# Copyright (c) 1998, Regents of the University of California
|
|
|
|
#
|
|
|
|
# IDENTIFICATION
|
2003-11-30 03:52:15 +08:00
|
|
|
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.73 2003/11/29 19:51:39 pgsql Exp $
|
1998-10-19 08:00:51 +08:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2000-06-29 02:30:16 +08:00
|
|
|
# This file should be included by any Postgres module Makefile that
|
|
|
|
# wants to build a shared library (if possible for the current
|
|
|
|
# platform). A static library is also built from the same object
|
|
|
|
# files. Only one library can be built per makefile.
|
1998-10-19 08:00:51 +08:00
|
|
|
#
|
2000-06-29 02:30:16 +08:00
|
|
|
# Before including this file, the module Makefile must define these
|
|
|
|
# variables:
|
1998-10-19 08:00:51 +08:00
|
|
|
#
|
2000-06-29 02:30:16 +08:00
|
|
|
# NAME Name of library to build (no suffix nor "lib" prefix)
|
|
|
|
# SO_MAJOR_VERSION Major version number to use for shared library
|
|
|
|
# SO_MINOR_VERSION Minor version number to use for shared library
|
|
|
|
# OBJS List of object files to include in library
|
|
|
|
# SHLIB_LINK If shared library relies on other libraries,
|
|
|
|
# additional stuff to put in its link command
|
|
|
|
# (If you want a patchlevel, include it in SO_MINOR_VERSION, e.g., "6.2".)
|
1998-10-19 08:00:51 +08:00
|
|
|
#
|
2000-06-29 02:30:16 +08:00
|
|
|
# The module Makefile must also include
|
|
|
|
# $(top_builddir)/src/Makefile.global before including this file.
|
|
|
|
# (Makefile.global sets PORTNAME and other needed symbols.)
|
1998-10-19 08:00:51 +08:00
|
|
|
#
|
2000-06-29 02:30:16 +08:00
|
|
|
# This makefile provides the following (phony) targets:
|
1998-10-19 08:00:51 +08:00
|
|
|
#
|
2000-06-29 02:30:16 +08:00
|
|
|
# all-lib build the static and shared (if applicable) libraries
|
|
|
|
# install-lib install the libraries into $(libdir)
|
|
|
|
# uninstall-lib remove the libraries from $(libdir)
|
|
|
|
# clean-lib delete the static and shared libraries from the build dir
|
1998-10-19 08:00:51 +08:00
|
|
|
#
|
2000-06-29 02:30:16 +08:00
|
|
|
# Since `all-lib' is the first rule in this file you probably want to
|
|
|
|
# have the `all' target before including this file. In the most simple
|
|
|
|
# case it would look like this:
|
|
|
|
#
|
|
|
|
# all: all-lib
|
|
|
|
#
|
|
|
|
# Similarly, the install rule might look like
|
|
|
|
#
|
|
|
|
# install: install-lib
|
|
|
|
#
|
|
|
|
# plus any additional things you want to install. Et cetera.
|
|
|
|
#
|
|
|
|
# Got that? Look at src/interfaces/libpq/Makefile for an example.
|
2001-02-11 02:46:34 +08:00
|
|
|
#
|
|
|
|
# While the linker allows creation of most shared libraries,
|
|
|
|
# -Bsymbolic requires resolution of all symbols, making the
|
|
|
|
# compiler a better choice for shared library creation on ELF platforms.
|
|
|
|
# With the linker, -Bsymbolic requires the crt1.o startup object file.
|
|
|
|
# bjm 2001-02-10
|
|
|
|
|
1998-10-19 08:00:51 +08:00
|
|
|
|
2000-11-01 03:55:20 +08:00
|
|
|
COMPILER = $(CC) $(CFLAGS)
|
2000-10-24 05:44:12 +08:00
|
|
|
LINK.static = $(AR) $(AROPT)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ifeq ($(enable_shared), yes)
|
|
|
|
|
|
|
|
# For each platform we support shared libraries on, set shlib to the
|
|
|
|
# name of the library, LINK.shared to the command to link the library,
|
|
|
|
# and adjust SHLIB_LINK if necessary.
|
1998-10-19 08:00:51 +08:00
|
|
|
|
1999-07-17 06:56:01 +08:00
|
|
|
# Try to keep the sections in some kind of order, folks...
|
1999-07-08 08:15:03 +08:00
|
|
|
|
2002-09-05 06:54:18 +08:00
|
|
|
override CFLAGS += $(CFLAGS_SL)
|
2000-10-24 05:44:12 +08:00
|
|
|
|
2000-11-09 04:18:49 +08:00
|
|
|
soname = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
2000-10-24 05:44:12 +08:00
|
|
|
|
1999-07-17 06:56:01 +08:00
|
|
|
ifeq ($(PORTNAME), aix)
|
2000-06-29 02:30:16 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX)
|
2002-10-10 00:21:54 +08:00
|
|
|
# SHLIB_LINK += -lc
|
1998-10-31 11:58:55 +08:00
|
|
|
endif
|
|
|
|
|
2000-11-01 03:55:20 +08:00
|
|
|
ifeq ($(PORTNAME), darwin)
|
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
2003-09-28 03:35:32 +08:00
|
|
|
LINK.shared = $(COMPILER) -bundle
|
2000-11-01 03:55:20 +08:00
|
|
|
endif
|
|
|
|
|
2000-10-11 05:22:29 +08:00
|
|
|
ifeq ($(PORTNAME), openbsd)
|
2000-10-24 05:44:12 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
|
|
|
ifdef ELF_SYSTEM
|
2001-02-11 01:17:39 +08:00
|
|
|
LINK.shared = $(COMPILER) -shared -Wl,-x,-soname,$(soname)
|
|
|
|
SHLIB_LINK += -lc
|
2000-10-24 05:44:12 +08:00
|
|
|
else
|
|
|
|
LINK.shared = $(LD) -x -Bshareable -Bforcearchive
|
1998-10-19 08:00:51 +08:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PORTNAME), bsdi)
|
2000-10-24 05:44:12 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
|
|
|
ifeq ($(DLSUFFIX), .so)
|
2001-02-11 01:17:39 +08:00
|
|
|
LINK.shared = $(COMPILER) -shared -Wl,-x,-soname,$(soname)
|
2001-02-11 00:51:40 +08:00
|
|
|
SHLIB_LINK += -lc
|
2000-10-24 05:44:12 +08:00
|
|
|
endif
|
|
|
|
ifeq ($(DLSUFFIX), .o)
|
|
|
|
LINK.shared = shlicc -O $(LDREL)
|
1998-10-19 08:00:51 +08:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
1999-07-17 06:56:01 +08:00
|
|
|
ifeq ($(PORTNAME), freebsd)
|
2000-10-24 05:44:12 +08:00
|
|
|
ifdef ELF_SYSTEM
|
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
2001-02-11 01:17:39 +08:00
|
|
|
LINK.shared = $(COMPILER) -shared -Wl,-x,-soname,$(soname)
|
2000-10-24 05:44:12 +08:00
|
|
|
else
|
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
|
|
|
LINK.shared = $(LD) -x -Bshareable -Bforcearchive
|
1999-07-17 06:56:01 +08:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2000-03-08 09:58:46 +08:00
|
|
|
ifeq ($(PORTNAME), netbsd)
|
2000-10-24 05:44:12 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
|
|
|
ifdef ELF_SYSTEM
|
2001-02-11 01:17:39 +08:00
|
|
|
LINK.shared = $(COMPILER) -shared -Wl,-x,-soname,$(soname)
|
2000-10-24 05:44:12 +08:00
|
|
|
else
|
|
|
|
LINK.shared = $(LD) -x -Bshareable -Bforcearchive
|
2000-03-08 09:58:46 +08:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
1998-10-19 08:00:51 +08:00
|
|
|
ifeq ($(PORTNAME), hpux)
|
2003-01-12 01:22:19 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
|
|
|
LINK.shared = $(LD) +h $(soname) -b +b $(libdir)
|
2003-10-20 09:34:33 +08:00
|
|
|
ifeq ($(GCC), yes)
|
|
|
|
SHLIB_LINK += `$(CC) -print-libgcc-file-name`
|
|
|
|
endif
|
1998-10-19 08:00:51 +08:00
|
|
|
endif
|
|
|
|
|
1999-07-17 06:56:01 +08:00
|
|
|
ifeq ($(PORTNAME), irix5)
|
2000-10-24 05:44:12 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
2000-11-15 05:12:00 +08:00
|
|
|
LINK.shared = $(COMPILER) -shared -Wl,-set_version,sgi$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
1999-07-17 06:56:01 +08:00
|
|
|
endif
|
|
|
|
|
1998-10-19 08:00:51 +08:00
|
|
|
ifeq ($(PORTNAME), linux)
|
2000-06-29 02:30:16 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
2000-11-09 04:18:49 +08:00
|
|
|
LINK.shared = $(COMPILER) -shared -Wl,-soname,$(soname)
|
1998-10-19 08:00:51 +08:00
|
|
|
endif
|
|
|
|
|
2000-10-11 05:22:29 +08:00
|
|
|
ifeq ($(PORTNAME), solaris)
|
2000-06-29 02:30:16 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
2002-09-05 06:54:18 +08:00
|
|
|
ifeq ($(GCC), yes)
|
|
|
|
LINK.shared = $(CC) -shared
|
2001-09-12 07:20:41 +08:00
|
|
|
else
|
2002-09-05 06:54:18 +08:00
|
|
|
LINK.shared = $(CC) -G
|
2001-09-12 07:20:41 +08:00
|
|
|
endif
|
2000-11-09 04:18:49 +08:00
|
|
|
ifeq ($(with_gnu_ld), yes)
|
2001-02-11 00:26:38 +08:00
|
|
|
LINK.shared += -Wl,-soname,$(soname)
|
2000-11-09 04:18:49 +08:00
|
|
|
else
|
2001-11-12 03:20:53 +08:00
|
|
|
LINK.shared += -h $(soname)
|
2000-11-09 04:18:49 +08:00
|
|
|
endif
|
1998-10-19 08:00:51 +08:00
|
|
|
endif
|
|
|
|
|
2001-02-27 16:13:31 +08:00
|
|
|
ifeq ($(PORTNAME), sunos4)
|
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
|
|
|
LINK.shared = $(LD) -assert pure-text -Bdynamic
|
|
|
|
endif
|
|
|
|
|
2000-10-11 05:22:29 +08:00
|
|
|
ifeq ($(PORTNAME), osf)
|
1999-05-20 02:04:51 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
2000-10-24 05:44:12 +08:00
|
|
|
LINK.shared = $(LD) -shared -expect_unresolved '*'
|
1999-05-20 02:04:51 +08:00
|
|
|
endif
|
|
|
|
|
2001-05-08 04:43:28 +08:00
|
|
|
ifeq ($(PORTNAME), sco)
|
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
2002-09-05 06:54:18 +08:00
|
|
|
ifeq ($(GCC), yes)
|
|
|
|
LINK.shared = $(CC) -shared
|
2001-05-08 04:43:28 +08:00
|
|
|
else
|
2002-09-05 06:54:18 +08:00
|
|
|
LINK.shared = $(CC) -G
|
2001-05-08 04:43:28 +08:00
|
|
|
endif
|
|
|
|
LINK.shared += -Wl,-z,text -Wl,-h,$(soname)
|
|
|
|
endif
|
|
|
|
|
1998-10-19 08:00:51 +08:00
|
|
|
ifeq ($(PORTNAME), svr4)
|
2000-06-29 02:30:16 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
2000-10-24 05:44:12 +08:00
|
|
|
LINK.shared = $(LD) -G
|
1998-10-19 08:00:51 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PORTNAME), univel)
|
2000-06-29 02:30:16 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
2000-10-24 05:44:12 +08:00
|
|
|
LINK.shared = $(LD) -G -z text
|
1998-10-19 08:00:51 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PORTNAME), unixware)
|
2000-06-29 02:30:16 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
2002-09-05 06:54:18 +08:00
|
|
|
ifeq ($(GCC), yes)
|
|
|
|
LINK.shared = $(CC) -shared
|
2000-10-28 04:09:48 +08:00
|
|
|
else
|
2002-09-05 06:54:18 +08:00
|
|
|
LINK.shared = $(CC) -G
|
2000-10-28 04:09:48 +08:00
|
|
|
endif
|
2003-09-14 21:33:08 +08:00
|
|
|
LINK.shared += -Wl,-z,text -Wl,-h,$(soname)
|
1998-10-19 08:00:51 +08:00
|
|
|
endif
|
|
|
|
|
2003-03-22 01:18:34 +08:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
2000-06-29 02:30:16 +08:00
|
|
|
shlib := $(NAME)$(DLSUFFIX)
|
1999-01-17 14:20:06 +08:00
|
|
|
endif
|
1998-10-19 08:00:51 +08:00
|
|
|
|
2000-10-07 22:39:21 +08:00
|
|
|
ifeq ($(PORTNAME), beos)
|
2000-10-24 05:44:12 +08:00
|
|
|
shlib := lib$(NAME)$(DLSUFFIX)
|
|
|
|
LINK.shared = $(LD) -nostart
|
|
|
|
SHLIB_LINK += -ltermcap -lstdc++.r4 -lbind -lsocket -L/boot/develop/lib/x86
|
2000-10-07 22:39:21 +08:00
|
|
|
endif
|
1998-10-19 08:00:51 +08:00
|
|
|
|
2001-09-23 06:54:33 +08:00
|
|
|
SHLIB_LINK := $(filter -L%, $(LDFLAGS)) $(SHLIB_LINK)
|
2000-10-28 07:59:39 +08:00
|
|
|
ifeq ($(enable_rpath), yes)
|
|
|
|
SHLIB_LINK += $(rpath)
|
|
|
|
endif
|
|
|
|
|
2000-10-24 05:44:12 +08:00
|
|
|
endif # enable_shared
|
|
|
|
|
2000-06-29 02:30:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
## BUILD
|
|
|
|
##
|
|
|
|
|
2002-09-04 23:45:50 +08:00
|
|
|
.PHONY: all-lib all-static-lib all-shared-lib
|
|
|
|
|
|
|
|
all-lib: all-static-lib all-shared-lib
|
|
|
|
|
|
|
|
all-static-lib: lib$(NAME).a
|
|
|
|
|
|
|
|
all-shared-lib: $(shlib)
|
1998-10-19 08:00:51 +08:00
|
|
|
|
2003-03-22 01:18:34 +08:00
|
|
|
ifneq ($(PORTNAME), cygwin)
|
1999-07-17 06:56:01 +08:00
|
|
|
|
2000-10-11 05:22:29 +08:00
|
|
|
ifndef LORDER
|
|
|
|
MK_NO_LORDER := true
|
|
|
|
endif
|
|
|
|
|
1998-10-19 08:00:51 +08:00
|
|
|
lib$(NAME).a: $(OBJS)
|
|
|
|
ifdef MK_NO_LORDER
|
2000-10-24 05:44:12 +08:00
|
|
|
$(LINK.static) $@ $^
|
1998-10-19 08:00:51 +08:00
|
|
|
else
|
2000-10-24 05:44:12 +08:00
|
|
|
$(LINK.static) $@ `$(LORDER) $^ | tsort`
|
1998-10-19 08:00:51 +08:00
|
|
|
endif
|
|
|
|
$(RANLIB) $@
|
1999-07-17 06:56:01 +08:00
|
|
|
|
2003-03-22 01:18:34 +08:00
|
|
|
endif # not cygwin
|
1998-10-19 08:00:51 +08:00
|
|
|
|
2000-10-24 05:44:12 +08:00
|
|
|
ifeq ($(enable_shared), yes)
|
|
|
|
|
2000-10-07 22:39:21 +08:00
|
|
|
ifneq ($(PORTNAME), beos)
|
2003-03-22 01:18:34 +08:00
|
|
|
ifneq ($(PORTNAME), cygwin)
|
1999-07-17 06:56:01 +08:00
|
|
|
ifneq ($(PORTNAME), aix)
|
1999-07-01 07:54:18 +08:00
|
|
|
|
1999-07-17 06:56:01 +08:00
|
|
|
# Normal case
|
1998-10-19 08:00:51 +08:00
|
|
|
$(shlib): $(OBJS)
|
2000-12-01 04:36:13 +08:00
|
|
|
$(LINK.shared) $(OBJS) $(SHLIB_LINK) -o $@
|
2000-06-29 02:30:16 +08:00
|
|
|
# If we're using major and minor versions, then make a symlink to major-version-only.
|
|
|
|
ifneq ($(shlib), lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION))
|
|
|
|
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
|
|
|
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
|
|
|
endif
|
|
|
|
# Make sure we have a link to a name without any version numbers
|
|
|
|
ifneq ($(shlib), lib$(NAME)$(DLSUFFIX))
|
|
|
|
rm -f lib$(NAME)$(DLSUFFIX)
|
|
|
|
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX)
|
|
|
|
endif
|
1999-07-01 07:54:18 +08:00
|
|
|
|
2000-06-29 02:30:16 +08:00
|
|
|
else # PORTNAME == aix
|
1999-07-01 07:54:18 +08:00
|
|
|
|
1999-07-17 06:56:01 +08:00
|
|
|
# AIX case
|
|
|
|
$(shlib): lib$(NAME).a
|
2000-11-09 12:17:53 +08:00
|
|
|
$(MKLDEXPORT) lib$(NAME).a > lib$(NAME)$(EXPSUFF)
|
2002-10-10 00:21:54 +08:00
|
|
|
$(COMPILER) $(LDFLAGS_SL) -o $@ $< $(LDFLAGS) $(SHLIB_LINK) -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) -Wl,-bE:lib$(NAME)$(EXPSUFF)
|
|
|
|
|
2000-06-29 02:30:16 +08:00
|
|
|
endif # PORTNAME == aix
|
1999-07-17 06:56:01 +08:00
|
|
|
|
2003-03-22 01:18:34 +08:00
|
|
|
else # PORTNAME == cygwin
|
1999-07-17 06:56:01 +08:00
|
|
|
|
2003-03-22 01:18:34 +08:00
|
|
|
# Cygwin case
|
2002-07-16 13:46:36 +08:00
|
|
|
$(shlib) lib$(NAME).a: $(OBJS) $(DLLINIT)
|
1999-01-17 14:20:06 +08:00
|
|
|
$(DLLTOOL) --export-all --output-def $(NAME).def $(OBJS)
|
2002-09-06 02:28:46 +08:00
|
|
|
$(DLLWRAP) -o $(shlib) --dllname $(shlib) --def $(NAME).def $(OBJS) $(DLLINIT) $(SHLIB_LINK)
|
1999-01-17 14:20:06 +08:00
|
|
|
$(DLLTOOL) --dllname $(shlib) --def $(NAME).def --output-lib lib$(NAME).a
|
|
|
|
|
2002-07-28 04:10:05 +08:00
|
|
|
$(DLLINIT): $(DLLINIT:%.o=%.c)
|
2002-07-16 13:46:36 +08:00
|
|
|
$(MAKE) -C $(@D) $(@F)
|
2000-06-29 02:30:16 +08:00
|
|
|
|
2003-03-22 01:18:34 +08:00
|
|
|
endif # PORTNAME == cygwin
|
2000-10-07 22:39:21 +08:00
|
|
|
|
|
|
|
else # PORTNAME == beos
|
|
|
|
|
|
|
|
# BEOS case
|
|
|
|
$(shlib): $(OBJS)
|
|
|
|
ln -fs $(top_srcdir)/src/backend/postgres _APP_
|
|
|
|
$(CC) -Xlinker -soname=$@ $(LDFLAGS_SL) -o $@ _APP_ $(OBJS) $(SHLIB_LINK)
|
|
|
|
|
|
|
|
endif # PORTNAME == beos
|
2000-10-24 05:44:12 +08:00
|
|
|
|
|
|
|
endif # enable_shared
|
1999-07-01 07:54:18 +08:00
|
|
|
|
1998-10-19 08:00:51 +08:00
|
|
|
|
2000-06-29 02:30:16 +08:00
|
|
|
##
|
|
|
|
## INSTALL
|
|
|
|
##
|
1998-10-19 08:00:51 +08:00
|
|
|
|
2000-06-29 02:30:16 +08:00
|
|
|
.PHONY: install-lib install-lib-static install-lib-shared
|
|
|
|
install-lib: install-lib-static install-lib-shared
|
1998-10-19 08:00:51 +08:00
|
|
|
|
2000-06-29 02:30:16 +08:00
|
|
|
install-lib-static: lib$(NAME).a
|
2002-04-11 00:45:25 +08:00
|
|
|
$(INSTALL_STLIB) $< $(DESTDIR)$(libdir)/lib$(NAME).a
|
2003-09-21 05:26:20 +08:00
|
|
|
ifeq ($(PORTNAME), darwin)
|
|
|
|
cd $(DESTDIR)$(libdir) && \
|
|
|
|
ranlib lib$(NAME).a
|
|
|
|
endif
|
1998-10-19 08:00:51 +08:00
|
|
|
|
2000-10-24 05:44:12 +08:00
|
|
|
ifeq ($(enable_shared), yes)
|
2000-06-29 02:30:16 +08:00
|
|
|
install-lib-shared: $(shlib)
|
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.
2000-09-17 21:02:52 +08:00
|
|
|
$(INSTALL_SHLIB) $< $(DESTDIR)$(libdir)/$(shlib)
|
2003-03-22 01:18:34 +08:00
|
|
|
ifneq ($(PORTNAME), cygwin)
|
2000-06-29 02:30:16 +08:00
|
|
|
ifneq ($(shlib), lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION))
|
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.
2000-09-17 21:02:52 +08:00
|
|
|
cd $(DESTDIR)$(libdir) && \
|
2000-06-29 02:30:16 +08:00
|
|
|
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) && \
|
|
|
|
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
1999-01-17 14:20:06 +08:00
|
|
|
endif
|
2000-06-29 02:30:16 +08:00
|
|
|
ifneq ($(shlib), lib$(NAME)$(DLSUFFIX))
|
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.
2000-09-17 21:02:52 +08:00
|
|
|
cd $(DESTDIR)$(libdir) && \
|
2000-06-29 02:30:16 +08:00
|
|
|
rm -f lib$(NAME)$(DLSUFFIX) && \
|
|
|
|
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX)
|
|
|
|
endif
|
|
|
|
|
2003-03-22 01:18:34 +08:00
|
|
|
endif # not cygwin
|
2000-10-24 05:44:12 +08:00
|
|
|
endif # enable_shared
|
2000-06-29 02:30:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
## UNINSTALL
|
|
|
|
##
|
|
|
|
|
|
|
|
.PHONY: uninstall-lib
|
|
|
|
uninstall-lib:
|
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.
2000-09-17 21:02:52 +08:00
|
|
|
rm -f $(DESTDIR)$(libdir)/lib$(NAME).a
|
2000-10-24 05:44:12 +08:00
|
|
|
ifeq ($(enable_shared), yes)
|
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.
2000-09-17 21:02:52 +08:00
|
|
|
rm -f $(DESTDIR)$(libdir)/lib$(NAME)$(DLSUFFIX) \
|
|
|
|
$(DESTDIR)$(libdir)/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) \
|
|
|
|
$(DESTDIR)$(libdir)/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
2000-10-24 05:44:12 +08:00
|
|
|
endif # enable_shared
|
1999-07-01 07:54:18 +08:00
|
|
|
|
|
|
|
|
2000-06-29 02:30:16 +08:00
|
|
|
##
|
|
|
|
## CLEAN
|
|
|
|
##
|
1999-07-01 07:54:18 +08:00
|
|
|
|
2000-06-29 02:30:16 +08:00
|
|
|
.PHONY: clean-lib
|
|
|
|
clean-lib:
|
|
|
|
rm -f lib$(NAME).a
|
2000-10-24 05:44:12 +08:00
|
|
|
ifeq ($(enable_shared), yes)
|
2002-05-25 02:10:17 +08:00
|
|
|
rm -f lib$(NAME)$(DLSUFFIX) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
|
|
|
ifdef EXPSUFF
|
|
|
|
rm -f lib$(NAME)$(EXPSUFF)
|
|
|
|
endif
|
2000-10-24 05:44:12 +08:00
|
|
|
endif
|
2003-03-22 01:18:34 +08:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
2002-09-06 02:28:46 +08:00
|
|
|
rm -f $(NAME).dll $(NAME).def
|
1999-10-13 19:38:42 +08:00
|
|
|
endif
|