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.47 2000/10/30 10:31:45 ishii Exp $
9 #-------------------------------------------------------------------------
11 subdir = src/interfaces/libpq
12 top_builddir = ../../..
13 include $(top_builddir)/src/Makefile.global
15 # shared library parameters
20 override CPPFLAGS += -DFRONTEND -I$(srcdir) -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 pqsignal.o $(SNPRINTF) $(INET_ATON)
26 OBJS+= common.o wchar.o
29 # Add libraries that libpq depends (or might depend) on into the
30 # shared library link. (The order in which you list them here doesn't
32 SHLIB_LINK += $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl, $(LIBS))
37 # Shared library stuff
38 include $(top_srcdir)/src/Makefile.shlib
41 # We use several backend modules verbatim, but since we need to
42 # compile with appropriate options to build a shared lib, we can't
43 # necessarily use the same object files as the backend uses. Instead,
44 # symlink the source files in here and build our own object file.
46 backend_src = $(top_srcdir)/src/backend
48 dllist.c: $(backend_src)/lib/dllist.c
49 rm -f $@ && $(LN_S) $< .
51 # this only gets done if configure finds system doesn't have snprintf()
52 snprintf.c: $(backend_src)/port/snprintf.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) $< .
60 common.c wchar.c : % : $(backend_src)/utils/mb/%
61 rm -f $@ && $(LN_S) $< .
65 install: all installdirs install-headers install-lib
67 .PHONY: install-headers
68 install-headers: libpq-fe.h libpq-int.h pqexpbuffer.h
69 $(INSTALL_DATA) $(srcdir)/libpq-fe.h $(DESTDIR)$(includedir)
70 $(INSTALL_DATA) $(srcdir)/libpq-int.h $(DESTDIR)$(includedir)
71 $(INSTALL_DATA) $(srcdir)/pqexpbuffer.h $(DESTDIR)$(includedir)
74 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
76 uninstall: uninstall-lib
77 rm -f $(addprefix $(DESTDIR)$(includedir)/, libpq-fe.h libpq-int.h pqexpbuffer.h)
79 clean distclean maintainer-clean: clean-lib
80 rm -f $(OBJS) dllist.c snprintf.c inet_aton.c common.c wchar.c conv.c big5.c
83 $(CC) -MM $(CFLAGS) *.c >depend
85 ifeq (depend,$(wildcard depend))