ACLOCAL_AMFLAGS = -I build_posix/aclocal

# BEGIN SUBDIRS, maintained by makemake and Make.subdirs
# END SUBDIRS

lib_LTLIBRARIES = libwiredtiger.la
LDADD = $(lib_LTLIBRARIES)

# The LevelDB libraries prefer to include all of the objects in a single
# library.  Create a convenience library for them.
if LEVELDB
noinst_LTLIBRARIES = libwiredtiger_static.la
endif

# BEGIN SOURCES, maintained by makemake and dist/filelist
# END SOURCES

bin_PROGRAMS = wt
wt_SOURCES =\
	src/utilities/util_alter.c \
	src/utilities/util_backup.c \
	src/utilities/util_cpyright.c \
	src/utilities/util_compact.c \
	src/utilities/util_create.c \
	src/utilities/util_downgrade.c \
	src/utilities/util_drop.c \
	src/utilities/util_dump.c \
	src/utilities/util_list.c \
	src/utilities/util_load.c \
	src/utilities/util_load_json.c \
	src/utilities/util_loadtext.c \
	src/utilities/util_main.c \
	src/utilities/util_misc.c \
	src/utilities/util_printlog.c \
	src/utilities/util_read.c \
	src/utilities/util_rebalance.c \
	src/utilities/util_rename.c \
	src/utilities/util_salvage.c \
	src/utilities/util_stat.c \
	src/utilities/util_truncate.c \
	src/utilities/util_upgrade.c \
	src/utilities/util_verbose.c \
	src/utilities/util_verify.c \
	src/utilities/util_write.c

man1_MANS = $(MAN1_PAGES)
man3_MANS = $(MAN3_PAGES)

include_HEADERS= wiredtiger.h src/include/wiredtiger_ext.h
AM_CPPFLAGS = -I$(srcdir)/src/include

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = wiredtiger.pc

$(srcdir)/Makefile.am: $(srcdir)/build_posix/Make.base $(srcdir)/build_posix/makemake $(srcdir)/dist/filelist
	@cd $(srcdir)/build_posix && sh makemake

libtool: $(LIBTOOL_DEPS)
	$(SHELL) ./config.status libtool

$(srcdir)/src/include/extern.h: auto-includes.chk
$(srcdir)/src/include/wt_internal.h: auto-includes.chk

auto-includes.chk: $(libwiredtiger_la_SOURCES)
	@(cd $(srcdir)/dist && sh s_prototypes && sh s_typedef -b) && touch $@

$(srcdir)/docs/index.html:
	@cd $(srcdir)/dist && sh s_docs

$(srcdir)/docs/man/man1/wt.1: $(srcdir)/docs/index.html
$(srcdir)/docs/man/man3/wiredtiger.3: $(srcdir)/docs/index.html

libwiredtiger_la_LIBADD =
if HAVE_BUILTIN_EXTENSION_LZ4
libwiredtiger_la_LIBADD += ext/compressors/lz4/libwiredtiger_lz4.la
endif
if HAVE_BUILTIN_EXTENSION_SNAPPY
libwiredtiger_la_LIBADD += ext/compressors/snappy/libwiredtiger_snappy.la
endif
if HAVE_BUILTIN_EXTENSION_ZLIB
libwiredtiger_la_LIBADD += ext/compressors/zlib/libwiredtiger_zlib.la
endif
if HAVE_BUILTIN_EXTENSION_ZSTD
libwiredtiger_la_LIBADD += ext/compressors/zstd/libwiredtiger_zstd.la
endif

libwiredtiger_static_la_LIBADD=$(libwiredtiger_la_LIBADD)
libwiredtiger_static_la_SOURCES=$(libwiredtiger_la_SOURCES)

clean-local:
	rm -rf WT_TEST
