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 \
	editverse/index.cpp \
	editone/index.cpp \
	editone/load.cpp \
	editone/save.cpp \
	editone/verse.cpp \
	editone/logic.cpp \
	navigation/passage.cpp \
	navigation/update.cpp \
	navigation/poll.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 \
	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 \
	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

bin_PROGRAMS = bibledit

bibledit_SOURCES = executable/bibledit.cpp

bibledit_LDADD = libbibledit.a

	executable/generate.cpp \
	sources/styles.cpp

AM_CFLAGS = -Wall -Wextra -pedantic -g

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

LIBS = -Wall -lpthread -L. -g -rdynamic -ldl
LIBS += $(GTK_LIBS)
LIBS += $(WEBKIT2GTK_LIBS)

# 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  bibles book bootstrap c* d* D* e* f* g* h* i* j* l* m* n* o* p* q* r* s* t* u* v* w* *.desktop *.xpm *.png

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 -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.1 

applicationdir = $(datadir)/applications
application_DATA = bibledit.desktop

iconsdir = $(datadir)/icons
icons_DATA = bbe48x48.xpm bbe512x512.png

## It should be sufficient to put the icon for the .desktop file
## in the icons folder only,
## but a Debian package somehow does not install those.
## That is why the icon is also put in the pixmaps folder.

pixmapsdir = $(datadir)/pixmaps
pixmaps_DATA = bbe48x48.xpm bbe512x512.png

