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.29.4.2 2005-03-13 22:04:45 momjian 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
ifeq ($(PORTNAME), win32)
34
# Link to shfolder.dll instead of shell32.dll
35
SHLIB_LINK += -lshfolder
40
# Shared library stuff
41
include $(top_srcdir)/src/Makefile.shlib
43
# We use some port modules verbatim, but since we need to
44
# compile with appropriate options to build a shared lib, we can't
45
# necessarily use the same object files as the backend uses. Instead,
46
# symlink the source files in here and build our own object file.
48
path.c: % : $(top_srcdir)/src/port/%
49
rm -f $@ && $(LN_S) $< .
51
exec.c: % : $(top_srcdir)/src/port/%
52
rm -f $@ && $(LN_S) $< .
54
path.o: path.c $(top_builddir)/src/port/pg_config_paths.h
56
$(top_builddir)/src/port/pg_config_paths.h:
57
$(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
59
install: all installdirs install-lib
62
$(mkinstalldirs) $(DESTDIR)$(libdir)
64
uninstall: uninstall-lib
66
clean distclean maintainer-clean: clean-lib
67
rm -f $(OBJS) path.c exec.c
70
$(CC) -MM $(CFLAGS) *.c >depend
72
ifeq (depend,$(wildcard depend))