]> granicus.if.org Git - postgresql/blob - src/interfaces/ecpg/ecpglib/Makefile
Fix vpath build break, induced by Bruce's recent commit.
[postgresql] / src / interfaces / ecpg / ecpglib / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for ecpg library
4 #
5 # Copyright (c) 1994, Regents of the University of California
6 #
7 # $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.28 2004/10/12 04:48:35 neilc Exp $
8 #
9 #-------------------------------------------------------------------------
10
11 subdir = src/interfaces/ecpg/ecpglib
12 top_builddir = ../../../..
13 include $(top_builddir)/src/Makefile.global
14
15 NAME= ecpg
16 SO_MAJOR_VERSION= 4
17 SO_MINOR_VERSION= 2
18 DLTYPE= library
19
20 override CPPFLAGS := -DFRONTEND -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 recomple any libpgport object files
25 LIBS := $(patsubst -lpgport,, $(LIBS))
26
27 OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
28         connect.o misc.o path.o exec.o
29
30 SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) \
31         $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)
32
33 all: $(top_builddir)/src/port/pg_config_paths.h all-lib
34
35 # Shared library stuff
36 include $(top_srcdir)/src/Makefile.shlib
37
38 # We use some port modules verbatim, but since we need to
39 # compile with appropriate options to build a shared lib, we can't
40 # necessarily use the same object files as the backend uses. Instead,
41 # symlink the source files in here and build our own object file.
42
43 path.c: % : $(top_srcdir)/src/port/%
44         rm -f $@ && $(LN_S) $< .
45
46 exec.c: % : $(top_srcdir)/src/port/%
47         rm -f $@ && $(LN_S) $< .
48
49 $(top_srcdir)/src/port/pg_config_paths.h:
50         $(MAKE) -C $(top_srcdir)/src/port pg_config_paths.h
51
52 install: all installdirs install-lib
53
54 installdirs:
55         $(mkinstalldirs) $(DESTDIR)$(libdir)
56
57 uninstall: uninstall-lib
58
59 clean distclean maintainer-clean: clean-lib
60         rm -f $(OBJS) path.c exec.c
61
62 depend dep:
63         $(CC) -MM $(CFLAGS) *.c >depend
64
65 ifeq (depend,$(wildcard depend))
66 include depend
67 endif