OSDN Git Service

7b5bb61adc2e6557f73968672eb8d643bc189d91
[pg-rex/syncrep.git] / src / interfaces / libpq / Makefile.in
1 #-------------------------------------------------------------------------
2 #
3 # Makefile
4 #    Makefile for libpq library
5 #
6 # Copyright (c) 1994, Regents of the University of California
7 #
8 # IDENTIFICATION
9 #    $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/Makefile.in,v 1.60 2000/06/17 00:10:09 petere Exp $
10 #
11 #-------------------------------------------------------------------------
12
13 NAME= pq
14 SO_MAJOR_VERSION= 2
15 SO_MINOR_VERSION= 1
16
17 SRCDIR= ../..
18 include $(SRCDIR)/Makefile.global
19
20 CFLAGS+= -DFRONTEND
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 pqsignal.o @SNPRINTF@ @INET_ATON@
24
25 ifdef MULTIBYTE
26 OBJS+= common.o wchar.o conv.o big5.o
27 endif
28
29 # If crypt is a separate library, rather than part of libc,
30 # make sure it gets included in shared libpq.
31 SHLIB_LINK+= $(findstring -lcrypt,$(LIBS))
32
33 # Include kerberos libraries into libpq
34 SHLIB_LINK += $(KRB_LIBS)
35
36
37 # Shared library stuff, also default 'all' target
38 include $(SRCDIR)/Makefile.shlib
39
40
41 # We use several backend modules verbatim, but since we need to compile
42 # with appropriate options to build a shared lib, we can't necessarily
43 # use the same object files as the backend uses.  Instead, symlink the
44 # source files in here and build our own object file.
45
46 dllist.c:       $(SRCDIR)/backend/lib/dllist.c
47         -$(LN_S) $(SRCDIR)/backend/lib/dllist.c .
48
49 # this only gets done if configure finds system doesn't have snprintf()
50 snprintf.c:     $(SRCDIR)/backend/port/snprintf.c
51         -$(LN_S) $(SRCDIR)/backend/port/snprintf.c .
52
53 # this only gets done if configure finds system doesn't have inet_aton()
54 inet_aton.c:    $(SRCDIR)/backend/port/inet_aton.c
55         -$(LN_S) $(SRCDIR)/backend/port/inet_aton.c .
56
57 ifdef MULTIBYTE
58 common.c: $(SRCDIR)/backend/utils/mb/common.c
59         -$(LN_S) $(SRCDIR)/backend/utils/mb/common.c .
60
61 wchar.c: $(SRCDIR)/backend/utils/mb/wchar.c
62         -$(LN_S) $(SRCDIR)/backend/utils/mb/wchar.c .
63
64 conv.c: $(SRCDIR)/backend/utils/mb/conv.c
65         -$(LN_S) $(SRCDIR)/backend/utils/mb/conv.c .
66
67 big5.c: $(SRCDIR)/backend/utils/mb/big5.c
68         -$(LN_S) $(SRCDIR)/backend/utils/mb/big5.c .
69 endif
70
71
72 .PHONY: install install-headers
73
74 install: install-headers install-lib $(install-shlib-dep)
75
76 install-headers: libpq-fe.h libpq-int.h
77         -@if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi
78         $(INSTALL) $(INSTLOPTS) libpq-fe.h $(HEADERDIR)/libpq-fe.h
79         $(INSTALL) $(INSTLOPTS) libpq-int.h $(HEADERDIR)/libpq-int.h
80         $(INSTALL) $(INSTLOPTS) pqexpbuffer.h $(HEADERDIR)/pqexpbuffer.h
81
82
83 .PHONY: clean
84
85 clean: clean-shlib
86         rm -f lib$(NAME).a $(OBJS)
87         rm -f dllist.c snprintf.c inet_aton.c common.c wchar.c conv.c big5.c
88
89 depend dep:
90         $(CC) -MM $(CFLAGS) *.c >depend
91
92 ifeq (depend,$(wildcard depend))
93 include depend
94 endif