1 #-------------------------------------------------------------------------
3 # Makefile for src/interfaces/libpq library
5 # Copyright (c) 1994, Regents of the University of California
7 # $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.59 2001/09/22 22:54:32 petere Exp $
9 #-------------------------------------------------------------------------
11 subdir = src/interfaces/libpq
12 top_builddir = ../../..
13 include $(top_builddir)/src/Makefile.global
15 # shared library parameters
20 override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"'
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 \
24 $(INET_ATON) $(SNPRINTF) $(STRERROR)
27 OBJS+= wchar.o encnames.o
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
33 SHLIB_LINK += $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS))
38 # Shared library stuff
39 include $(top_srcdir)/src/Makefile.shlib
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.
47 backend_src = $(top_srcdir)/src/backend
49 dllist.c: $(backend_src)/lib/dllist.c
50 rm -f $@ && $(LN_S) $< .
52 md5.c: $(backend_src)/libpq/md5.c
53 rm -f $@ && $(LN_S) $< .
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) $< .
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) $< .
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) $< .
68 wchar.c : % : $(backend_src)/utils/mb/%
69 rm -f $@ && $(LN_S) $< .
70 encnames.c : % : $(backend_src)/utils/mb/%
71 rm -f $@ && $(LN_S) $< .
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)
81 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(includedir_internal)
83 uninstall: uninstall-lib
84 rm -f $(DESTDIR)$(includedir)/libpq-fe.h $(DESTDIR)$(includedir_internal)/libpq-int.h $(includedir_internal)/pqexpbuffer.h
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