1998-10-19 02:00:51 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile.shlib
|
|
|
|
# Common rules for building shared libraries
|
|
|
|
#
|
|
|
|
# Copyright (c) 1998, Regents of the University of California
|
|
|
|
#
|
|
|
|
# IDENTIFICATION
|
2005-08-07 21:02:08 +02:00
|
|
|
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.96 2005/08/07 19:02:08 tgl Exp $
|
1998-10-19 02:00:51 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2000-06-28 20:30:16 +02: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 02:00:51 +02:00
|
|
|
#
|
2000-06-28 20:30:16 +02:00
|
|
|
# Before including this file, the module Makefile must define these
|
|
|
|
# variables:
|
1998-10-19 02:00:51 +02:00
|
|
|
#
|
2000-06-28 20:30:16 +02: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 02:00:51 +02:00
|
|
|
#
|
2004-05-12 23:56:27 +02:00
|
|
|
# Optional flags when building DLL's (only applicable to win32 and cygwin
|
|
|
|
# platforms).
|
|
|
|
# DLLTOOL_DEFFLAGS Additional flags when creating the dll .def file
|
|
|
|
# DLLTOOL_LIBFLAGS Additional flags when creating the lib<module>.a file
|
|
|
|
# DLLWRAP_FLAGS Additional flags to dllwrap
|
2004-10-16 05:26:43 +02:00
|
|
|
# DLL_DEFFILE Use pre-existing .def file instead of auto-generating
|
|
|
|
# one with all exports in it (win32 only).
|
2004-05-12 23:56:27 +02:00
|
|
|
#
|
2000-06-28 20:30:16 +02: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 02:00:51 +02:00
|
|
|
#
|
2000-06-28 20:30:16 +02:00
|
|
|
# This makefile provides the following (phony) targets:
|
1998-10-19 02:00:51 +02:00
|
|
|
#
|
2000-06-28 20:30:16 +02: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 02:00:51 +02:00
|
|
|
#
|
2000-06-28 20:30:16 +02: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-10 19:46:34 +01: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 02:00:51 +02:00
|
|
|
|
2000-10-31 20:55:20 +01:00
|
|
|
COMPILER = $(CC) $(CFLAGS)
|
2000-10-23 23:44:12 +02:00
|
|
|
LINK.static = $(AR) $(AROPT)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ifeq ($(enable_shared), yes)
|
|
|
|
|
2005-07-13 19:00:44 +02:00
|
|
|
# Insert -L from LDFLAGS after any -L already present in SHLIB_LINK
|
|
|
|
SHLIB_LINK := $(filter -L%, $(SHLIB_LINK)) $(filter -L%, $(LDFLAGS)) $(filter-out -L%, $(SHLIB_LINK))
|
|
|
|
|
2004-07-13 02:06:46 +02:00
|
|
|
# Default shlib naming convention used by the majority of platforms
|
|
|
|
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
|
|
|
shlib_major = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
|
|
|
shlib_bare = lib$(NAME)$(DLSUFFIX)
|
|
|
|
|
2000-10-23 23:44:12 +02:00
|
|
|
# For each platform we support shared libraries on, set shlib to the
|
2004-07-13 02:06:46 +02:00
|
|
|
# name of the library (if default above is not right), set
|
|
|
|
# LINK.shared to the command to link the library,
|
2000-10-23 23:44:12 +02:00
|
|
|
# and adjust SHLIB_LINK if necessary.
|
1998-10-19 02:00:51 +02:00
|
|
|
|
1999-07-17 00:56:01 +02:00
|
|
|
# Try to keep the sections in some kind of order, folks...
|
1999-07-08 02:15:03 +02:00
|
|
|
|
2002-09-05 00:54:18 +02:00
|
|
|
override CFLAGS += $(CFLAGS_SL)
|
2000-10-23 23:44:12 +02:00
|
|
|
|
2000-11-08 21:18:49 +01:00
|
|
|
soname = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
2000-10-23 23:44:12 +02:00
|
|
|
|
1999-07-17 00:56:01 +02:00
|
|
|
ifeq ($(PORTNAME), aix)
|
2004-07-13 02:06:46 +02:00
|
|
|
shlib = lib$(NAME)$(DLSUFFIX)
|
2002-10-09 18:21:54 +02:00
|
|
|
# SHLIB_LINK += -lc
|
1998-10-31 04:58:55 +01:00
|
|
|
endif
|
|
|
|
|
2000-10-31 20:55:20 +01:00
|
|
|
ifeq ($(PORTNAME), darwin)
|
2004-07-13 02:06:46 +02:00
|
|
|
ifneq ($(SO_MAJOR_VERSION), 0)
|
|
|
|
version_link := -compatibility_version $(SO_MAJOR_VERSION) -current_version $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
|
|
|
endif
|
|
|
|
ifeq ($(DLTYPE), library)
|
|
|
|
# linkable library
|
|
|
|
DLSUFFIX := .dylib
|
|
|
|
LINK.shared = $(COMPILER) -dynamiclib -install_name $(libdir)/lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX) $(version_link) -multiply_defined suppress
|
|
|
|
else
|
|
|
|
# loadable module (default case)
|
|
|
|
DLSUFFIX := .so
|
|
|
|
LINK.shared = $(COMPILER) -bundle
|
|
|
|
endif
|
|
|
|
shlib = lib$(NAME).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)$(DLSUFFIX)
|
|
|
|
shlib_major = lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX)
|
2000-10-31 20:55:20 +01:00
|
|
|
endif
|
|
|
|
|
2000-10-10 23:22:29 +02:00
|
|
|
ifeq ($(PORTNAME), openbsd)
|
2000-10-23 23:44:12 +02:00
|
|
|
ifdef ELF_SYSTEM
|
2001-02-10 18:17:39 +01:00
|
|
|
LINK.shared = $(COMPILER) -shared -Wl,-x,-soname,$(soname)
|
|
|
|
SHLIB_LINK += -lc
|
2000-10-23 23:44:12 +02:00
|
|
|
else
|
|
|
|
LINK.shared = $(LD) -x -Bshareable -Bforcearchive
|
1998-10-19 02:00:51 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PORTNAME), bsdi)
|
2000-10-23 23:44:12 +02:00
|
|
|
ifeq ($(DLSUFFIX), .so)
|
2001-02-10 18:17:39 +01:00
|
|
|
LINK.shared = $(COMPILER) -shared -Wl,-x,-soname,$(soname)
|
2001-02-10 17:51:40 +01:00
|
|
|
SHLIB_LINK += -lc
|
2000-10-23 23:44:12 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(DLSUFFIX), .o)
|
|
|
|
LINK.shared = shlicc -O $(LDREL)
|
1998-10-19 02:00:51 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
1999-07-17 00:56:01 +02:00
|
|
|
ifeq ($(PORTNAME), freebsd)
|
2000-10-23 23:44:12 +02:00
|
|
|
ifdef ELF_SYSTEM
|
2004-07-13 02:06:46 +02:00
|
|
|
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
2001-02-10 18:17:39 +01:00
|
|
|
LINK.shared = $(COMPILER) -shared -Wl,-x,-soname,$(soname)
|
2000-10-23 23:44:12 +02:00
|
|
|
else
|
2004-07-13 02:06:46 +02:00
|
|
|
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
2000-10-23 23:44:12 +02:00
|
|
|
LINK.shared = $(LD) -x -Bshareable -Bforcearchive
|
1999-07-17 00:56:01 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2000-03-08 02:58:46 +01:00
|
|
|
ifeq ($(PORTNAME), netbsd)
|
2000-10-23 23:44:12 +02:00
|
|
|
ifdef ELF_SYSTEM
|
2001-02-10 18:17:39 +01:00
|
|
|
LINK.shared = $(COMPILER) -shared -Wl,-x,-soname,$(soname)
|
2000-10-23 23:44:12 +02:00
|
|
|
else
|
|
|
|
LINK.shared = $(LD) -x -Bshareable -Bforcearchive
|
2000-03-08 02:58:46 +01:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
1998-10-19 02:00:51 +02:00
|
|
|
ifeq ($(PORTNAME), hpux)
|
2004-07-13 02:06:46 +02:00
|
|
|
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
2004-09-03 01:06:43 +02:00
|
|
|
ifeq ($(with_gnu_ld), yes)
|
2004-11-19 22:27:42 +01:00
|
|
|
LINK.shared = $(CC) $(LDFLAGS) -shared -Wl,-h -Wl,$(soname)
|
2004-09-03 01:06:43 +02:00
|
|
|
else
|
2004-11-19 22:27:42 +01:00
|
|
|
# can't use the CC-syntax rpath pattern here
|
|
|
|
rpath =
|
|
|
|
ifeq ($(enable_rpath), yes)
|
|
|
|
LINK.shared = $(LD) +h $(soname) -b +b $(rpathdir)
|
|
|
|
else
|
|
|
|
LINK.shared = $(LD) +h $(soname) -b
|
|
|
|
endif
|
2005-07-13 01:06:48 +02:00
|
|
|
# On HPUX platforms, gcc is usually configured to search for libraries
|
|
|
|
# in /usr/local/lib, but ld won't do so. Add an explicit -L switch so
|
|
|
|
# ld can find the same libraries gcc does. Make sure it goes after any
|
|
|
|
# -L switches provided explicitly.
|
|
|
|
ifeq ($(GCC), yes)
|
2005-07-13 19:00:44 +02:00
|
|
|
SHLIB_LINK := $(filter -L%, $(SHLIB_LINK)) -L/usr/local/lib $(filter-out -L%, $(SHLIB_LINK))
|
2005-07-13 01:06:48 +02:00
|
|
|
endif
|
2004-09-03 01:06:43 +02:00
|
|
|
endif
|
2005-07-13 19:00:44 +02:00
|
|
|
# do this last so above filtering doesn't pull out -L switches in LDFLAGS
|
|
|
|
ifeq ($(GCC), yes)
|
|
|
|
SHLIB_LINK += `$(CC) $(LDFLAGS) -print-libgcc-file-name`
|
|
|
|
endif
|
1998-10-19 02:00:51 +02:00
|
|
|
endif
|
|
|
|
|
2004-05-19 23:37:43 +02:00
|
|
|
ifeq ($(PORTNAME), irix)
|
2004-07-13 02:06:46 +02:00
|
|
|
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
2000-11-14 22:12:00 +01:00
|
|
|
LINK.shared = $(COMPILER) -shared -Wl,-set_version,sgi$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
|
1999-07-17 00:56:01 +02:00
|
|
|
endif
|
|
|
|
|
1998-10-19 02:00:51 +02:00
|
|
|
ifeq ($(PORTNAME), linux)
|
2000-11-08 21:18:49 +01:00
|
|
|
LINK.shared = $(COMPILER) -shared -Wl,-soname,$(soname)
|
1998-10-19 02:00:51 +02:00
|
|
|
endif
|
|
|
|
|
2000-10-10 23:22:29 +02:00
|
|
|
ifeq ($(PORTNAME), solaris)
|
2002-09-05 00:54:18 +02:00
|
|
|
ifeq ($(GCC), yes)
|
|
|
|
LINK.shared = $(CC) -shared
|
2001-09-12 01:20:41 +02:00
|
|
|
else
|
2002-09-05 00:54:18 +02:00
|
|
|
LINK.shared = $(CC) -G
|
2001-09-12 01:20:41 +02:00
|
|
|
endif
|
2000-11-08 21:18:49 +01:00
|
|
|
ifeq ($(with_gnu_ld), yes)
|
2001-02-10 17:26:38 +01:00
|
|
|
LINK.shared += -Wl,-soname,$(soname)
|
2000-11-08 21:18:49 +01:00
|
|
|
else
|
2001-11-11 20:20:53 +01:00
|
|
|
LINK.shared += -h $(soname)
|
2000-11-08 21:18:49 +01:00
|
|
|
endif
|
1998-10-19 02:00:51 +02:00
|
|
|
endif
|
|
|
|
|
2001-02-27 09:13:31 +01:00
|
|
|
ifeq ($(PORTNAME), sunos4)
|
|
|
|
LINK.shared = $(LD) -assert pure-text -Bdynamic
|
|
|
|
endif
|
|
|
|
|
2000-10-10 23:22:29 +02:00
|
|
|
ifeq ($(PORTNAME), osf)
|
2000-10-23 23:44:12 +02:00
|
|
|
LINK.shared = $(LD) -shared -expect_unresolved '*'
|
1999-05-19 20:04:51 +02:00
|
|
|
endif
|
|
|
|
|
2001-05-07 22:43:28 +02:00
|
|
|
ifeq ($(PORTNAME), sco)
|
2002-09-05 00:54:18 +02:00
|
|
|
ifeq ($(GCC), yes)
|
|
|
|
LINK.shared = $(CC) -shared
|
2001-05-07 22:43:28 +02:00
|
|
|
else
|
2002-09-05 00:54:18 +02:00
|
|
|
LINK.shared = $(CC) -G
|
2001-05-07 22:43:28 +02:00
|
|
|
endif
|
|
|
|
LINK.shared += -Wl,-z,text -Wl,-h,$(soname)
|
|
|
|
endif
|
|
|
|
|
1998-10-19 02:00:51 +02:00
|
|
|
ifeq ($(PORTNAME), svr4)
|
2000-10-23 23:44:12 +02:00
|
|
|
LINK.shared = $(LD) -G
|
1998-10-19 02:00:51 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PORTNAME), univel)
|
2000-10-23 23:44:12 +02:00
|
|
|
LINK.shared = $(LD) -G -z text
|
1998-10-19 02:00:51 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PORTNAME), unixware)
|
2002-09-05 00:54:18 +02:00
|
|
|
ifeq ($(GCC), yes)
|
|
|
|
LINK.shared = $(CC) -shared
|
2000-10-27 22:09:48 +02:00
|
|
|
else
|
2002-09-05 00:54:18 +02:00
|
|
|
LINK.shared = $(CC) -G
|
2000-10-27 22:09:48 +02:00
|
|
|
endif
|
2003-09-14 15:33:08 +02:00
|
|
|
LINK.shared += -Wl,-z,text -Wl,-h,$(soname)
|
1998-10-19 02:00:51 +02:00
|
|
|
endif
|
|
|
|
|
2003-03-21 18:18:34 +01:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
2005-08-07 21:02:08 +02:00
|
|
|
shlib = cyg$(NAME)$(DLSUFFIX)
|
2004-10-13 12:20:04 +02:00
|
|
|
# needed for /contrib modules, not sure why
|
2004-11-17 18:08:15 +01:00
|
|
|
SHLIB_LINK += $(LIBS)
|
2004-11-16 22:51:13 +01:00
|
|
|
haslibarule = yes
|
1999-01-17 07:20:06 +01:00
|
|
|
endif
|
1998-10-19 02:00:51 +02:00
|
|
|
|
2003-12-01 23:23:06 +01:00
|
|
|
ifeq ($(PORTNAME), win32)
|
2004-07-13 02:06:46 +02:00
|
|
|
shlib = lib$(NAME)$(DLSUFFIX)
|
2004-11-16 22:51:13 +01:00
|
|
|
haslibarule = yes
|
2003-12-01 23:23:06 +01:00
|
|
|
endif
|
|
|
|
|
2000-10-07 16:39:21 +02:00
|
|
|
ifeq ($(PORTNAME), beos)
|
2004-07-13 02:06:46 +02:00
|
|
|
shlib = lib$(NAME)$(DLSUFFIX)
|
2000-10-23 23:44:12 +02:00
|
|
|
LINK.shared = $(LD) -nostart
|
|
|
|
SHLIB_LINK += -ltermcap -lstdc++.r4 -lbind -lsocket -L/boot/develop/lib/x86
|
2000-10-07 16:39:21 +02:00
|
|
|
endif
|
1998-10-19 02:00:51 +02:00
|
|
|
|
2000-10-28 01:59:39 +02:00
|
|
|
ifeq ($(enable_rpath), yes)
|
|
|
|
SHLIB_LINK += $(rpath)
|
|
|
|
endif
|
|
|
|
|
2000-10-23 23:44:12 +02:00
|
|
|
endif # enable_shared
|
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
## BUILD
|
|
|
|
##
|
|
|
|
|
2002-09-04 17:45:50 +02:00
|
|
|
.PHONY: all-lib all-static-lib all-shared-lib
|
|
|
|
|
|
|
|
all-lib: all-static-lib all-shared-lib
|
|
|
|
|
2004-11-20 22:13:06 +01:00
|
|
|
all-static-lib: lib$(NAME).a
|
2002-09-04 17:45:50 +02:00
|
|
|
|
2004-11-20 22:13:06 +01:00
|
|
|
all-shared-lib: $(shlib)
|
1998-10-19 02:00:51 +02:00
|
|
|
|
2000-10-10 23:22:29 +02:00
|
|
|
ifndef LORDER
|
|
|
|
MK_NO_LORDER := true
|
|
|
|
endif
|
|
|
|
|
2004-11-16 22:51:13 +01:00
|
|
|
ifndef haslibarule
|
1998-10-19 02:00:51 +02:00
|
|
|
lib$(NAME).a: $(OBJS)
|
|
|
|
ifdef MK_NO_LORDER
|
2000-10-23 23:44:12 +02:00
|
|
|
$(LINK.static) $@ $^
|
1998-10-19 02:00:51 +02:00
|
|
|
else
|
2000-10-23 23:44:12 +02:00
|
|
|
$(LINK.static) $@ `$(LORDER) $^ | tsort`
|
1998-10-19 02:00:51 +02:00
|
|
|
endif
|
|
|
|
$(RANLIB) $@
|
2004-11-16 22:51:13 +01:00
|
|
|
endif #haslibarule
|
1999-07-17 00:56:01 +02:00
|
|
|
|
2000-10-23 23:44:12 +02:00
|
|
|
ifeq ($(enable_shared), yes)
|
|
|
|
|
2003-12-01 23:23:06 +01:00
|
|
|
ifneq ($(PORTNAME), win32)
|
2004-07-13 02:06:46 +02:00
|
|
|
ifneq ($(PORTNAME), cygwin)
|
|
|
|
ifneq ($(PORTNAME), beos)
|
1999-07-17 00:56:01 +02:00
|
|
|
ifneq ($(PORTNAME), aix)
|
1999-07-01 01:54:18 +02:00
|
|
|
|
1999-07-17 00:56:01 +02:00
|
|
|
# Normal case
|
1998-10-19 02:00:51 +02:00
|
|
|
$(shlib): $(OBJS)
|
2004-10-15 07:11:00 +02:00
|
|
|
$(LINK.shared) $(LDFLAGS_SL) $(OBJS) $(SHLIB_LINK) -o $@
|
2000-06-28 20:30:16 +02:00
|
|
|
# If we're using major and minor versions, then make a symlink to major-version-only.
|
2004-07-13 02:06:46 +02:00
|
|
|
ifneq ($(shlib), $(shlib_major))
|
|
|
|
rm -f $(shlib_major)
|
|
|
|
$(LN_S) $(shlib) $(shlib_major)
|
2000-06-28 20:30:16 +02:00
|
|
|
endif
|
|
|
|
# Make sure we have a link to a name without any version numbers
|
2004-07-13 02:06:46 +02:00
|
|
|
ifneq ($(shlib), $(shlib_bare))
|
|
|
|
rm -f $(shlib_bare)
|
|
|
|
$(LN_S) $(shlib) $(shlib_bare)
|
2000-06-28 20:30:16 +02:00
|
|
|
endif
|
1999-07-01 01:54:18 +02:00
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
else # PORTNAME == aix
|
1999-07-01 01:54:18 +02:00
|
|
|
|
1999-07-17 00:56:01 +02:00
|
|
|
# AIX case
|
|
|
|
$(shlib): lib$(NAME).a
|
2000-11-09 05:17:53 +01:00
|
|
|
$(MKLDEXPORT) lib$(NAME).a > lib$(NAME)$(EXPSUFF)
|
2002-10-09 18:21:54 +02:00
|
|
|
$(COMPILER) $(LDFLAGS_SL) -o $@ $< $(LDFLAGS) $(SHLIB_LINK) -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) -Wl,-bE:lib$(NAME)$(EXPSUFF)
|
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
endif # PORTNAME == aix
|
1999-07-17 00:56:01 +02:00
|
|
|
|
2004-07-13 02:06:46 +02:00
|
|
|
else # PORTNAME == beos
|
2003-12-01 23:23:06 +01:00
|
|
|
|
2004-07-13 02:06:46 +02:00
|
|
|
# BEOS case
|
|
|
|
$(shlib): $(OBJS)
|
|
|
|
ln -fs $(top_srcdir)/src/backend/postgres _APP_
|
|
|
|
$(CC) -Xlinker -soname=$@ $(LDFLAGS_SL) -o $@ _APP_ $(OBJS) $(SHLIB_LINK)
|
2003-12-01 23:23:06 +01:00
|
|
|
|
2004-07-13 02:06:46 +02:00
|
|
|
endif # PORTNAME == beos
|
2003-12-01 23:23:06 +01:00
|
|
|
|
2003-03-21 18:18:34 +01:00
|
|
|
else # PORTNAME == cygwin
|
1999-07-17 00:56:01 +02:00
|
|
|
|
2003-03-21 18:18:34 +01:00
|
|
|
# Cygwin case
|
2004-10-13 00:20:17 +02:00
|
|
|
$(shlib) lib$(NAME).a: $(OBJS)
|
2004-10-16 05:26:43 +02:00
|
|
|
ifndef DLL_DEFFILE
|
2004-05-12 23:56:27 +02:00
|
|
|
$(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $(NAME).def $(OBJS)
|
2004-10-15 07:11:00 +02:00
|
|
|
$(DLLWRAP) $(LDFLAGS_SL) -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(NAME).def $(OBJS) $(SHLIB_LINK)
|
2004-05-12 23:56:27 +02:00
|
|
|
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(NAME).def --output-lib lib$(NAME).a
|
2004-10-16 05:26:43 +02:00
|
|
|
else
|
|
|
|
$(DLLWRAP) $(LDFLAGS_SL) -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(DLL_DEFFILE) $(OBJS) $(SHLIB_LINK)
|
|
|
|
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib lib$(NAME).a
|
|
|
|
endif
|
1999-01-17 07:20:06 +01:00
|
|
|
|
2003-03-21 18:18:34 +01:00
|
|
|
endif # PORTNAME == cygwin
|
2000-10-07 16:39:21 +02:00
|
|
|
|
2004-07-13 02:06:46 +02:00
|
|
|
else # PORTNAME == win32
|
2000-10-07 16:39:21 +02:00
|
|
|
|
2004-07-13 02:06:46 +02:00
|
|
|
# win32 case
|
|
|
|
$(shlib) lib$(NAME).a: $(OBJS)
|
2004-10-16 05:26:43 +02:00
|
|
|
ifndef DLL_DEFFILE
|
2004-07-13 02:06:46 +02:00
|
|
|
$(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $(NAME).def $(OBJS)
|
2004-10-15 07:11:00 +02:00
|
|
|
$(DLLWRAP) $(LDFLAGS_SL) -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(NAME).def $(OBJS) $(SHLIB_LINK)
|
2004-07-13 02:06:46 +02:00
|
|
|
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(NAME).def --output-lib lib$(NAME).a
|
2004-10-16 05:26:43 +02:00
|
|
|
else
|
|
|
|
$(DLLWRAP) $(LDFLAGS_SL) -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(DLL_DEFFILE) $(OBJS) $(SHLIB_LINK)
|
|
|
|
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib lib$(NAME).a
|
|
|
|
endif
|
2000-10-07 16:39:21 +02:00
|
|
|
|
2004-07-13 02:06:46 +02:00
|
|
|
endif # PORTNAME == win32
|
2000-10-23 23:44:12 +02:00
|
|
|
|
|
|
|
endif # enable_shared
|
1999-07-01 01:54:18 +02:00
|
|
|
|
1998-10-19 02:00:51 +02:00
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
##
|
|
|
|
## INSTALL
|
|
|
|
##
|
1998-10-19 02:00:51 +02:00
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
.PHONY: install-lib install-lib-static install-lib-shared
|
|
|
|
install-lib: install-lib-static install-lib-shared
|
1998-10-19 02:00:51 +02:00
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
install-lib-static: lib$(NAME).a
|
2002-04-10 18:45:25 +02:00
|
|
|
$(INSTALL_STLIB) $< $(DESTDIR)$(libdir)/lib$(NAME).a
|
2003-09-20 23:26:20 +02:00
|
|
|
ifeq ($(PORTNAME), darwin)
|
|
|
|
cd $(DESTDIR)$(libdir) && \
|
|
|
|
ranlib lib$(NAME).a
|
|
|
|
endif
|
1998-10-19 02:00:51 +02:00
|
|
|
|
2000-10-23 23:44:12 +02:00
|
|
|
ifeq ($(enable_shared), yes)
|
2000-06-28 20:30:16 +02: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 15:02:52 +02:00
|
|
|
$(INSTALL_SHLIB) $< $(DESTDIR)$(libdir)/$(shlib)
|
2003-03-21 18:18:34 +01:00
|
|
|
ifneq ($(PORTNAME), cygwin)
|
2003-12-01 23:23:06 +01:00
|
|
|
ifneq ($(PORTNAME), win32)
|
2004-07-13 02:06:46 +02:00
|
|
|
ifneq ($(shlib), $(shlib_major))
|
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 15:02:52 +02:00
|
|
|
cd $(DESTDIR)$(libdir) && \
|
2004-07-13 02:06:46 +02:00
|
|
|
rm -f $(shlib_major) && \
|
|
|
|
$(LN_S) $(shlib) $(shlib_major)
|
1999-01-17 07:20:06 +01:00
|
|
|
endif
|
2004-07-13 02:06:46 +02:00
|
|
|
ifneq ($(shlib), $(shlib_bare))
|
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 15:02:52 +02:00
|
|
|
cd $(DESTDIR)$(libdir) && \
|
2004-07-13 02:06:46 +02:00
|
|
|
rm -f $(shlib_bare) && \
|
|
|
|
$(LN_S) $(shlib) $(shlib_bare)
|
2000-06-28 20:30:16 +02:00
|
|
|
endif
|
2003-12-01 23:23:06 +01:00
|
|
|
endif # not win32
|
2003-03-21 18:18:34 +01:00
|
|
|
endif # not cygwin
|
2000-10-23 23:44:12 +02:00
|
|
|
endif # enable_shared
|
2000-06-28 20:30:16 +02: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 15:02:52 +02:00
|
|
|
rm -f $(DESTDIR)$(libdir)/lib$(NAME).a
|
2000-10-23 23:44:12 +02:00
|
|
|
ifeq ($(enable_shared), yes)
|
2004-07-13 02:06:46 +02:00
|
|
|
rm -f $(DESTDIR)$(libdir)/$(shlib_bare) \
|
|
|
|
$(DESTDIR)$(libdir)/$(shlib_major) \
|
|
|
|
$(DESTDIR)$(libdir)/$(shlib)
|
2000-10-23 23:44:12 +02:00
|
|
|
endif # enable_shared
|
1999-07-01 01:54:18 +02:00
|
|
|
|
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
##
|
|
|
|
## CLEAN
|
|
|
|
##
|
1999-07-01 01:54:18 +02:00
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
.PHONY: clean-lib
|
|
|
|
clean-lib:
|
|
|
|
rm -f lib$(NAME).a
|
2000-10-23 23:44:12 +02:00
|
|
|
ifeq ($(enable_shared), yes)
|
2004-07-13 02:06:46 +02:00
|
|
|
rm -f $(shlib_bare) $(shlib_major) $(shlib)
|
2002-05-24 20:10:17 +02:00
|
|
|
ifdef EXPSUFF
|
|
|
|
rm -f lib$(NAME)$(EXPSUFF)
|
|
|
|
endif
|
2000-10-23 23:44:12 +02:00
|
|
|
endif
|
2003-03-21 18:18:34 +01:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
2002-09-05 20:28:46 +02:00
|
|
|
rm -f $(NAME).dll $(NAME).def
|
1999-10-13 13:38:42 +02:00
|
|
|
endif
|
2003-12-01 23:23:06 +01:00
|
|
|
|
|
|
|
ifeq ($(PORTNAME), win32)
|
|
|
|
rm -f $(NAME).dll $(NAME).def
|
|
|
|
endif
|