AUTOMAKE_OPTIONS = subdir-objects


COMMONLIB_CPPFLAGS = -I$(top_srcdir)/$(COMMONLIB_INCLUDE_DIR)
COMMONLIB_LIB = $(top_builddir)/$(COMMONLIB_LIBRARY)

noinst_PROGRAMS = t_config_file t_dict t_fuzzy t_query t_lookupdata \
	t_convert_old_ini t_articleview t_xml t_res_database

EXTRA_DIST = sample1.ifo sample1.idx sample1.dict t_dict_client.cpp t_str.cpp

if USE_SYSTEM_SIGCPP
LOCAL_SIGCPP_LIBFILE =
LOCAL_SIGCPP_INCLUDE =
else
LOCAL_SIGCPP_LIBFILE = $(top_builddir)/src/sigc++/libsigc.a
LOCAL_SIGCPP_INCLUDE = -I$(top_srcdir)/src -I$(top_srcdir)/src/sigc++config
endif

if GNOME_SUPPORT
GCONF_MODULE_HPP=$(top_srcdir)/src/gconf_file.h
GCONF_MODULE_CPP=$(top_srcdir)/src/gconf_file.cpp
endif

t_config_file_SOURCES = t_config_file.cpp \
	$(top_srcdir)/src/config_file.h \
	$(top_srcdir)/src/inifile.h $(top_srcdir)/src/inifile.cpp \
	$(GCONF_MODULE_HPP) $(GCONF_MODULE_CPP)

t_dict_SOURCES = t_dict.cpp
t_dict_DEPENDENCIES = $(top_builddir)/src/lib/libstardict.la

#t_dict_client_SOURCES = t_dict_client.cpp
#t_dict_client_DEPENDENCIES = $(top_builddir)/src/lib/libstardict.la \
#	$(LOCAL_SIGCPP_LIBFILE)

t_fuzzy_SOURCES = t_fuzzy.cpp
t_fuzzy_DEPENDENCIES = $(top_builddir)/src/lib/libstardict.la

t_query_SOURCES = t_query.cpp
t_query_DEPENDENCIES = $(top_builddir)/src/lib/libstardict.la

t_lookupdata_SOURCES = t_lookupdata.cpp
t_lookupdata_DEPENDENCIES = $(top_builddir)/src/lib/libstardict.la

t_convert_old_ini_SOURCES = t_convert_old_ini.cpp \
	$(top_srcdir)/src/config_file.h \
	$(top_srcdir)/src/inifile.h $(top_srcdir)/src/inifile.cpp

t_articleview_SOURCES = t_articleview.cpp

t_xml_SOURCES = t_xml.cpp

# res_database is not an automated test, do not include it in TESTS
t_res_database_SOURCES = t_res_database.cpp
t_res_database_DEPENDENCIES = $(top_builddir)/src/lib/libstardict.la

## place libstardict.la before any system library, otherwise build with --as-needed linker option may fail
LDADD = $(top_builddir)/src/lib/libstardict.la $(STARDICT_LIBS) \
	$(LOCAL_SIGCPP_LIBFILE)
## -I$(top_builddir) is for config.h, it's generated by configure in the build dir
AM_CPPFLAGS = @STARDICT_CFLAGS@ $(LOCAL_SIGCPP_INCLUDE) -I$(top_builddir) \
	-I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/src/lib $(COMMONLIB_CPPFLAGS)

TESTS = \
	t_config_file t_convert_old_ini t_dict t_query t_xml

# need fix up:
# t_articleview t_lookupdata
