]> granicus.if.org Git - postgresql/blob - src/interfaces/libpq/Makefile
UPDATED PATCH:
[postgresql] / src / interfaces / libpq / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for src/interfaces/libpq library
4 #
5 # Copyright (c) 1994, Regents of the University of California
6 #
7 # $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.62 2002/06/14 04:23:17 momjian Exp $
8 #
9 #-------------------------------------------------------------------------
10
11 subdir = src/interfaces/libpq
12 top_builddir = ../../..
13 include $(top_builddir)/src/Makefile.global
14
15 # shared library parameters
16 NAME= pq
17 SO_MAJOR_VERSION= 2
18 SO_MINOR_VERSION= 2
19
20 override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"'
21
22 OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
23       pqexpbuffer.o dllist.o md5.o pqsignal.o fe-secure.o \
24       $(INET_ATON) $(SNPRINTF) $(STRERROR)
25
26 ifdef MULTIBYTE
27 OBJS+= wchar.o encnames.o
28 endif
29
30 # Add libraries that libpq depends (or might depend) on into the
31 # shared library link.  (The order in which you list them here doesn't
32 # matter.)
33 SHLIB_LINK += $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS))
34
35
36 all: all-lib
37
38 # Shared library stuff
39 include $(top_srcdir)/src/Makefile.shlib
40
41
42 # We use several backend modules verbatim, but since we need to
43 # compile with appropriate options to build a shared lib, we can't
44 # necessarily use the same object files as the backend uses. Instead,
45 # symlink the source files in here and build our own object file.
46
47 backend_src = $(top_srcdir)/src/backend
48
49 dllist.c: $(backend_src)/lib/dllist.c
50         rm -f $@ && $(LN_S) $< .
51
52 md5.c: $(backend_src)/libpq/md5.c
53         rm -f $@ && $(LN_S) $< .
54
55 # this only gets done if configure finds system doesn't have inet_aton()
56 inet_aton.c: $(backend_src)/port/inet_aton.c
57         rm -f $@ && $(LN_S) $< .
58
59 # this only gets done if configure finds system doesn't have snprintf()
60 snprintf.c: $(backend_src)/port/snprintf.c
61         rm -f $@ && $(LN_S) $< .
62
63 # this only gets done if configure finds system doesn't have strerror()
64 strerror.c: $(backend_src)/port/strerror.c
65         rm -f $@ && $(LN_S) $< .
66
67 ifdef MULTIBYTE
68 wchar.c : % : $(backend_src)/utils/mb/%
69         rm -f $@ && $(LN_S) $< .
70 encnames.c : % : $(backend_src)/utils/mb/%
71         rm -f $@ && $(LN_S) $< .
72 endif
73
74
75 install: all installdirs install-lib
76         $(INSTALL_DATA) $(srcdir)/libpq-fe.h $(DESTDIR)$(includedir)
77         $(INSTALL_DATA) $(srcdir)/libpq-int.h $(DESTDIR)$(includedir_internal)
78         $(INSTALL_DATA) $(srcdir)/pqexpbuffer.h $(DESTDIR)$(includedir_internal)
79
80 installdirs:
81         $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(includedir_internal)
82
83 uninstall: uninstall-lib
84         rm -f $(DESTDIR)$(includedir)/libpq-fe.h $(DESTDIR)$(includedir_internal)/libpq-int.h $(includedir_internal)/pqexpbuffer.h
85
86 clean distclean maintainer-clean: clean-lib
87         rm -f $(OBJS) dllist.c md5.c wchar.c encnames.c
88         rm -f $(OBJS) inet_aton.c snprintf.c strerror.c