1#-------------------------------------------------------------------------
2#
3# Makefile for ecpg pgtypes library
4#
5# Portions Copyright (c) 1996-2017, 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, $(LIBOBJS)) $(WIN32RES)
35
36all: all-lib
37
38# Shared library stuff
39include $(top_srcdir)/src/Makefile.shlib
40
41# We use some port modules verbatim, but since we need to
42# compile with appropriate options to build a shared lib, we can't
43# necessarily use the same object files as the backend uses. Instead,
44# symlink the source files in here and build our own object file.
45
46pgstrcasecmp.c rint.c snprintf.c: % : $(top_srcdir)/src/port/%
47	rm -f $@ && $(LN_S) $< .
48
49install: all installdirs install-lib
50
51installdirs: installdirs-lib
52
53uninstall: uninstall-lib
54
55clean distclean: clean-lib
56	rm -f $(OBJS) pgstrcasecmp.c rint.c snprintf.c
57
58maintainer-clean: distclean maintainer-clean-lib
59