noinst_LIBRARIES = libbibledit.a

libbibledit_a_SOURCES = \
	library/bibledit.cpp \
	library/locks.c \
	webserver/webserver.cpp \
	webserver/http.cpp \
	webserver/request.cpp \
	webserver/io.c \
	bootstrap/bootstrap.cpp \
	filter/url.cpp \
	filter/string.cpp \
	filter/roles.cpp \
	filter/md5.cpp \
	filter/usfm.cpp \
	filter/archive.cpp \
	filter/text.cpp \
	filter/passage.cpp \
	filter/css.cpp \
	filter/git.cpp \
	filter/html.cpp \
	filter/diff.cpp \
	filter/shell.cpp \
	filter/merge.cpp \
	filter/date.cpp \
	filter/memory.cpp \
	filter/webview.cpp \
	filter/mail.cpp \
	flate/flate.cpp \
	assets/view.cpp \
	assets/page.cpp \
	assets/header.cpp \
	assets/external.cpp \
	index/index.cpp \
	index/listing.cpp \
	config/globals.cpp \
	menu/logic.cpp \
	menu/index.cpp \
	locale/translate.cpp \
	locale/logic.cpp \
	database/config/general.cpp \
	database/config/bible.cpp \
	database/config/user.cpp \
	database/users.cpp \
	database/logs.cpp \
	database/sqlite.cpp \
	database/styles.cpp \
	database/bibles.cpp \
	database/books.cpp \
	database/bibleactions.cpp \
	database/check.cpp \
	database/localization.cpp \
	database/confirm.cpp \
	database/ipc.cpp \
	database/jobs.cpp \
	database/kjv.cpp \
	database/logic.cpp \
	database/oshb.cpp \
	database/sblgnt.cpp \
	database/sprint.cpp \
	database/mail.cpp \
	database/navigation.cpp \
	database/usfmresources.cpp \
	database/mappings.cpp \
	database/noteactions.cpp \
	database/versifications.cpp \
	database/modifications.cpp \
	database/notes.cpp \
	database/volatile.cpp \
	database/maintenance.cpp \
	database/imageresources.cpp \
	database/state.cpp \
	database/noteassignment.cpp \
	database/strong.cpp \
	database/morphgnt.cpp \
	database/etcbc4.cpp \
	database/hebrewlexicon.cpp \
	database/cache.cpp \
	database/login.cpp \
	database/privileges.cpp \
	database/git.cpp \
	database/userresources.cpp \
	database/statistics.cpp \
	database/sample.cpp \
	session/logic.cpp \
	session/login.cpp \
	session/logout.cpp \
	session/password.cpp \
	session/signup.cpp \
	session/switch.cpp \
	parsewebdata/ParseMultipartFormData.cpp \
	parsewebdata/ParseWebData.cpp \
	setup/index.cpp \
	setup/logic.cpp \
	journal/index.cpp \
	journal/logic.cpp \
	styles/logic.cpp \
	styles/indexm.cpp \
	styles/sheetm.cpp \
	styles/view.cpp \
	styles/css.cpp \
	styles/sheets.cpp \
	text/text.cpp \
	esword/text.cpp \
	olb/text.cpp \
	html/text.cpp \
	html/header.cpp \
	odf/text.cpp \
	timer/index.cpp \
	tasks/logic.cpp \
	tasks/run.cpp \
	config/logic.cpp \
	bb/logic.cpp \
	bb/manage.cpp \
	bb/settings.cpp \
	bb/book.cpp \
	bb/chapter.cpp \
	bb/import_run.cpp \
	bb/import.cpp \
	bb/order.cpp \
	bb/css.cpp \
	notes/logic.cpp \
	notes/actions.cpp \
	notes/note.cpp \
	notes/status-1.cpp \
	notes/assign-1.cpp \
	notes/notes.cpp \
	notes/status-n.cpp \
	notes/assign-n.cpp \
	notes/click.cpp \
	notes/poll.cpp \
	notes/summary.cpp \
	notes/bb-1.cpp \
	notes/comment.cpp \
	notes/select.cpp \
	notes/unassign-n.cpp \
	notes/bb-n.cpp \
	notes/create.cpp \
	notes/severity-1.cpp \
	notes/verses.cpp \
	notes/bulk.cpp \
	notes/edit.cpp \
	notes/index.cpp \
	notes/severity-n.cpp \
	trash/handler.cpp \
	help/index.cpp \
	confirm/worker.cpp \
	email/index.cpp \
	email/send.cpp \
	email/receive.cpp \
	user/notifications.cpp \
	user/account.cpp \
	user/logic.cpp \
	manage/index.cpp \
	manage/users.cpp \
	manage/exports.cpp \
	manage/hyphenation.cpp \
	manage/hyphenate.cpp \
	manage/write.cpp \
	manage/privileges.cpp \
	system/index.cpp \
	system/logic.cpp \
	collaboration/index.cpp \
	collaboration/link.cpp \
	collaboration/settings.cpp \
	search/rebibles.cpp \
	search/renotes.cpp \
	access/user.cpp \
	access/bible.cpp \
	access/logic.cpp \
	dialog/entry.cpp \
	dialog/list.cpp \
	dialog/yes.cpp \
	dialog/color.cpp \
	dialog/books.cpp \
	dialog/upload.cpp \
	fonts/logic.cpp \
	versification/index.cpp \
	versification/system.cpp \
	versification/logic.cpp \
	book/create.cpp \
	compare/index.cpp \
	compare/compare.cpp \
	jobs/index.cpp \
	redirect/index.cpp \
  editone2/index.cpp \
  editone2/load.cpp \
  editone2/save.cpp \
  editone2/verse.cpp \
  editone2/logic.cpp \
  editone2/update.cpp \
	navigation/passage.cpp \
	navigation/update.cpp \
	navigation/poll.cpp \
  navigation/paratext.cpp \
	ipc/focus.cpp \
	ipc/notes.cpp \
	checksum/logic.cpp \
	editusfm/focus.cpp \
	editusfm/index.cpp \
	editusfm/load.cpp \
	editusfm/offset.cpp \
	editusfm/save.cpp \
	editor/styles.cpp \
	editor/html2usfm.cpp \
	editor/usfm2html.cpp \
	editor/select.cpp \
  editor/html2format.cpp \
  editor/id.cpp \
  editor/style.cpp \
	edit/edit.cpp \
	edit/id.cpp \
	edit/index.cpp \
	edit/load.cpp \
	edit/save.cpp \
	edit/styles.cpp \
	edit/logic.cpp \
	edit/preview.cpp \
	edit/position.cpp \
	edit/navigate.cpp \
  edit2/edit.cpp \
  edit2/index.cpp \
  edit2/load.cpp \
  edit2/save.cpp \
  edit2/logic.cpp \
  edit2/preview.cpp \
  edit2/position.cpp \
  edit2/navigate.cpp \
  edit2/update.cpp \
	search/all.cpp \
	search/index.cpp \
	search/replace.cpp \
	search/getids.cpp \
	search/replacepre.cpp \
	search/replacego.cpp \
	search/search2.cpp \
	search/replace2.cpp \
	search/replacepre2.cpp \
	search/getids2.cpp \
	search/replacego2.cpp \
	search/similar.cpp \
	search/strongs.cpp \
	search/strong.cpp \
	search/originals.cpp \
	tmp/tmp.cpp \
	workspace/index.cpp \
	workspace/logic.cpp \
	workspace/settings.cpp \
	workspace/organize.cpp \
	sendreceive/logic.cpp \
	sendreceive/index.cpp \
	sendreceive/sendreceive.cpp \
	sendreceive/settings.cpp \
	sendreceive/bibles.cpp \
	sendreceive/notes.cpp \
	sendreceive/changes.cpp \
	sendreceive/files.cpp \
	sendreceive/resources.cpp \
	demo/logic.cpp \
	client/index.cpp \
	client/logic.cpp \
	sync/logic.cpp \
	sync/setup.cpp \
	sync/settings.cpp \
	sync/bibles.cpp \
	sync/usfmresources.cpp \
	sync/notes.cpp \
	sync/changes.cpp \
	sync/files.cpp \
	sync/resources.cpp \
	sync/mail.cpp \
	resource/index.cpp \
	resource/organize.cpp \
	resource/logic.cpp \
	resource/get.cpp \
	resource/external.cpp \
	resource/bb2resource.cpp \
	resource/convert2resource.cpp \
	resource/convert2bible.cpp \
	resource/manage.cpp \
	resource/print.cpp \
	resource/download.cpp \
	resource/images.cpp \
	resource/image.cpp \
	resource/img.cpp \
	resource/imagefetch.cpp \
	resource/sword.cpp \
	resource/select.cpp \
	resource/cache.cpp \
	resource/user9edit.cpp \
	resource/user1edit.cpp \
	resource/user9view.cpp \
	resource/user1view.cpp \
	resource/bbgateway.cpp \
	resource/studylight.cpp \
	resource/unload.cpp \
	jsonxx/jsonxx.cpp \
	mapping/index.cpp \
	mapping/map.cpp \
	statistics/statistics.cpp \
	changes/change.cpp \
	changes/changes.cpp \
	changes/logic.cpp \
	changes/manage.cpp \
	changes/modifications.cpp \
	changes/statistics.cpp \
	sprint/burndown.cpp \
	sprint/index.cpp \
	checks/run.cpp \
	checks/headers.cpp \
	checks/index.cpp \
	checks/logic.cpp \
	checks/sentences.cpp \
	checks/settings.cpp \
	checks/settingspatterns.cpp \
	checks/settingssentences.cpp \
	checks/space.cpp \
	checks/suppress.cpp \
	checks/usfm.cpp \
	checks/verses.cpp \
	checks/versification.cpp \
	checks/pairs.cpp \
	checks/settingspairs.cpp \
	checks/french.cpp \
	consistency/index.cpp \
	consistency/input.cpp \
	consistency/logic.cpp \
	consistency/poll.cpp \
	export/esword.cpp \
	export/html.cpp \
	export/index.cpp \
	export/info.cpp \
	export/logic.cpp \
	export/odt.cpp \
	export/onlinebible.cpp \
	export/textusfm.cpp \
	export/usfm.cpp \
	export/web.cpp \
	export/bibledropbox.cpp \
	webbb/search.cpp \
	developer/index.cpp \
	developer/logic.cpp \
	paratext/logic.cpp \
	paratext/index.cpp \
	personalize/index.cpp \
	lexicon/logic.cpp \
	lexicon/definition.cpp \
	sources/etcbc4.cpp \
	sources/kjv.cpp \
	sources/morphhb.cpp \
	sources/morphgnt.cpp \
	sources/hebrewlexicon.cpp \
	sources/oshb.cpp \
	sword/logic.cpp \
	pugixml/pugixml.cpp \
	pugixml/utils.cpp \
	public/index.cpp \
	public/logic.cpp \
	public/login.cpp \
	public/chapter.cpp \
	public/notes.cpp \
	public/new.cpp \
	public/create.cpp \
	public/note.cpp \
	public/comment.cpp \
	utf8proc/utf8proc.c \
	search/logic.cpp \
	related/logic.cpp \
	sqlite/sqlite3.c \
	ldap/logic.cpp \
	quill/logic.cpp \
	rss/logic.cpp \
	rss/feed.cpp \
	microtar/microtar.c \
	miniz/miniz.c \
	nmt/index.cpp \
	nmt/logic.cpp

bin_PROGRAMS = bibledit-cloud

bibledit_cloud_SOURCES = executable/bibledit.cpp

bibledit_cloud_LDADD = libbibledit.a

	unittests/unittest.cpp \
	unittests/utilities.cpp \
	unittests/sqlite.cpp \
	unittests/session.cpp \
	unittests/folders.cpp \
	unittests/flate.cpp \
	unittests/checksum.cpp \
	unittests/bibles.cpp \
	unittests/html2usfm.cpp \
	unittests/usfm2html.cpp \
	unittests/usfm2html2usfm.cpp \
	unittests/workspaces.cpp \
	unittests/client.cpp \
	unittests/sentences.cpp \
	unittests/versification.cpp \
	unittests/usfm.cpp \
	unittests/verses.cpp \
	unittests/pairs.cpp \
	unittests/paratext.cpp \
	unittests/hyphenate.cpp \
	unittests/search.cpp \
	unittests/json.cpp \
	unittests/related.cpp \
	unittests/editone.cpp \
	unittests/http.cpp \
	unittests/memory.cpp \
	unittests/tasks.cpp \
	unittests/biblegateway.cpp \
	unittests/rss.cpp \
	unittests/space.cpp \
	unittests/roles.cpp \
	unittests/md5.cpp \
	unittests/string.cpp \
	unittests/users.cpp \
	unittests/date.cpp \
	unittests/export.cpp \
	unittests/html.cpp \
	unittests/archive.cpp \
	unittests/odf.cpp \
	unittests/text.cpp \
	unittests/url.cpp \
	unittests/passage.cpp \
	unittests/styles.cpp \
	unittests/diff.cpp \
	unittests/git.cpp \
	unittests/ipc.cpp \
	unittests/shell.cpp \
	unittests/ldap.cpp \
	unittests/dev.cpp \
	unittests/sample.cpp \
	unittests/config.cpp \
	unittests/log.cpp \
	unittests/books.cpp \
	unittests/check.cpp \
	unittests/localization.cpp \
	unittests/confirm.cpp \
	unittests/jobs.cpp \
	unittests/kjv.cpp \
	unittests/oshb.cpp \
	unittests/sblgnt.cpp \
	unittests/sprint.cpp \
	unittests/mail.cpp \
	unittests/navigation.cpp \
	unittests/resources.cpp \
	unittests/notes.cpp \
	unittests/modifications.cpp \
	unittests/volatile.cpp \
	unittests/state.cpp \
	unittests/strong.cpp \
	unittests/morphgnt.cpp \
	unittests/etcbc4.cpp \
	unittests/lexicon.cpp \
	unittests/cache.cpp \
	unittests/login.cpp \
	unittests/privileges.cpp \
	unittests/statistics.cpp \
	unittests/webview.cpp \
	unittests/javascript.cpp \
	unittests/french.cpp \
  unittests/merge.cpp \
  unittests/nmt.cpp \
  unittests/html2format.cpp


	executable/generate.cpp \
	sources/styles.cpp


AM_CFLAGS = -Wall -Wextra -pedantic -g
AM_CFLAGS += $(OPENSSL_CFLAGS)

AM_CXXFLAGS = -Wall -Wextra -pedantic -std=c++11 -fno-var-tracking -g
AM_CXXFLAGS += $(CURL_CFLAGS)
AM_CXXFLAGS += $(OPENSSL_CFLAGS)
AM_CXXFLAGS += $(GTK_CFLAGS)
AM_CXXFLAGS += $(WEBKIT2GTK_CFLAGS)

LIBS = -Wall -lpthread -L. -g -rdynamic -ldl
LIBS += $(CURL_LIBS)
LIBS += $(OPENSSL_LIBS)
LIBS += $(GTK_LIBS)
LIBS += $(WEBKIT2GTK_LIBS)
LIBS += -L/usr/local/lib -lmimetic

# The core library compiles and embeds the mbedtls library.
# On Debian this gives a lintian error:
# E: bibledit: embedded-library usr/bin/bibledit: mbedtls
# Solve this on Debian by omitting that library from the core,
# and by linking to the mbed TLS library provided by the system.
# For other platforms, the library remains in the core.
 LIBS += -lmbedtls -lmbedcrypto -lmbedx509

EXTRA_DIST = a* bb bibledit bibles book bootstrap c* d* D* e* f* g* h* i* j* l* m* n* o* p* q* r* s* t* u* v* w*

dist-hook:
	rm -rf `find $(distdir) -name *.o`
	rm -rf `find $(distdir) -name *.a`
	rm -rf `find $(distdir) -name autom4te.cache`
	rm -f $(distdir)/server
	rm -f $(distdir)/unittest
	rm -rf `find $(distdir) -name .dirstamp`
	rm -rf `find $(distdir) -name .deps`
	rm -rf `find $(distdir) -name *~`
	rm -f $(distdir)/config.h
	rm -f $(distdir)/config.log
	rm -f $(distdir)/config.status

CLEANFILES = bibledit*.gz *~

all-local:
	pkgdata/create.sh

install-data-hook:
	$(srcdir)/pkgdata/install.sh $(srcdir) $(DESTDIR) $(pkgdatadir)

uninstall-local:
	rm -rf $(DESTDIR)$(pkgdatadir)/*

man_MANS = man/bibledit-cloud.1
