1#-------------------------------------------------------------------------
2#
3# Makefile for ecpg pgtypes library
4#
5# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
6# Portions Copyright (c) 1994, Regents of the University of California
7#
8# src/interfaces/ecpg/pgtypeslib/Makefile
9#
10#-------------------------------------------------------------------------
11
12subdir = src/interfaces/ecpg/pgtypeslib
13top_builddir = ../../../..
14include $(top_builddir)/src/Makefile.global
15
16PGFILEDESC = "pgtypes - library for data type mapping"
17NAME= pgtypes
18SO_MAJOR_VERSION= 3
19SO_MINOR_VERSION= $(MAJORVERSION)
20
21override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
22	-DFRONTEND $(CPPFLAGS)
23override CFLAGS += $(PTHREAD_CFLAGS)
24
25# Need to recompile any libpgport object files
26LIBS := $(filter-out -lpgport, $(LIBS))
27
28SHLIB_LINK += $(filter -lm, $(LIBS))
29
30SHLIB_EXPORTS = exports.txt
31
32OBJS= numeric.o datetime.o common.o dt_common.o timestamp.o interval.o \
33	pgstrcasecmp.o \
34	$(filter rint.o snprintf.o strnlen.o, $(LIBOBJS)) \
35	string.o \
36	$(WIN32RES)
37
38all: all-lib
39
40# Shared library stuff
41include $(top_srcdir)/src/Makefile.shlib
42
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.
47
48pgstrcasecmp.c rint.c snprintf.c strnlen.c: % : $(top_srcdir)/src/port/%
49	rm -f $@ && $(LN_S) $< .
50
51string.c: % : $(top_srcdir)/src/common/%
52	rm -f $@ && $(LN_S) $< .
53
54install: all installdirs install-lib
55
56installdirs: installdirs-lib
57
58uninstall: uninstall-lib
59
60clean distclean: clean-lib
61	rm -f $(OBJS) pgstrcasecmp.c rint.c snprintf.c strnlen.c string.c
62
63maintainer-clean: distclean maintainer-clean-lib
64