~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/interfaces/ecpg/ecpglib/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#-------------------------------------------------------------------------
 
2
#
 
3
# Makefile for ecpg library
 
4
#
 
5
# Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
 
6
# Portions Copyright (c) 1994, Regents of the University of California
 
7
#
 
8
# src/interfaces/ecpg/ecpglib/Makefile
 
9
#
 
10
#-------------------------------------------------------------------------
 
11
 
 
12
subdir = src/interfaces/ecpg/ecpglib
 
13
top_builddir = ../../../..
 
14
include $(top_builddir)/src/Makefile.global
 
15
 
 
16
NAME= ecpg
 
17
SO_MAJOR_VERSION= 6
 
18
SO_MINOR_VERSION= 3
 
19
 
 
20
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
 
21
        -I$(libpq_srcdir) -I$(top_builddir)/src/port $(CPPFLAGS)
 
22
override CFLAGS += $(PTHREAD_CFLAGS)
 
23
 
 
24
# Need to recompile any libpgport object files
 
25
LIBS := $(filter-out -lpgport, $(LIBS))
 
26
 
 
27
OBJS= execute.o typename.o descriptor.o sqlda.o data.o error.o prepare.o memory.o \
 
28
        connect.o misc.o path.o pgstrcasecmp.o \
 
29
        $(filter snprintf.o strlcpy.o, $(LIBOBJS))
 
30
 
 
31
# thread.c is needed only for non-WIN32 implementation of path.c
 
32
ifneq ($(PORTNAME), win32)
 
33
OBJS += thread.o
 
34
endif
 
35
 
 
36
SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) $(filter -lintl -lm, $(LIBS)) $(PTHREAD_LIBS)
 
37
SHLIB_PREREQS = submake-libpq submake-pgtypeslib
 
38
 
 
39
SHLIB_EXPORTS = exports.txt
 
40
 
 
41
ifeq ($(PORTNAME), win32)
 
42
# Link to shfolder.dll instead of shell32.dll
 
43
SHLIB_LINK += -lshfolder
 
44
endif
 
45
 
 
46
all: all-lib
 
47
 
 
48
.PHONY: submake-pgtypeslib
 
49
submake-pgtypeslib:
 
50
        $(MAKE) -C $(top_builddir)/src/interfaces/ecpg/pgtypeslib all
 
51
 
 
52
# Shared library stuff
 
53
include $(top_srcdir)/src/Makefile.shlib
 
54
 
 
55
# We use some port modules verbatim, but since we need to
 
56
# compile with appropriate options to build a shared lib, we can't
 
57
# necessarily use the same object files as the backend uses. Instead,
 
58
# symlink the source files in here and build our own object file.
 
59
 
 
60
path.c pgstrcasecmp.c snprintf.c strlcpy.c thread.c: % : $(top_srcdir)/src/port/%
 
61
        rm -f $@ && $(LN_S) $< .
 
62
 
 
63
misc.o: misc.c $(top_builddir)/src/port/pg_config_paths.h
 
64
path.o: path.c $(top_builddir)/src/port/pg_config_paths.h
 
65
 
 
66
$(top_builddir)/src/port/pg_config_paths.h:
 
67
        $(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
 
68
 
 
69
install: all installdirs install-lib
 
70
 
 
71
installdirs: installdirs-lib
 
72
 
 
73
uninstall: uninstall-lib
 
74
 
 
75
clean distclean: clean-lib
 
76
        rm -f $(OBJS)
 
77
        rm -f path.c pgstrcasecmp.c snprintf.c strlcpy.c thread.c
 
78
 
 
79
maintainer-clean: distclean maintainer-clean-lib