1# Copyright 1999-2014 the Claws Mail team.
2# This file is part of Claws Mail package, and distributed under the
3# terms of the General Public License version 3 (or later).
4# See COPYING file for license details.
5
6if CLAWS_LIBETPAN
7etpan_dir = etpan
8etpan_library = etpan/libclawsetpan.la
9else
10etpan_dir =
11etpan_library =
12endif
13
14SUBDIRS = common gtk $(etpan_dir) . plugins
15if BUILD_TESTS
16include $(top_srcdir)/tests.mk
17SUBDIRS += tests
18endif
19
20bin_PROGRAMS = claws-mail
21
22if PLATFORM_WIN32
23LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RC) \
24     `echo $(DEFS) $(DEFAULT_INCLUDES) $(IFLAGS) | \
25     sed -e 's/-I/--include-dir /g;s/-D/--define /g'`
26
27%.o : %.rc
28	$(LTRCCOMPILE) -i $< -o $@
29
30claws_mail_res_ldflag = -Wl,w32-resource.o
31claws_mail_deps = w32-resource.o
32else
33claws_mail_res_ldflag =
34claws_mail_deps =
35endif
36
37alt_abook_source = \
38	addressbook-dbus.c
39orig_abook_source = \
40	addrbook.c \
41	addrclip.c \
42	addrcustomattr.c \
43	addressbook.c \
44	addressbook_foldersel.c \
45	addrindex.c \
46	addrquery.c \
47	addrselect.c \
48	addrduplicates.c \
49	addrmerge.c \
50	browseldap.c \
51	editaddress.c \
52	editaddress_other_attributes_ldap.c \
53	editbook.c \
54	editgroup.c \
55	editjpilot.c \
56	editldap_basedn.c \
57	editldap.c \
58	editvcard.c \
59	exphtmldlg.c \
60	expldifdlg.c \
61	exporthtml.c \
62	exportldif.c \
63	importldif.c \
64	importmutt.c \
65	importpine.c \
66	jpilot.c \
67	ldapctrl.c \
68	ldaplocate.c \
69	ldapquery.c \
70	ldapserver.c \
71	ldapupdate.c \
72	ldaputil.c \
73	ldif.c \
74	mutt.c \
75	pine.c \
76	vcard.c
77
78if BUILD_ALTADDRBOOK
79abook_source = $(alt_abook_source)
80abook_extra = $(orig_abook_source)
81else
82abook_source = $(orig_abook_source)
83abook_extra = $(alt_abook_source)
84endif
85
86abook_headers = \
87	addressbook-dbus.h \
88	adbookbase.h \
89	addrbook.h \
90	addrclip.h \
91	addrcustomattr.h \
92	addressbook.h \
93	addressbook_foldersel.h \
94	addrindex.h \
95	addrquery.h \
96	addrselect.h \
97	addrduplicates.h \
98	addrmerge.h \
99	browseldap.h \
100	editaddress.h \
101	editaddress_other_attributes_ldap.h \
102	editbook.h \
103	editgroup.h \
104	editjpilot.h \
105	editldap_basedn.h \
106	editldap.h \
107	editvcard.h \
108	exphtmldlg.h \
109	expldifdlg.h \
110	exporthtml.h \
111	exportldif.h \
112	file_checker.h \
113	importldif.h \
114	importmutt.h \
115	importpine.h \
116	jpilot.h \
117	ldapctrl.h \
118	ldaplocate.h \
119	ldapquery.h \
120	ldapserver.h \
121	ldapupdate.h \
122	ldaputil.h \
123	ldif.h \
124	mutt.h \
125	pine.h \
126	vcard.h
127
128claws_mail_SOURCES = \
129	account.c \
130	action.c \
131	addrcache.c \
132	addr_compl.c \
133	addressadd.c \
134	addrgather.c \
135	addrharvest.c \
136	addritem.c \
137	advsearch.c \
138	alertpanel.c \
139	autofaces.c \
140	avatars.c \
141	compose.c \
142	crash.c \
143	customheader.c \
144	displayheader.c \
145	edittags.c \
146	enriched.c \
147	entity.c \
148	export.c \
149	file_checker.c \
150	filtering.c \
151	folder.c \
152	folder_item_prefs.c \
153	foldersel.c \
154	folderutils.c \
155	folderview.c \
156	grouplistdialog.c \
157	headerview.c \
158	html.c \
159	image_viewer.c \
160	imap.c \
161	imap_gtk.c \
162	import.c \
163	inc.c \
164	localfolder.c \
165	main.c \
166	mainwindow.c \
167	manual.c \
168	matcher.c \
169	matcher_parser_lex.l \
170	matcher_parser_parse.y \
171	mbox.c \
172	message_search.c \
173	messageview.c \
174	mh.c \
175	mh_gtk.c \
176	mimeview.c \
177	msgcache.c \
178	news.c \
179	news_gtk.c \
180	noticeview.c \
181	oauth2.c \
182	partial_download.c \
183	password.c \
184	password_gtk.c \
185	passwordstore.c \
186	pop.c \
187	prefs_account.c \
188	prefs_actions.c \
189	prefs_common.c \
190	prefs_compose_writing.c \
191	prefs_customheader.c \
192	prefs_display_header.c \
193	prefs_ext_prog.c \
194	prefs_filtering_action.c \
195	prefs_filtering.c \
196	prefs_folder_item.c \
197	prefs_fonts.c \
198	prefs_gtk.c \
199	prefs_image_viewer.c \
200	prefs_logging.c \
201	prefs_matcher.c \
202	prefs_message.c \
203	prefs_migration.c \
204	prefs_msg_colors.c \
205	prefs_other.c \
206	prefs_proxy.c \
207	prefs_quote.c \
208	prefs_receive.c \
209	prefs_send.c \
210	prefs_spelling.c \
211	prefs_summaries.c \
212	prefs_summary_column.c \
213	prefs_summary_open.c \
214	prefs_folder_column.c \
215	prefs_template.c \
216	prefs_themes.c \
217	prefs_toolbar.c \
218	prefs_wrapping.c \
219	printing.c \
220	privacy.c \
221	procheader.c \
222	procmime.c \
223	procmsg.c \
224	quote_fmt.c \
225	quote_fmt_lex.l \
226	quote_fmt_parse.y \
227	recv.c \
228	remotefolder.c \
229	send_message.c \
230	setup.c \
231	sourcewindow.c \
232	ssl_manager.c \
233	statusbar.c \
234	stock_pixmap.c \
235	summary_search.c \
236	summaryview.c \
237	textview.c \
238	toolbar.c \
239	undo.c \
240	uri_opener.c \
241	wizard.c \
242	$(abook_source)
243
244claws_mailincludedir = $(pkgincludedir)
245claws_mailinclude_HEADERS = \
246	account.h \
247	action.h \
248	addrcache.h \
249	addr_compl.h \
250	addrdefs.h \
251	addressadd.h \
252	addritem.h \
253	addressitem.h \
254	addrgather.h \
255	addrharvest.h \
256	advsearch.h \
257	alertpanel.h \
258	autofaces.h \
259	avatars.h \
260	compose.h \
261	crash.h \
262	customheader.h \
263	displayheader.h \
264	edittags.h \
265	enriched.h \
266	entity.h \
267	export.h \
268	filtering.h \
269	folder.h \
270	folder_item_prefs.h \
271	foldersel.h \
272	folderutils.h \
273	folderview.h \
274	grouplistdialog.h \
275	headerview.h \
276	html.h \
277	image_viewer.h \
278	imap.h \
279	imap_gtk.h \
280	import.h \
281	inc.h \
282	localfolder.h \
283	main.h \
284	mainwindow.h \
285	manual.h \
286	matcher.h \
287	matchertypes.h \
288	matcher_parser.h \
289	matcher_parser_lex.h \
290	matcher_parser_parse.h \
291	mbox.h \
292	message_search.h \
293	messageview.h \
294	mh.h \
295	mh_gtk.h \
296	mimeview.h \
297	msgcache.h \
298	news.h \
299	news_gtk.h \
300	noticeview.h \
301	oauth2.h \
302	partial_download.h \
303	password.h \
304	password_gtk.h \
305	passwordstore.h \
306	pop.h \
307	prefs_account.h \
308	prefs_actions.h \
309	prefs_common.h \
310	prefs_compose_writing.h \
311	prefs_customheader.h \
312	prefs_display_header.h \
313	prefs_ext_prog.h \
314	prefs_filtering_action.h \
315	prefs_filtering.h \
316	prefs_folder_item.h \
317	prefs_fonts.h \
318	prefs_gtk.h \
319	prefs_image_viewer.h \
320	prefs_logging.h \
321	prefs_matcher.h \
322	prefs_message.h \
323	prefs_migration.h \
324	prefs_msg_colors.h \
325	prefs_other.h \
326	prefs_proxy.h \
327	prefs_quote.h \
328	prefs_receive.h \
329	prefs_send.h \
330	prefs_spelling.h \
331	prefs_summaries.h \
332	prefs_summary_column.h \
333	prefs_summary_open.h \
334	prefs_folder_column.h \
335	prefs_template.h \
336	prefs_themes.h \
337	prefs_toolbar.h \
338	prefs_wrapping.h \
339	printing.h \
340	privacy.h \
341	procheader.h \
342	procmime.h \
343	procmsg.h \
344	proctypes.h \
345	quote_fmt.h \
346	quote_fmt_lex.h \
347	quote_fmt_parse.h \
348	recv.h \
349	remotefolder.h \
350	send_message.h \
351	setup.h \
352	sourcewindow.h \
353	ssl_manager.h \
354	statusbar.h \
355	stock_pixmap.h \
356	summary_search.h \
357	summaryview.h \
358	textview.h \
359	toolbar.h \
360	undo.h \
361	uri_opener.h \
362	viewtypes.h \
363	wizard.h \
364	$(abook_headers)
365
366BUILT_SOURCES = \
367	matcher_parser_parse.h \
368	quote_fmt_parse.h \
369	client-bindings.h
370
371client-bindings.h: claws-contacts.xml
372if BUILD_ALTADDRBOOK
373	dbus-binding-tool --prefix=abook --mode=glib-client --output=$@ claws-contacts.xml
374endif
375
376CLEANFILES = \
377	     $(BUILT_SOURCES)
378
379EXTRA_DIST = \
380	claws-contacts.xml \
381	w32-logo.ico w32-resource.rc \
382	pixmaps/addr_one.xpm \
383	pixmaps/addr_two.xpm \
384	pixmaps/address_book.xpm \
385	pixmaps/address_search.xpm \
386	pixmaps/address.xpm \
387	pixmaps/anonymous.xpm \
388	pixmaps/book.xpm \
389	pixmaps/cancel.xpm \
390	pixmaps/category.xpm \
391	pixmaps/checkbox_off.xpm \
392	pixmaps/checkbox_on.xpm \
393	pixmaps/check_spelling.xpm \
394	pixmaps/clipkey.xpm \
395	pixmaps/claws_mail_icon.xpm \
396	pixmaps/claws_mail_icon_64.xpm \
397	pixmaps/claws_mail_compose_logo.xpm \
398	pixmaps/claws_mail_logo.xpm \
399	pixmaps/claws_mail_logo_small.xpm \
400	pixmaps/clip.xpm \
401	pixmaps/clip_gpg_signed.xpm \
402	pixmaps/close.xpm \
403	pixmaps/complete.xpm \
404	pixmaps/continue.xpm \
405	pixmaps/copied.xpm \
406	pixmaps/delete_btn.xpm \
407	pixmaps/delete_dup_btn.xpm \
408	pixmaps/deleted.xpm \
409	pixmaps/dir_close.xpm \
410	pixmaps/dir_close_hrm.xpm \
411	pixmaps/dir_close_hrm_mark.xpm \
412	pixmaps/dir_close_mark.xpm \
413	pixmaps/dir_open.xpm \
414	pixmaps/dir_open_hrm.xpm \
415	pixmaps/dir_open_hrm_mark.xpm \
416	pixmaps/dir_open_mark.xpm \
417	pixmaps/dir_noselect_close.xpm \
418	pixmaps/dir_noselect_close_mark.xpm \
419	pixmaps/dir_noselect_open.xpm \
420	pixmaps/dir_subs_close_mark.xpm \
421	pixmaps/dir_subs_close.xpm \
422	pixmaps/dir_subs_open.xpm \
423	pixmaps/doc_index.xpm \
424	pixmaps/doc_index_close.xpm \
425	pixmaps/doc_info.xpm \
426	pixmaps/down_arrow.xpm \
427	pixmaps/drafts_close.xpm \
428	pixmaps/drafts_close_mark.xpm \
429	pixmaps/drafts_open.xpm \
430	pixmaps/drafts_open_mark.xpm \
431	pixmaps/edit_extern.xpm \
432	pixmaps/empty.xpm \
433	pixmaps/error.xpm \
434	pixmaps/exec.xpm \
435	pixmaps/first_arrow.xpm \
436	pixmaps/forwarded.xpm \
437	pixmaps/gpg_signed.xpm \
438	pixmaps/go_folders.xpm \
439	pixmaps/group.xpm \
440	pixmaps/ham_btn.xpm \
441	pixmaps/ignorethread.xpm \
442	pixmaps/inbox_open.xpm \
443	pixmaps/inbox_open_hrm.xpm \
444	pixmaps/inbox_open_hrm_mark.xpm \
445	pixmaps/inbox_open_mark.xpm \
446	pixmaps/inbox_close.xpm \
447	pixmaps/inbox_close_hrm.xpm \
448	pixmaps/inbox_close_hrm_mark.xpm \
449	pixmaps/inbox_close_mark.xpm \
450	pixmaps/interface.xpm \
451	pixmaps/insert_file.xpm \
452	pixmaps/jpilot.xpm \
453	pixmaps/key.xpm \
454	pixmaps/key_gpg_signed.xpm \
455	pixmaps/last_arrow.xpm \
456	pixmaps/ldap.xpm \
457	pixmaps/left_arrow.xpm \
458	pixmaps/linewrap.xpm \
459	pixmaps/linewrapcurrent.xpm \
460	pixmaps/locked.xpm \
461	pixmaps/mail_attach.xpm \
462	pixmaps/mail_compose.xpm \
463	pixmaps/mail_forward.xpm \
464	pixmaps/mail_privacy_encrypted.xpm \
465	pixmaps/mail_privacy_signed.xpm \
466	pixmaps/mail_receive_all.xpm \
467	pixmaps/mail_receive.xpm \
468	pixmaps/mail_reply_to_all.xpm \
469	pixmaps/mail_reply_to_author.xpm \
470	pixmaps/mail_reply_to_list.xpm \
471	pixmaps/mail_reply.xpm \
472	pixmaps/mail_send_queue.xpm \
473	pixmaps/mail_send.xpm \
474	pixmaps/mail_sign.xpm \
475	pixmaps/mail_draft.xpm \
476	pixmaps/mark.xpm \
477	pixmaps/mark_allread.xpm \
478	pixmaps/mark_allunread.xpm \
479	pixmaps/mark_ignorethread.xpm \
480	pixmaps/mark_locked.xpm \
481	pixmaps/mark_mark.xpm \
482	pixmaps/mark_read.xpm \
483	pixmaps/mark_unlocked.xpm \
484	pixmaps/mark_unmark.xpm \
485	pixmaps/mark_unread.xpm \
486	pixmaps/mark_watchthread.xpm \
487	pixmaps/mime_application.xpm \
488	pixmaps/mime_audio.xpm \
489	pixmaps/mime_image.xpm \
490	pixmaps/mime_message.xpm \
491	pixmaps/mime_pdf.xpm \
492	pixmaps/mime_ps.xpm \
493	pixmaps/mime_calendar.xpm \
494	pixmaps/mime_pgpsig.xpm \
495	pixmaps/mime_text_enriched.xpm \
496	pixmaps/mime_text_html.xpm \
497	pixmaps/mime_text_patch.xpm \
498	pixmaps/mime_text_plain.xpm \
499	pixmaps/mime_unknown.xpm \
500	pixmaps/moved.xpm \
501	pixmaps/news_compose.xpm \
502	pixmaps/new.xpm \
503	pixmaps/notice_error.xpm \
504	pixmaps/notice_note.xpm \
505	pixmaps/notice_warn.xpm \
506	pixmaps/offline.xpm \
507	pixmaps/online.xpm \
508	pixmaps/open_mail.xpm \
509	pixmaps/outbox_close.xpm \
510	pixmaps/outbox_close_hrm.xpm \
511	pixmaps/outbox_open.xpm \
512	pixmaps/outbox_open_hrm.xpm \
513	pixmaps/outbox_close_mark.xpm \
514	pixmaps/outbox_close_hrm_mark.xpm \
515	pixmaps/outbox_open_mark.xpm \
516	pixmaps/outbox_open_hrm_mark.xpm \
517	pixmaps/paste.xpm \
518	pixmaps/preferences.xpm \
519	pixmaps/printer.xpm \
520	pixmaps/printer_btn.xpm \
521	pixmaps/privacy_expired.xpm \
522	pixmaps/privacy_failed.xpm \
523	pixmaps/privacy_passed.xpm \
524	pixmaps/privacy_signed.xpm \
525	pixmaps/privacy_unknown.xpm \
526	pixmaps/privacy_warn.xpm \
527	pixmaps/privacy_emblem_encrypted.xpm \
528	pixmaps/privacy_emblem_failed.xpm \
529	pixmaps/privacy_emblem_passed.xpm \
530	pixmaps/privacy_emblem_signed.xpm \
531	pixmaps/privacy_emblem_warn.xpm \
532	pixmaps/properties.xpm \
533	pixmaps/queue_close.xpm \
534	pixmaps/queue_close_hrm.xpm \
535	pixmaps/queue_close_hrm_mark.xpm \
536	pixmaps/queue_close_mark.xpm \
537	pixmaps/queue_open.xpm \
538	pixmaps/queue_open_hrm.xpm \
539	pixmaps/queue_open_hrm_mark.xpm \
540	pixmaps/queue_open_mark.xpm \
541	pixmaps/quicksearch.xpm \
542	pixmaps/replied.xpm \
543	pixmaps/replied_and_forwarded.xpm \
544	pixmaps/right_arrow.xpm \
545	pixmaps/rotate_left.xpm \
546	pixmaps/rotate_right.xpm \
547	pixmaps/selection.xpm \
548	pixmaps/spam.xpm \
549	pixmaps/spam_btn.xpm \
550	pixmaps/trash_btn.xpm \
551	pixmaps/trash_close.xpm \
552	pixmaps/trash_close_hrm.xpm \
553	pixmaps/trash_close_hrm_mark.xpm \
554	pixmaps/trash_close_mark.xpm \
555	pixmaps/trash_open.xpm \
556	pixmaps/trash_open_hrm.xpm \
557	pixmaps/trash_open_hrm_mark.xpm \
558	pixmaps/trash_open_mark.xpm \
559	pixmaps/tray_newmail_offline.xpm \
560	pixmaps/tray_newmail.xpm \
561	pixmaps/tray_newmarkedmail_offline.xpm \
562	pixmaps/tray_newmarkedmail.xpm \
563	pixmaps/tray_nomail_offline.xpm \
564	pixmaps/tray_nomail.xpm \
565	pixmaps/tray_unreadmail_offline.xpm \
566	pixmaps/tray_unreadmail.xpm \
567	pixmaps/tray_unreadmarkedmail_offline.xpm \
568	pixmaps/tray_unreadmarkedmail.xpm \
569	pixmaps/unread.xpm \
570	pixmaps/read.xpm \
571	pixmaps/up_arrow.xpm \
572	pixmaps/vcard.xpm \
573	pixmaps/watchthread.xpm \
574	pixmaps/zoom_fit.xpm \
575	pixmaps/zoom_in.xpm \
576	pixmaps/zoom_out.xpm \
577	pixmaps/zoom_width.xpm \
578	$(abook_extra)
579
580
581IFLAGS = \
582	-I$(srcdir)/common \
583	-Icommon \
584	-I$(srcdir)/gtk \
585	-I$(srcdir)/etpan
586
587claws_mail_LDFLAGS = \
588	$(claws_mail_res_ldflag)
589
590claws_mail_DEPENDENCIES = $(claws_mail_deps) \
591	$(etpan_library) \
592	gtk/libclawsgtk.la
593
594claws_mail_LDADD = \
595	$(etpan_library) \
596	gtk/libclawsgtk.la \
597	$(ENCHANT_LIBS) \
598	$(INTLLIBS) \
599	$(GTK_LIBS) \
600	$(LDAP_LIBS) \
601	$(GNUTLS_LIBS) \
602	$(NETTLE_LIBS) \
603	$(COMPFACE_LIBS) \
604	$(JPILOT_LIBS) \
605	$(PTHREAD_LIBS) \
606	$(SM_LIBS) \
607	$(LIBICONV) \
608	$(STARTUP_NOTIFICATION_LIBS) \
609	$(LIBETPAN_LIBS) \
610	$(DBUS_LIBS) \
611	$(SVG_LIBS) \
612	$(CONTACTS_LIBS)
613
614pixmapdir=$(datadir)/icons/hicolor/48x48/apps
615
616AM_CPPFLAGS = \
617	-DG_LOG_DOMAIN=\"Claws-Mail\" \
618	-DLOCALEDIR=\""$(localedir)"\" \
619	-DPIXMAP_DIR=\""$(pixmapdir)"\" \
620	-DMANUALDIR=\""$(manualdir)"\" \
621	-DTARGET_ALIAS=\""$(target_triplet)"\" \
622	-DSYSCONFDIR=\""$(sysconfdir)"\" \
623	-DDATAROOTDIR=\""$(datarootdir)"\" \
624	$(IFLAGS) \
625	$(ENCHANT_CFLAGS) \
626	$(GTK_CFLAGS) \
627	$(GNUTLS_CFLAGS) \
628	$(GPGME_CFLAGS) \
629	$(LIBETPAN_CPPFLAGS) \
630	$(STARTUP_NOTIFICATION_CFLAGS) \
631	$(DBUS_CFLAGS) \
632	$(SVG_CFLAGS) \
633	$(NETWORKMANAGER_SUPPORT_CFLAGS) \
634	$(VALGRIND_CFLAGS) \
635	$(CONTACTS_CFLAGS)
636
637#no-unused-function is there because of bison stuff
638#no-deprecated-declarations because of gpgme_data_rewind, which we have
639#to call inside gpgme due to our lack of LARGEFILE support
640
641AM_YFLAGS = -d
642
643if CYGWIN
644claws-mail$(EXEEXT): $(claws_mail_OBJECTS) $(claws_mail_DEPENDENCIES)
645	@rm -f claws-mail$(EXEEXT)
646	@rm -f claws-mail.def claws-mail.base claws-mail.exp libclaws-mail.a .libs/libclaws-mail.a
647	$(LINK) -shared $(claws_mailLDFLAGS) -Wl,--out-implib=libclaws-mail.a -Wl,--export-all-symbols,--exclude-symbols,main $(claws_mail_OBJECTS) -Wl,--no-whole-archive $(claws_mail_LDADD) $(LIBS)
648	dlltool --output-def claws-mail.def --dllname claws-mail$(EXEEXT) --export-all-symbols --exclude-symbols main $(claws_mail_OBJECTS) gtk/.libs/libclawsgtk.a
649	$(LINK) $(claws_mail_LDFLAGS) -Wl,--base-file,claws-mail.base $(claws_mail_OBJECTS) $(claws_mail_LDADD) $(LIBS)
650	sleep 5
651	dlltool --base-file claws-mail.base --input-def claws-mail.def --output-exp claws-mail.exp
652	$(LINK) $(claws_mail_LDFLAGS) -Wl,claws-mail.exp $(claws_mail_OBJECTS) $(claws_mail_LDADD) $(LIBS)
653	@cp libclaws-mail.a .libs/libclaws-mail.a
654else
655#claws-mail$(EXEEXT): $(claws_mail_OBJECTS) $(claws_mail_DEPENDENCIES)
656#	@rm -f claws-mail$(EXEEXT)
657#	$(LINK) $(claws_mail_LDFLAGS) $(claws_mail_OBJECTS) $(claws_mail_LDADD) $(LIBS)
658endif
659