1 #-------------------------------------------------------------------------
3 # Makefile for ecpg library
5 # Copyright (c) 1994, Regents of the University of California
7 # $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.28 2004/10/12 04:48:35 neilc Exp $
9 #-------------------------------------------------------------------------
11 subdir = src/interfaces/ecpg/ecpglib
12 top_builddir = ../../../..
13 include $(top_builddir)/src/Makefile.global
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)
24 # Need to recomple any libpgport object files
25 LIBS := $(patsubst -lpgport,, $(LIBS))
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
30 SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) \
31 $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)
33 all: $(top_builddir)/src/port/pg_config_paths.h all-lib
35 # Shared library stuff
36 include $(top_srcdir)/src/Makefile.shlib
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.
43 path.c: % : $(top_srcdir)/src/port/%
44 rm -f $@ && $(LN_S) $< .
46 exec.c: % : $(top_srcdir)/src/port/%
47 rm -f $@ && $(LN_S) $< .
49 $(top_srcdir)/src/port/pg_config_paths.h:
50 $(MAKE) -C $(top_srcdir)/src/port pg_config_paths.h
52 install: all installdirs install-lib
55 $(mkinstalldirs) $(DESTDIR)$(libdir)
57 uninstall: uninstall-lib
59 clean distclean maintainer-clean: clean-lib
60 rm -f $(OBJS) path.c exec.c
63 $(CC) -MM $(CFLAGS) *.c >depend
65 ifeq (depend,$(wildcard depend))